Skip to content

Clear iOS touch hover and preserve cancellation - #3

Merged
huacnlee merged 1 commit into
mainfrom
codex/ios-touch-hover
Sep 11, 2026
Merged

Clear iOS touch hover and preserve cancellation#3
huacnlee merged 1 commit into
mainfrom
codex/ios-touch-hover

Conversation

@huacnlee

@huacnlee huacnlee commented Sep 11, 2026

Copy link
Copy Markdown
Member

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.

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.

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.
  • 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 changed the title fix: clear iOS touch hover and preserve cancellation Clear iOS touch hover and preserve cancellation Sep 11, 2026
@huacnlee
huacnlee merged commit 8a21e63 into main Sep 11, 2026
5 checks passed
@huacnlee
huacnlee deleted the codex/ios-touch-hover branch September 11, 2026 16:00
@huacnlee huacnlee changed the title Clear iOS touch hover and preserve cancellation Fix mobile touch hover and cancellation on iOS and Android Sep 11, 2026
@huacnlee huacnlee changed the title Fix mobile touch hover and cancellation on iOS and Android Clear iOS touch hover and preserve cancellation Sep 11, 2026
huacnlee added a commit that referenced this pull request Sep 11, 2026
## Summary

Apply the iOS touch cleanup from #3 to Android. After touch
release/cancellation and every momentum frame, move the synthetic
pointer outside the window and emit MouseExited so hover does not remain
on the last control. Preserve original coordinates for click and scroll
dispatch.

Handle ACTION_CANCEL independently: discard queued coalesced scroll,
reset velocity, stop inertia, and emit ScrollWheel(Cancelled) for an
active scroll. Never turn cancellation into a tap or fling, and ignore
stray moves with no active touch.

Add regression tests and update an existing test to use the renamed
gpu_specs API.

## Test Plan

- Android arm64/API 31 cargo-ndk library check passed.
- Built the Android unit-test executable and ran touch tests on an
Android API 34 arm64 emulator: 5 passed.
- Tests cover tap coordinates, pending-tap cancellation,
coalesced-scroll cancellation, and post-momentum hover cleanup.
- This verification covers platform event dispatch; Android app UI
testing is ongoing separately.

Co-authored-by: Codex <codex@openai.com>
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