Problem#
On macOS, a two-finger swipe that starts at the edge of a code or diff pane locks into thread navigation; reversing direction then scrolls the pane, and the thread still switches when the fingers lift. Fixes #39099.
Change#
HistorySwipeNavigation checked canScrollHorizontally only once, in lockSwipeAxis after the first 8 px. A gesture in tracking was never re-checked, and the passive wheel listener let the pane scroll natively while distance kept accumulating.
apps/web/src/components/HistorySwipeNavigation.tsx: in the tracking branch, a horizontal wheel event that a scroller on its composed path can absorb now ignores the rest of the gesture and hides the indicator, the same way the vertical-scroll bailout does.
- A swipe that starts at the edge and never scrolls the pane still goes Back/Forward, as intended in #28160.
Scope#
Bug fix for #39099, the case #28091 left open. One problem. Mobile has no history swipe (React Native navigation), so only web is affected; desktop wraps web. No contract, settings, or keybinding surface.
Verification#
Found from the user's repro (right, left, right over long unwrapped code), then traced to the one-time check in lockSwipeAxis.
- New
HistorySwipeNavigation.browser.test.tsx rows emulate native scrolling on the pane and reverse direction at the right edge and the left edge. Both fail on main (navigateHistory called 1 time) and pass with the fix. The existing "swiping back at a shadow-root scroller's left edge navigates" row still passes.
vp test run src/components/HistorySwipeNavigation.browser.test.tsx src/components/HistorySwipeNavigation.test.ts: 18 passed.
vp run check:changed: all pass.
- Not checked on a physical trackpad in the running app; synthetic wheel events cannot drive Chromium's native trackpad scrolling, so no before/after capture.
Made-with: claudeAgent/claude-opus-5-5
Hi @juliusmarminge ! Could you please double-check since the CI runners have already been restored?