fix(ios): refuse a press whose target is not hittable

Merged
TH
2h ago
+724-26

Summary

On iOS, press/click on a closed swipe action (RN ReanimatedSwipeable) reported success but tapped the row beside it: snapshot hittable is geometric only. A press now refuses before dispatch with target_not_hittable, dispatched: no.

  • Gate (snapshot only): isNestedTouchControl selects touch controls inside a larger touch control (the swipe-action shape). Other presses pay nothing.
  • Gated target: one lean runner read (querySelector with hittabilityProbe: counts every match, reads isHittable and frame of a single one). notHittable refuses. unknown (no selector, ambiguous, frame not the target's, read failure) proceeds as before.
  • Hook: new probeTargetHittability backend sibling of the offscreen probe, called in admitResolvedTarget before the motion check. iOS only; snapshot output and latency are unchanged. No coveredBy is claimed.

20 files. Refs #4568 (iOS part).

Before: press @e15 on closed Delete Avocado → Tapped @e15 (338, 467), row toggled ("2 items still to buy").
After:

Error (COMMAND_FAILED): "Delete Avocado" is not hittable: a tap would land on another element. Not dispatched. Next: Reveal the control (for example swipe its row), then take a fresh snapshot -i.
details: {reason: target_not_hittable, ref: @e15, rect: {294,425.67,88,82}, dispatched: no}

Row unchanged. After the row is swiped open, the same press deletes it.

Validation

Tested head 10e38f8da8, base cfe08502f0. pnpm check:affected --run --head HEAD: 25 checks passed (receipt run-ezpc0k). Native RunnerTests probe and selector tests ran with INCLUDE_UNIT_TESTS=1: 2/2 passed. CI owns coverage and device lanes.

Device (iOS 26.2 sim, Pantry RN app): closed Delete refused, open Delete pressed; the 22x22 Recipes "Save" button is not nested, so it is ungated and unchanged.

Press latency, ms (base → head):

Pressbasehead
ungated tab press, 6 runs532–572524–549
gated open-row Delete, 9 samples527–702526–832, medians within noise
refused press, 5 runsn/a253–332

Not covered: native UITableView swipe actions (no fixture), Android.