Before submitting#
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.
Impact#
Minor bug or occasional failure
Version or commit#
main @ 2c7bfcec84
Environment#
macOS, built-in trackpad, desktop app and web (Chromium).
Logs or stack traces#
N/A
Workaround#
Lift the fingers before reversing direction.
#41264, now on main: Starting at either edge of a horizontally scrollable code or diff pane and reversing direction now keeps the current thread because the whole gesture is ignored for history navigation.
Not done: The report also explicitly requests that an edge swipe which never scrolls the pane still navigate Back/Forward, but the merge deliberately removes that behavior.
Closing; open a new issue if what is left still matters to you.