Skip to content

ios: Clear touch hover and preserve cancellation - #50

Open
huacnlee wants to merge 3 commits into
itsbalamurali:mainfrom
longbridge:upstream/03-clear-ios-touch-hover-and-preserve-cance
Open

huacnlee wants to merge 3 commits into
itsbalamurali:mainfrom
longbridge:upstream/03-clear-ios-touch-hover-and-preserve-cance

Conversation

@huacnlee

@huacnlee huacnlee commented Sep 27, 2026 •

Copy link
Copy Markdown

Summary

A released iOS touch currently leaves GPUI's synthetic mouse over the last control, keeping hover feedback active. Clear the pointer hit test and emit MouseExited after touch end/cancellation and momentum frames, while preserving the original position for click and scroll dispatch.

Handle UIKit cancellation separately so it never commits a deferred tap or starts a momentum fling. Cancel an active scroll with TouchPhase::Cancelled.

Test Plan

  • Built the Swift-hosted iOS example for aarch64-apple-ios-sim.
  • Used a temporary simulator smoke view to check HoverCard opens on tap, remains open when its content is tapped, and closes on outside tap.
  • Checked a normal ghost button with a configured tooltip: no lingering hover background or tooltip after release.
  • GPUI Kit regression tests cover desktop hover and mobile tap interaction.
  • UIKit cancellation was reviewed in code; no system-cancellation gesture was injected. Android was not changed or tested. No crates published.

🤖 Generated with Claude Code

Switch the mobile platform and the example from Zed git dependencies to the
matching `gpui-pre` / `gpui-pre-wgpu` 0.3.4 crates.io packages (imported as
`gpui` / `gpui_wgpu`, so no `use` changes are needed). This removes the
`[patch.crates-io]` async-task fork and every git dependency, which makes the
crate publishable to crates.io and lets consumers depend on it without
reproducing Zed's patches.

Adapt to the platform and styling API differences, fix the "wpgu" typo in the
crate description, and update the publish workflow to check the iOS backends
before publishing and to treat the `dry-run` input as the boolean it is.

Test plan:
- cargo check --all-targets
- cargo check --target aarch64-apple-ios / aarch64-apple-ios-sim
- cargo test --lib
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.

- 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.

---------

Co-authored-by: Codex <codex@openai.com>
A released iOS touch currently leaves GPUI's synthetic mouse over the
last control, keeping hover feedback active. Clear the pointer hit test
and emit MouseExited after touch end/cancellation and momentum frames,
while preserving the original position for click and scroll dispatch.

Handle UIKit cancellation separately so it never commits a deferred tap
or starts a momentum fling. Cancel an active scroll with
TouchPhase::Cancelled.

Update the example's GPUI Kit revision to include mobile tooltip
suppression, tap-triggered HoverCard behavior, and the inline is_mobile
helper from longbridge/gpui-kit#3045.

- Built the Swift-hosted iOS example for aarch64-apple-ios-sim.
- Used a temporary simulator smoke view to check HoverCard opens on tap,
remains open when its content is tapped, and closes on outside tap.
- Checked a normal ghost button with a configured tooltip: no lingering
hover background or tooltip after release.
- Restored the original chat example and rebuilt it with the final Kit
revision.
- GPUI Kit regression tests cover desktop hover and mobile tap
interaction.
- UIKit cancellation was reviewed in code; no system-cancellation
gesture was injected. Android was not changed or tested. No crates
published.

Co-authored-by: Codex <codex@openai.com>
@huacnlee
huacnlee force-pushed the upstream/03-clear-ios-touch-hover-and-preserve-cance branch from 708548b to bef6363 Compare September 27, 2026 12:06
@huacnlee huacnlee changed the title Clear iOS touch hover and preserve cancellation ios: Clear touch hover and preserve cancellation Sep 27, 2026
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