fix(scroll): keep adb-backed Android directional swipes inside the resolved scrollable

Merged
AI
1mo ago
+492-37

Summary

Clamps directional scroll endpoints on adb-backed Android to the resolved scrollable (#2714), per the rule agreed with #1821. Endpoints stay strictly inside the container's half-open rect, inset 8 px, and within the 10% padding along the scrolled axis. A shortened swipe reports pixels (dispatched) beside requestedPixels.

  • The daemon reads the container from the current stored tree before the gesture. There is no container for a stale tree, a horizontal scroll, or desktop/web.
  • buildScrollGesturePlan takes an optional container. A span that fits is unchanged.
  • Android composes it with the keyboard clip.

9 files, CHANGELOG included. The planner vectors are TS-only because the Swift twin doesn't clamp yet.

Not covered yet: iOS (including the Oct 7 keyboard-clip repro) and WebDriver/Appium. I'd like those as stacked follow-ups.

Validation

check:affected --run --head 86214adf3 (exactCommit): format, lint, typecheck, layering, fallow and build pass. vitest-related: 856/857 files pass. The one failure is a new URL(import.meta.url).pathname test that breaks on this host's space-containing path and fails identically on main. After that, run directly: unit has 14,575 passing and 6 failures that also fail on main; provider-integration and eager-closure-budgets pass.

Live on Pixel_7_API_36:

  • Settings scroll up 0.8 (list top y=480): main starts on the search bar → scroll_no_progress; branch 480→2808, moved.
  • Clock scroll down 0.8 (list 368..2756 above the nav bar) at 86214adf3: y1 2747→376, pixels 2371 < requestedPixels 2496, moved. Main: scroll_no_progress.