fix(ios): restore the back swipe's pre-swipe still span

Merged
TH
3h ago
+75-29

Summary

Follow-up to #4508. iOS back's swipe fallback required the screen to be still for a span derived from the post-swipe delay. When #4508 cut that delay to 0.1 s, the span shrank from about 0.55 s to 0.4 s on a simulator. A screen that repaints itself every 0.4โ€“0.55 s (carousel, pulsing badge) could then look still, and its own repaint after a no-op swipe was read as a successful back. The agent then works on the wrong screen, and a retry can go back twice.

The still span now has its own 250 ms margin, independent of the delay: about 0.55 s on a simulator again. The 0.1 s after-sample and the 0.05 s sampling pause stay. The settle budget derives from the span. The cost is about 0.15 s on swipe-path backs only; the navigation-bar button path is unaffected. 5 files.

Validation

Head 8946026, base ddbfc85.

  • All 36 back runner tests pass on an iPhone 17 simulator (iOS 27.0), including the new one: a screen that repaints every 0.5 s with a no-op swipe, tried at five timer phases, answers back_swipe_unverified. With the old 100 ms span, that test fails (misread as success).
  • macOS runner test build: TEST BUILD SUCCEEDED. check:xctest-selection, focused vitest (109), typecheck, and lint pass.
  • Swipe-path back in Safari history, 8 runs each, from runner trace: settle samples 4 โ†’ 5, still time median 422 โ†’ 574 ms (+152 ms). After-sample gap unchanged (~320 ms).
  • CI owns check:affected.

๐Ÿค– Generated with Claude Code


Autofix with [code]smith
Open in [code]smith ยท Need help on this PR? Tag @codesmith-bot with what you need.