Skip to content

Open thread pills and route links in a split on Cmd/Ctrl-click - #5117

Merged
ymichael merged 2 commits into
mainfrom
bb/thread-pill-click-issue-thr_uqxh3ehrqx
Oct 7, 2026
Merged

ymichael merged 2 commits into
mainfrom
bb/thread-pill-click-issue-thr_uqxh3ehrqx

Conversation

@ymichael

@ymichael ymichael commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

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 called preventDefault(). The Cmd-click-to-split logic existed only in useRouteAnchorDelegate, which is mounted only around plugin slots. A second gap surfaced during manual QA: personal-project threads route as /threads/:threadId, but paneContentForPathname only 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: RouteAnchor now routes primary-button Cmd/Ctrl clicks through navigation.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 explicit targets still go to the browser. On compact viewports openPaneContentInSplit already falls back to plain navigation.
  • apps/app/src/views/thread-detail/splitThreadNavigation.ts: paneContentForPathname maps /threads/:threadId to thread pane content under PERSONAL_PROJECT_ID, matching what paneContentRoute produces for personal threads.

This applies to every RouteAnchor: in-app markdown links, timeline title links, PluginUrlLink, and ExperimentalFileLink now also open in a split on Cmd/Ctrl-click instead of a new browser tab.

How you verified

  • New tests in 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 old RouteAnchor, and the personal-thread case fails without the splitThreadNavigation change.
  • pnpm exec turbo run typecheck lint --filter=@bb/app (0 errors) and turbo run test --filter=@bb/app over src/components/ui, src/views/thread-detail, src/components/thread/timeline, src/components/plugin: all pass.
  • Manual: pnpm start:worktree with 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.

AGENT GENERATED

🤖 Generated with Claude Code

qa and others added 2 commits October 7, 2026 11:50
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]>
@ymichael
ymichael merged commit a3e7798 into main Oct 7, 2026
28 checks passed
@ymichael
ymichael deleted the bb/thread-pill-click-issue-thr_uqxh3ehrqx branch October 7, 2026 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant