Repository navigation
fix(selectors): refuse a zero-area press target instead of tapping its origin - #3934
Conversation
…s origin A 0x0 node (SpringBoard keeps page-1 icons that way on page 2) passed normalizeRect and resolved to its origin, so `press` tapped there and reported success. resolveInteractionTouchPoint now answers `invalid` for a target with zero width or height, which surfaces as the existing target_bounds_invalid refusal with dispatched: 'no'. Closes callstack#3841 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks for the fix. At 5bbc20c the code change looks right, but it needs live device evidence before it can merge. This PR changes which points a live press, click, fill or longpress dispatches on iOS: a 0x0 SpringBoard icon now refuses instead of tapping the origin. That is an interaction-dispatch change, so docs/agents/pull-requests.md asks for live proof. The only command-level test uses a fake backend, and the PR says the #1296 SpringBoard route was not re-run. Nothing yet shows that a real capture reports page-2 icons as 0x0 through this route, or that a positive-area page-2 icon still taps. Please run the head build on a simulator or device ( Not blocking, and fine to take or leave: CI is green: 11 checks, none failing. None of them runs a live device lane on this route. I could not run the new tests or the base-versus-head check here, so I judged the regression test from the base code and the passing CI. There are no conflicts. Merge needs the SpringBoard page-2 evidence recorded in the PR body at the head SHA. |
|
Live evidence at
I left the two non-blocking points out of this PR. 🤖 Addressed by Claude Code |
|
Thanks, that covers it at 5bbc20c. The page-1 icon on page 2 reports 0x0 with hittable false, the press on it is refused with |
Summary
A selector that matched a 0×0 node (SpringBoard keeps page-1 icons that way on page 2) resolved to the rect's origin, so
presstapped (0, 0) and reported success.resolveInteractionTouchPointnow returnsinvalidfor a target with zero width or zero height. That surfaces as the existingtarget_bounds_invalidrefusal withdispatched: 'no'.normalizeRectis unchanged, because other readers use zero-size rects.This applies to every command that aims through
resolveNodeTouchPoint: press/click, and fill or longpress on a selector or ref.3 files: the resolver, its unit test (zero width, zero height, both, plus a 1×1 target that still resolves), and a command-level
presscase that refuses and records no tap.Closes #3841
Validation
5bbc20cd3(basec48d27a81).pnpm check:affected --run --head 5bbc20cd3: passed,exactCommit=true.resolvedinstead ofinvalid; "Missing expected rejection") and pass at head.5bbc20cd3: iPhone 17 Pro Max simulator, iOS 26.5,open com.apple.springboard, home screen on "Page 2 of 2",snapshotQuality.backend: tree.snapshotshows the page-1 icons (Calendar, Photos, Settings, …) at0,0 0x0,hittable: false. This layout has no Clock, soSettingsstands in.press 'label="Settings"'→ exit 1,COMMAND_FAILED,reason: target_bounds_invalid,dispatched: no, "Selector label="Settings" resolved to invalid bounds". The request log shows onlyappState,appState,snapshotsent to the runner, and no tap.press 'label="Watch"'(page 2,72x94) → exit 0, "Tapped label="Watch" (170, 139)" (its center) and opened Watch.🤖 Generated with Claude Code