You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Trackpad swipe still switches threads after the gesture scrolls a code pane #39099
I searched existing issues and did not find a duplicate.
I included enough detail to reproduce or investigate the problem.
Area
apps/web
Steps to reproduce
On macOS (desktop app or web), open a thread with at least one thread in history to go Forward to (or Back to).
Open a code or diff pane with unwrapped long lines, scrolled all the way to the right.
With the pointer over that pane, start a two-finger trackpad swipe to the right (nothing to scroll, so the Forward indicator appears).
Without lifting the fingers, move left: the code scrolls left.
Move right again past the swipe distance and lift.
The mirror also reproduces: pane scrolled to the left edge, start left, reverse right (code scrolls), come back left.
Expected behavior
Once the pane actually scrolls horizontally, the rest of that gesture belongs to the pane, as in a browser. The thread stays.
A swipe that starts at the pane's edge and never scrolls it should still go Back/Forward (as intended in #28160).
Actual behavior
The code scrolls, and the thread also switches when the fingers lift.
HistorySwipeNavigation (apps/web/src/components/HistorySwipeNavigation.tsx) decides once, in lockSwipeAxis after the first SWIPE_AXIS_LOCK_DISTANCE (8 px), whether a horizontal scroller under the pointer can scroll in the first direction (canScrollHorizontally). If it cannot, the gesture becomes tracking and is never re-checked. The window wheel listener is passive, so the reversed movement still scrolls the pane natively while the same gesture keeps accumulating distance toward the 120 px trigger.
This is the case #28091 left open: it only checks at the start of the gesture.
Activity