Skip to content

feat: embed GPUI Kit Markdown in a Swift iOS container - #2

Merged
huacnlee merged 2 commits into
mainfrom
codex/markdown-example
Sep 11, 2026
Merged

feat: embed GPUI Kit Markdown in a Swift iOS container#2
huacnlee merged 2 commits into
mainfrom
codex/markdown-example

Conversation

@huacnlee

Copy link
Copy Markdown
Member

Summary

Embed GPUI Kit's Markdown TextView in a Swift-owned UIKit window instead of letting GPUI create the iOS example's window. A child controller renders into GPUITextView: UIView; native Compact / Expanded controls exercise layout changes. The light English sample puts emphasis, quotes, nested lists, code, tables, and tasks on the first screen.

Fix two startup failures exposed by the simulator: supply the UIKit display handle to wgpu 29, and retain the run_embedded application handle so native callbacks cannot outlive the GPUI app. Synchronize layout and redraw without implicit animations during size changes. Correct the Xcode static-library paths and build directory.

Pins GPUI Kit to commit 7d9efcd2069f9eaa6eb3ba6345aac4aa7d87c9f7 from longbridge/gpui-kit#3045, so a sibling local checkout is not required. No crates are published.

The embedding example supports one GPUI view for the application lifetime; independent destruction and multiple instances are not implemented.

Test Plan

  • Passed cargo check --manifest-path example/Cargo.toml --target aarch64-apple-ios-sim with the pinned Git dependency.
  • Built the Swift app with Xcode for the iOS simulator and ran it on iPhone 17 Pro / iOS 26.5 using the same GPUI Kit source revision locally.
  • Verified light Markdown rendering, native controls, and Compact / Expanded resizing.
  • Passed git diff --check and bash -n example/build.sh.
  • Embedded scrolling needs manual verification: the automation tool emitted touch begin/end without move events. Transient resize jitter also needs visual confirmation.
  • No Android, physical-device, or performance testing performed.

huacnlee and others added 2 commits September 11, 2026 21:30
Co-authored-by: Codex <codex@openai.com>
Co-authored-by: Codex <codex@openai.com>
@huacnlee
huacnlee merged commit 1ce82d6 into main Sep 11, 2026
4 checks passed
@huacnlee
huacnlee deleted the codex/markdown-example branch September 11, 2026 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant