Repository navigation
Give plugins and core one way to open, link and reveal threads, messages and settings - #7954
Merged
ymichael merged 10 commits intoNov 23, 2026
Merged
Conversation
ymichael
force-pushed
the
bb/implement-plugin-navigation-api-gaps-thr_7vtctebgv3
branch
from
November 21, 2026 05:02
b251b44 to
0c4dbde
Compare
…ugh bb's own navigation BbNavigate gains toThread's experimental_messageSeq, experimental_toSettings, experimental_threadHref and experimental_settingsHref, on useBbNavigate() and every callback's context.navigate. Core's Copy link, Copy message link, mention links, search palette, targeted settings entry points and the sidebar footer's openSettings now build and open these locations through the same functions (getThreadLocationPath, openThread, getSettingsTargetPath). Message metadata components receive experimental_messageSeq. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… its own skill reference Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ss reject what bb rejects toThread, experimental_threadHref and message metadata now share one name, messageSeq. toThread's option ships stable so it matches the href option; members under an experimental_ method or an Experimental* type do not repeat the prefix. renderSlot's navigate throws the same RangeError as bb for a seq that is not a non-negative integer or an unknown settings section, so plugin tests catch input bb would refuse. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nction each getThreadLocationPath is now the only thread path builder: getThreadRoutePath is folded into it, and every app and mobile caller, including notification and thread-open targets, uses it. openThread is now the only way to open a thread for the user. It absorbs openThreadInSplit and the CLI's own layout code, so toThread, the sidebar thread actions' open, the search palette, sidebar Open in split and keyboard navigation, bb thread open, mention links, the archived-thread toast and new threads after creation all share one placement path. Pane bookkeeping keeps using only the path builder. getSettingsTargetPath is now the only settings path builder, covering sections and plugin, machine and project pages; the separate builders in client-core and settings-sections are gone. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The thread outline had its own reveal: it looked rows up by id, looped up to 1,000 older-page loads waiting six frames each, scrolled once without waiting for layout to settle, and did nothing when the message was missing. Outline items now carry the message's seq (the server's outline projection adds messageSeq; its cache version is bumped so stored outlines rebuild), and a click sends an in-place reveal request to the provider that already handles message links and palette results. That one path loads older pages, keeps the target rendered, waits for it to settle, highlights it, and toasts when it is missing; whichever target arrived last wins. The outline still adds no history entry. Its paging loop, pending pulse and the separate navigation-target plumbing are gone. Co-Authored-By: Claude Opus 5.5 <[email protected]>
React Router's navigate returns a promise; callers passed it straight to openThread, which type-aware lint rejects as a promise where void was expected. openThread now accepts either return and discards the promise itself, so callers pass navigate unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
experimental_makeActionContext's navigate proxy returned false for every method, so experimental_threadHref and experimental_settingsHref broke their string contract. They now share the test harness's href builders. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…reveals to their thread openThread on a compact viewport pushed a new history entry even when the thread was already open, so Back stayed on the same thread; it now replaces the entry as it did before. Outline reveal requests carry the thread id so a pane that switches threads does not reveal the old request's seq. Drops the empty route-paths imports left by the settings path consolidation. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
ymichael
force-pushed
the
bb/implement-plugin-navigation-api-gaps-thr_7vtctebgv3
branch
from
November 23, 2026 17:55
ed3bc3b to
ebe72aa
Compare
ymichael
deleted the
bb/implement-plugin-navigation-api-gaps-thr_7vtctebgv3
branch
November 23, 2026 18:10
ymichael
added a commit
that referenced
this pull request
Nov 23, 2026
## Human comments
## What was wrong
Core opened the New thread screen in about a dozen places, each building
`navigate("/", { state })` by hand. None of them could place the screen
in a split. `SplitThreadArea` then reconciled the layout so the composer
replaced whatever pane was focused. Plugins had the same limitation:
`toCompose` had no `split` (#8011). The thread-list plugin's project,
section and Threads `+` buttons go through `toCompose`, so they also
replaced the pane the user was reading (#2795).
## What changed
**One opener.** `openNewThread`
(`apps/app/src/lib/split-layout/openNewThread.ts`, with
`useOpenNewThread` for components) is now the only way core opens the
New thread screen, as `openThread` is for threads since #7954. It takes
the compose options (`projectId`,
`initialPrompt`/`replaceInitialPrompt`, `focusPrompt`, `placement`,
`environmentId`, `hostId`), plus `split` and `replace`. It selects the
project, builds the route state once, and with `split` places the pane
by the same rules as `openPaneContentInSplit`:
- a right split by default
- focus (and replace history) when a composer pane is already open, then
apply the options there
- replace the focused pane at the pane cap
- plain navigation on compact viewports or when there is no layout
The placement logic is extracted as `placePaneContentInSplit`, so both
callers share it.
**Callers moved onto it:**
- `toCompose`
- the superseded sidebar `openNewThread`, which takes no `split`
- the sidebar New thread button and its Open in split
- the `thread.new` command
- New thread in environment
- Create plugin, Create skill and Fork skill
- Edit skill/plugin via chat
- Create custom palette
- the screen after quick-creating a project
Redirects after deletion, route repair and
`LegacyProjectComposeRedirect` still only build the path. Every caller
keeps its current behavior; the thread-list `+` buttons gain
Cmd/Ctrl-click.
**SDK.** `BbNavigate.toCompose` gains `split?: boolean`. It is stable
and unprefixed, like `toThread`'s `split`. Plugin SDK is bumped to
0.6.187, and thread-list now requires `>=0.6.187`.
**#2795.** The thread-list plugin's `+` buttons (project, section,
machine, Pinned, Threads, and environment groups) now behave like the
sidebar New thread button. A plain click still replaces the focused
pane, and Cmd/Ctrl-click opens the New thread screen beside it. The
issue left this choice open; the modifier keeps all the New thread
buttons consistent. The click's modifier reaches `toCompose`'s `split`
through each handler. The issue's second point, raising `MAX_PANES`, is
not part of this PR.
**Small cleanups:**
- Dropped the never-read `createDraftKind` state from the skill entry
points.
- Dropped the sidebar `openNewThread`'s `sectionId` state key, which
`placement` (always sent alongside it) already overrides.
- `buildCreateThreadInEnvironmentState` and its test are replaced by the
`openNewThread` state test.
**Docs:**
- `docs/api_to_audit.md`: a new paragraph under Thread creation
placement lists the core callers.
- bb-plugin-authoring: `frontend-navigation.md` gets a New thread screen
section; `frontend-hooks-and-ui.md`, `frontend-thread-list.md` and the
SKILL.md routing line are updated.
No host daemon wire change.
## How you verified
- New tests:
- `openNewThread.test.ts`: focuses and replaces history for an existing
composer pane, replaces at the pane cap, does not touch panes on compact
or without split, and hands RootComposeView the environment, placement
and focus state.
- `plugin-navigation-hooks.test.tsx`: `toCompose({ split: true, ... })`
from a plugin panel adds a new-thread pane to the right with the state
and project selected; without split the layout is untouched. On main the
split case fails because `split` is ignored.
- Updated tests:
- `plugin-sidebar-hooks.test.tsx` now runs against the real project
selection.
- The thread-list tests expect `split: true`.
- `pnpm exec turbo run typecheck lint --filter=@bb/app
--filter=bb-plugin-thread-list --filter=@get-bb/plugin-sdk`
- Targeted app tests: split-layout, plugin navigation and sidebar hooks,
sidebar, AppLayoutSidebar, RootComposeView, ThreadMetadataContent,
ThreadActionsMenu, app-route-history, PluginAppOverlays.
- `turbo run test` for `bb-plugin-thread-list` (458),
`bb-plugin-bb-guide`, `bb-plugin-plugin-api-docs`.
- Live on `pnpm start:worktree` in headless Chrome (1440×900), with a
thread open in a single pane:
- A plain click on the QAVault project `+` replaces the pane with the
composer, as before.
- Cmd-click on the same button keeps the thread in pane-1 and opens the
composer in pane-2.
- An earlier build that always split confirmed that an already-open
composer pane is focused and switched to the clicked project, with no
third pane.
- The global New thread button still replaces the focused pane.
- `ProjectList.sectionCreate.test.tsx` covers a plain click, Cmd-click
and Ctrl-click on a section `+`.
Fixes #8011
Fixes #2795
> AGENT GENERATED
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 5.5 <[email protected]>
This was referenced Nov 27, 2026
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
Plugins could not reach three places core reaches every day, and core itself reached each of them through several separate implementations:
useBbNavigate().toThreadcould not carry a message, so community plugins rebuilt the reveal from the DOM (paging, estimating offsets, fake wheel events) or forgedhistory.pushState({ usr: { searchMessageSeq } })pluspopstate. Core had two reveal engines: message links and palette results went throughuseScrollToSearchedMessage, while the thread outline had its own loop (look up by row id, up to 1,000 older-page loads, one scroll with no settle, silent when the message was missing).openSettings(); thirteen plugins forged history state to open a settings page. Core built settings paths with five different builders./threads/<id>,#msg=and/settings/...paths. Core built thread paths with two builders plus hand-written strings in mobile, and opened threads throughopenThreadInSplit, a separate layout path forbb thread open, a plugin-only copy in the sidebar thread actions, and plainnavigatecalls.What changed
Plugin API (on
BbNavigate, souseBbNavigate()and every callback'scontext.navigateshare it):toThread'smessageSeqis stable and unprefixed so it matches the href option; it opens…/threads/<id>#msg=<seq>through the same placement assplit, and a repeated call reveals again.experimental_toSettings()opens the calling plugin's settings page; with a section it opens that bb section. Settings is whole-window; Back restores the panes.RangeError. The SDK test harness (renderSlot) rejects the same input.message.messageSeq. Message actions keep the already-shippedThreadChatMessageReference.experimental_messageSeq.ExperimentalSettingsSectionmust equal the app's settings section ids; a type test fails if they drift.One implementation per concept in core:
getThreadLocationPath(@bb/client-core) is the only builder.getThreadRoutePathis folded into it, and every web and mobile caller uses it, including notification andbb thread opentargets in the mobile app.openThread(split-layout/openThread.ts) is the only way to open a thread for the user, with or without a split. It replacesopenThreadInSplitand the CLI's own layout code. Callers:toThread,experimental_useSidebarThreadActions().open, the search palette, sidebar Open in split and keyboard navigation,bb thread open, mention links, the archived-thread toast, and newly created threads. Pane bookkeeping (closing, replacing or reconciling panes) only builds paths.getSettingsTargetPathis the only builder, covering sections and plugin, machine and project pages.getSettingsRoutePath,getPluginConfigurationRoutePath,getSettingsMachineRoutePath,getSettingsProjectRoutePathandgetSettingsSectionRoutePathare gone. The sidebar footer'sopenSettings/openPluginDetailscallnavigate.experimental_toSettings().useScrollToSearchedMessageis the only reveal. Its provider now accepts in-place reveal requests besides URL and palette targets; the most recent wins. It loads older pages, keeps the target rendered, waits for layout to settle, highlights, and toasts when the message is missing. The thread outline sends an in-place request with the message's seq, so it still adds no history entry. Its paging loop, pending pulse and the separatetimelineNavigationTargetRowIdplumbing are gone.Server/client contract:
ThreadConversationOutlineItemgainsmessageSeq.CONVERSATION_OUTLINE_PROJECTION_VERSIONis bumped to 3 so stored outlines rebuild. No host daemon wire change.Not changed: the generic Settings button, nav rail button and "Open settings" command reopen the last settings page visited (a stored location, not a target). The "Open server settings" command still navigates to
/settings/servers, which the web app does not have; that predates this PR.Docs:
docs/api_to_audit.mdentry, Plugin Guide symbols (Message actions, Thread list, Custom settings section cards), bb-plugin-authoring (references/frontend-navigation.md, routed from SKILL.md), SDK testing harness members, SDK 0.6.179.Community callers that can migrate (not edited): nfour minimap/pinned-turns/lexicon/chat-dock, frankieshakes threadline, yusuf8834 chat-search, ahkohd sticky-prompt, mturilin quick-reply, rebryk bookmarks, brsbl timeline-comments; gpambrozio herald/model-pricing/dream/learning-exercises/launchd-jobs/firstmate-crew, vburojevic pets, jem-computer live, swairshah handsfree, brzvsk model-visibility, qwent71 waiting-on-you, wy3z cursor-suite, oddship dummie; joozio work-map, koenvg tasks-plus, anirudhranganath thread-tabs, VKirill voice-input, kalindudc session-log, charpeni agent-traces, cristoslc focus-board.
How you verified
Live on
pnpm start:worktreewith a local test plugin and a real three-turn thread, in headless Chrome:toThread(id, { messageSeq: 1 })ignored the message (no#msg=, first prompt 2,228px above the viewport) andexperimental_toSettingsdid not exist. On this branch the same call opens#msg=1with the message at the top and highlighted; a repeated call after scrolling away reveals it again; a seq that is not a message toasts "Message not found".toThread(id, { split: true, messageSeq: 1 })opens or focuses the pane at the message without a new history entry when the thread is already open.bb thread open <id> --split rightadds a pane; opening an already-open thread focuses it without a new history entry.experimental_toSettings()→/settings/plugins/navtest;{ section: "appearance" }→/settings/appearance;"billing"and-1throwRangeError. Settings → Machines → machine page, Projects → project page, General →/settingsall route through the new builder.<a href={experimental_threadHref(...)}>routes in place without a reload.Tests:
plugin-navigation-hooks.test.tsx(6 of 7 fail on main),openThread.test.ts, the outline click test, a timeline test that an in-place reveal request after an older URL target keeps the message realized and reveals it, the SDK harness validation test, andMessageMetadata.test.tsx.pnpm exec turbo run typecheck lint testfor@bb/app(7342, after rebasing onto main),@bb/server(4423),@bb/server-contract(89),@get-bb/plugin-sdk(447),@bb/mobile(356),@bb/client-core(243),bb-plugin-plugin-api-docs(76),bb-plugin-bb-guide(8); typecheck for every@bb/client-coredependent.🤖 Generated with Claude Code