Repository navigation
fix(android): keep overflow probes from stealing touches - #2323
Conversation
Only probe native containers outside their hit bounds when a descendant is hit. Preserve routed overflow and hit slop, and cover input focus and sibling presses. Fixes nsgo-dev#2310
houko
left a comment
There was a problem hiding this comment.
The Android routing change and its regression test match issue #2310. The focused routing test and Android check pass locally.
I cannot approve this pull request yet because the current Test workflow has a failed Apple job at internal/testhost/testdata/keys/mobilekeys_test.go:150 in TestMenuAutoEditingKey. The branch is mergeable, but a required repository workflow is still red, so the implementation evidence is incomplete. Please rerun or fix the failing workflow and provide a green full check before approval.
houko
left a comment
There was a problem hiding this comment.
Source-level review against #2310. In NsgoView.Group.route, an overflow probe outside a non-Group child's bounds is now accepted only when touchHit(child, x, y) finds an actual descendant hit. Group probes retain their special childrenOnly behavior, and hit slop still bypasses the descendant check. This preserves overflow descendants and hit slop while preventing an unrelated clickable sibling from claiming a touch that landed on an earlier input or button. The regression covers focus, button press, and link press independently. I found no source-level defect. The current Apple workflow failure must be resolved before merge.
Summary
Fixes #2310.
An overflow probe now reaches a native container such as clickable text only when its bounds or hit slop hold the touch, or a descendant is actually hit. This keeps clickable text from taking taps meant for an earlier input or button without disabling hit slop or nested transformed overflow. The regression checks that the input focuses and that the button and link each receive their own tap.
Targets
Screenshots
None. Touch routing only.
Verification
go tool nsgo check -target android_arm64 -jobs 2 ./internal/testhost/testdata/pressinternal/platform/android/runtime/build.shin a temporary directory and used the results via a Go overlay. The trackedclasses.dexandclasses.jarare unchanged.go tool nsgo test -target android -device emulator-5562 -timeout 2m -run '^(TestClickableTextDoesNotStealSiblingTouches|TestPressRoutingDoesNotDisableSiblings|TestDeclinedRoutingLeavesPansToTheTouchedViews|TestOverflowPressLeavesItsContainersPressable|TestPressRoutingUsesNestedTransforms|TestPressReportsFocus)$' ./internal/testhost/testdata/press— 6 passed on an arm64 Android API 36 emulator.Checklist
🤖 openai-codex/gpt-6.2-sol