Repository navigation
Keep sidebar and right panel swipes tracking when the touched node remounts - #7600
Merged
Merged
Conversation
…mounts Touch events keep targeting the node where the touch started. When the timeline re-renders and replaces that node mid-swipe, the remaining touchmove/touchend events go to a detached node and never bubble to window, where the sidebar swipe and useHorizontalDismissDrag listened. The page stayed partly translated until the next touch recovered it. Listen on both window and the gesture's origin node through a shared listenToGesture helper, deduplicating events that reach both. This covers the sidebar open swipe, the drawer close drag, and both right panel shelf drags. #6469 fixed the same class for sidebar row drags. Co-Authored-By: Claude Opus 5.5 <[email protected]>
ymichael
deleted the
bb/fix-sidebar-swipe-rendering-bug-thr_caecq3dfi8
branch
November 16, 2026 18:48
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Human comments
What was wrong
On compact screens, swiping the sidebar or the right panel sometimes left it stuck partway until the next swipe. This happened when the timeline re-rendered during the swipe. Touch events always go to the element the touch started on, even after it has been removed from the page, and a removed element no longer passes them on to
window. The swipe code listened for the rest of the gesture (touchmove,touchend, and the pointer equivalents) only onwindow. So when a re-render remounted the touched element, the swipe stopped receiving events and never finished.recoverInterruptedMobileSwipereset it on the next touch, which is why another swipe got it unstuck. #6469 fixed the same problem for sidebar row drags.What changed
gesture-dom.ts: a newlistenToGesture(origin, type, listener, options)listens on bothwindowand the element the gesture started on, and calls the listener once even when the same event reaches both.sidebar.tsx: the swipe that opens the sidebar uses it for both touch and pointer input.use-horizontal-dismiss-drag.ts: uses it for both touch and pointer input. This covers dragging the sidebar drawer closed and both right-panel drags (open and close).How you verified
sidebar.test.tsxcovers a touch and a pointer swipe whose touched element remounts mid-drag.CompactSecondaryPanelShelf.test.tsxcovers opening and closing the right panel the same way. All four fail without the source change and pass with it.pnpm exec turbo run test --filter=@bb/app -- src/components/ui src/components/secondary-panel src/components/sidebarpassed: 1379 tests in 125 files.pnpm exec turbo run typecheck lint --filter=@bb/apppassed.pnpm start:worktreebuild, comparing it withmain's app bundle on the same server and data. I used headless Chrome as a touch phone and sent real touches over the Chrome DevTools Protocol. Partway through each swipe I swapped the touched element for a copy, which is what a remount does. Results after lifting the finger:main🤖 Generated with Claude Code