Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): trackpad swipe no longer switches threads after scrolling a code pane #39100

ClosedErnest0-Production(GitHub profile, opens in a new tab)wants to merge 3 commits intomain fromrefs/pull/39100/headopened View on GitHub

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

    1. Pushede7187c8

    2. Hi @juliusmarminge ! Could you please double-check since the CI runners have already been restored?

    3. Closing. #39099 is closed: #41264 is on main and covers the reverse-swipe case. Julius deliberately dropped the leftover “edge swipe that never scrolls still goes Back/Forward” behavior; a new issue is the path if that still matters.

Sign in to join this conversation.