Repository navigation
Open thread pills and route links in a split on Cmd/Ctrl-click - #5117
Merged
Merged
Conversation
RouteAnchor treated modified clicks as browser-default, so Cmd-clicking a thread pill opened a browser tab (or, in Desktop, navigated the current pane) instead of opening the thread beside the current one. Cmd/Ctrl-click now goes through the same openInSplit path the sidebar and the plugin link delegate already use; Shift, Alt, and non-primary clicks still fall through to the browser. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Personal-project threads route as /threads/:threadId, but paneContentForPathname only recognized /projects/:projectId/threads/:threadId. Cmd/Ctrl-clicking a link to a personal thread therefore found no pane content, skipped preventDefault, and the browser opened a new tab. Map the projectless route to thread pane content under the personal project, matching what paneContentRoute produces for it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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
Cmd/Ctrl-clicking a thread pill in the timeline opened a new browser tab (or, in Desktop, navigated the current pane) instead of opening the thread in a split. Pills render through
RouteAnchor, whose click handler treated every modified click as browser-default and never calledpreventDefault(). The Cmd-click-to-split logic existed only inuseRouteAnchorDelegate, which is mounted only around plugin slots. A second gap surfaced during manual QA: personal-project threads route as/threads/:threadId, butpaneContentForPathnameonly recognized/projects/:projectId/threads/:threadId, so even a split-aware click on a personal-thread link found no pane content and fell through to a new tab.What changed
apps/app/src/components/ui/app-route-anchor.tsx:RouteAnchornow routes primary-button Cmd/Ctrl clicks throughnavigation.openInSplit(the same path the sidebar rows and the plugin link delegate use), preventing default only when a split was opened. Shift, Alt, non-primary clicks, and explicittargets still go to the browser. On compact viewportsopenPaneContentInSplitalready falls back to plain navigation.apps/app/src/views/thread-detail/splitThreadNavigation.ts:paneContentForPathnamemaps/threads/:threadIdto thread pane content underPERSONAL_PROJECT_ID, matching whatpaneContentRouteproduces for personal threads.This applies to every
RouteAnchor: in-app markdown links, timeline title links,PluginUrlLink, andExperimentalFileLinknow also open in a split on Cmd/Ctrl-click instead of a new browser tab.How you verified
app-route-anchor.test.tsx: Cmd- and Ctrl-click on a project thread link and Cmd-click on a personal thread link open a split without navigating the current pane; Shift-click is left to the browser. The modifier tests fail on the oldRouteAnchor, and the personal-thread case fails without thesplitThreadNavigationchange.pnpm exec turbo run typecheck lint --filter=@bb/app(0 errors) andturbo run test --filter=@bb/appoversrc/components/ui,src/views/thread-detail,src/components/thread/timeline,src/components/plugin: all pass.pnpm start:worktreewith a seeded thread whose user message and assistant markdown contain thread pills; Cmd-clicking a pill in headless Chrome kept the hub thread on the left and opened the target in a split on the right.🤖 Generated with Claude Code