Skip to content

fix(core): follow presentation transforms in touch events - #618

Draft
houko wants to merge 3 commits into
mainfrom
fix/touch-presentation-coordinates
Draft

houko wants to merge 3 commits into
mainfrom
fix/touch-presentation-coordinates

Conversation

@houko

@houko houko commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Touch handlers inside a panned or zoomed camera currently receive positions from the committed layout, even though the native view has moved. Capture the native hit target and each listening view's current local coordinates on the platform thread, then carry that snapshot through capture, bubbling, responder negotiation and responder callbacks. A responder keeps receiving coordinates for every remaining finger after its original finger lifts.

Implement snapshots on macOS, iOS, Android, Windows, Linux and the web, and use the bound-transform model in headless tests. Refresh Android transform origins after native layout so a camera mounted before its views have dimensions draws and receives input at the intended coordinates. Rebuild the committed Android runtime. Document the remaining HarmonyOS, mini program and watchOS gaps.

Closes #519.

Validation (after rebasing onto current main):

  • Real native input: TestTouchCoordinatesFollowTheCamera and TestTouchMovesFollowNestedBoundTransforms pass on macOS, the iOS simulator, an Android API 35 emulator, Windows 11, Linux/X11 (Xvfb) and the web. The whole internal/testhost/testdata/press package passes on Android, Linux and the web, and headless.
  • Disabling snapshot consumption in core makes both tests fail on macOS and Android.
  • Core: 713 passed; driver: 135 passed; nsgotest: 78 passed; Android package tests (including the snapshot parser) pass; go tool nsgo test -run 'Layer|Skills|Doc' . passes.
  • go tool nsgo check -target all passes for macOS, Windows, Linux, Android and the web, and for ios, ios_simulator, tvos_simulator and watchos_simulator on a Mac with Xcode.
  • CI already runs the whole press package on Linux, macOS, Windows, the web and the Android emulator, so the new tests run there without workflow changes.
  • No physical iPhone check: the iOS path is verified on the simulator only.

@github-actions github-actions Bot added size/L bug Something isn't working documentation Improvements or additions to documentation macOS iOS Windows Linux Web Android core ci labels Nov 17, 2026
Comment thread internal/platform/android/touch.go Fixed
@github-actions github-actions Bot added the conflict Conflicts with the base branch; resolve it first label Nov 17, 2026
@houko
houko force-pushed the fix/touch-presentation-coordinates branch from 934db13 to 343931f Compare November 18, 2026 02:43
@github-actions github-actions Bot removed the conflict Conflicts with the base branch; resolve it first label Nov 18, 2026
The Android CI emulator is 320 points wide, so a 400-point camera put its zoom button off screen and the test could not press it. Use a 300-point camera with smaller content, as the package's other tests stay within 320 points.
@houko
houko force-pushed the fix/touch-presentation-coordinates branch from 343931f to 38bb88b Compare November 18, 2026 04:03
CodeQL flagged converting strconv.Atoi's int to the 32-bit NodeID without a bound check. Parse the view id with ParseUint at 32 bits, as the target id already is.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Android bug Something isn't working ci core documentation Improvements or additions to documentation iOS Linux macOS size/L Web Windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

core: touch and responder positions ignore bound animated transforms

2 participants