Repository navigation
Keep the timeline in place when a mobile header drawer closes - #6257
Merged
ymichael merged 1 commit intoOct 25, 2026
Merged
Conversation
The compact header's tap-to-scroll-to-top handler received clicks from portaled overlays rendered by header content, because React bubbles synthetic events through the component tree. Tapping the thread actions drawer's backdrop therefore scrolled the timeline to the top. Ignore clicks whose target is outside the header's DOM. Co-Authored-By: Claude Opus 5.5 <[email protected]>
ymichael
deleted the
bb/fix-timeline-scroll-on-drawer-close-thr_ch5sb54cg8
branch
October 25, 2026 03:28
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 viewports,
AppPageHeaderscrolls the page to the top when its background is tapped (#4742). The thread actions menu renders its drawer through a portal, but React bubbles synthetic events through the component tree, not the DOM tree. A tap on the drawer's backdrop (or its grab handle) therefore reached the header'sonClick. The target was a plaindiv, so it passed the interactive-element filter, and closing the drawer smooth-scrolled the timeline to the top. #4742 listed this as a deferred follow-up ("Ignore portaled menu-backdrop clicks in the header handler").What changed
apps/app/src/components/layout/AppPageHeader.tsx: the compact tap-to-top handler ignores clicks whose target is outside the header's DOM (!event.currentTarget.contains(event.target)). Taps on the header itself behave as before.apps/app/src/components/layout/AppPageHeader.test.tsx: covers a header tap (scrolls to top) and a click from a portaled child (does not).How you verified
viewport.scrollTo({ top: 0, behavior: "smooth" })from thePAGE_SCROLL_TO_TOP_EVENThandler, called from React's click dispatch.pnpm start:worktreeserver for this branch: the backdrop keeps the position, and the header "Scroll to top" button still scrolls.pnpm exec turbo run typecheck --filter=@bb/appandpnpm exec turbo run lint --filter=@bb/apppass.🤖 Generated with Claude Code