Skip to content

fix: tap no longer bypasses occlusion via the direct-invoke fast path (FP-10) - #266

Merged
pbertsch merged 1 commit into
mainfrom
FP10
Aug 31, 2026
Merged

fix: tap no longer bypasses occlusion via the direct-invoke fast path (FP-10)#266
pbertsch merged 1 commit into
mainfrom
FP10

Conversation

@pbertsch

Copy link
Copy Markdown
Member

Summary

  • Jira: FP-10 · GitHub: tap has no occlusion/hit-test guard — can succeed against overlay-covered widgets #265
  • _tryDirectTap invoked a Semantics-wrapped button's onTap by walking the Element tree structurally, with no relationship to paint order — unlike a real hit-tested pointer tap, which Flutter's own pointer dispatch resolves correctly. That let tap succeed against a widget hidden behind a modal barrier, loading overlay, or Stack sibling that a real user's tap would hit instead.
  • tap now runs a read-only hit test (the same hitTestInView call Flutter's own dispatch makes internally) before taking the direct-invoke path, and only uses it when the target is genuinely the topmost thing at its own screen position. Otherwise it falls through to the existing real hit-tested pointer tap, which already lands on whatever's actually on top — no new error path needed.
  • Scope correction from the original tickets: only _tap has the direct-invoke branch — _doubleTap/_longPress already only use the real gesture path, so they're untouched.
  • Explicitly does not reorder direct-invoke vs. hit-tested-gesture (an earlier, retracted proposal) — see PT-04/PT-05 in IMPROVEMENT_TASKS.md for why that would regress confirmed bugs.
  • Version bump to 0.14.0 (agent + CLI, kept in lockstep) to ship this alongside the already-unreleased FP-6 GPS route simulation feature. CHANGELOG.md, probe_agent/CHANGELOG.md, VERSION, probe_agent/pubspec.yaml, vscode/package.json, and docs/wiki/Home.md all updated.
  • No CLI flag / ProbeScript keyword changes, so no MCP tool description updates needed.

Test plan

  • dart analyze lib/ test/tap_occlusion_test.dart — no issues
  • flutter test (probe_agent) — full suite passes (42/42), including new tap_occlusion_test.dart (covered button not tapped; uncovered button still tapped directly — PT-05 regression guard) and no regressions in tap_focus_test.dart/tap_no_ontap_test.dart (PT-04/PT-05's own tests)
  • go build ./... — clean (no Go source changed)

… (FP-10)

_tryDirectTap invokes a Semantics-wrapped button's onTap by walking the
Element tree structurally, with no relationship to paint order — unlike
a real hit-tested pointer tap, which Flutter's own pointer dispatch
resolves correctly. That let `tap` succeed against a widget hidden
behind a modal barrier, loading overlay, or Stack sibling a real user's
tap would hit instead.

tap now runs a read-only hit test (the same hitTestInView call Flutter's
own dispatch makes internally) before taking the direct-invoke path, and
only uses it when the target is genuinely the topmost thing at its own
screen position — otherwise it falls through to the existing real
hit-tested pointer tap, which already lands on whatever's actually on
top. No change needed for _doubleTap/_longPress — they never had the
direct-invoke branch to begin with.

Version bump to 0.14.0 (agent + CLI, kept in lockstep) to ship this
alongside the already-unreleased FP-6 GPS route simulation feature.
@pbertsch
pbertsch requested a review from a team as a code owner August 31, 2026 22:07
@pbertsch
pbertsch added this pull request to the merge queue Aug 31, 2026
Merged via the queue into main with commit 78b5014 Aug 31, 2026
14 of 15 checks passed
@pbertsch
pbertsch deleted the FP10 branch August 31, 2026 22:19
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