Repository navigation
Make plugin surfaces prove they use core's path and delete plugin-only switches - #7731
Merged
ymichael merged 11 commits intoNov 18, 2026
Conversation
ymichael
force-pushed
the
bb/class-fix-view-level-plugin-surface-contract-tab-thr_j3gude4cva
branch
from
November 17, 2026 20:36
49d56bc to
09633eb
Compare
ymichael
force-pushed
the
bb/class-fix-view-level-plugin-surface-contract-tab-thr_j3gude4cva
branch
from
November 18, 2026 00:12
d90c7e9 to
ae6db4b
Compare
ymichael
force-pushed
the
bb/class-fix-view-level-plugin-surface-contract-tab-thr_j3gude4cva
branch
2 times, most recently
from
November 18, 2026 19:47
47d4561 to
32087d3
Compare
…n-only switches Extend the view-level panel contract table to openTerminal, openFilePreview and openUrl on every surface, including a header thread action. Add surface tables for ThreadScreen consumers, Markdown, compact composer actions and single-pane breakpoint crossings. Fix what they caught: - Thread actions now route navigate.open* to the focused surface through one focused-surface registry, which also replaces the panel-only registry (#7065). - Embedded ThreadChat shows slot-registered message actions (#2967). - A single plugin pane stays mounted across the compact breakpoint (#7277). - Compact composers render plugin composer actions (#3358). - An unseeded plugin NewThreadComposer starts on the remembered New thread project (#5340). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…panel contexts ThreadScreen's timeline and composer host fields are now required, so a surface must state each handler or a deliberate null. Plugin ThreadChat gets the thread page's title actions, context environment, new-thread-in- environment action and unread divider through shared code. The ThreadScreen table drives its page row through the real ThreadDetailView. The panel table gains rows for message actions, palette commands and new-tab plugin actions, and the Plugins view gets a panel test. Terminal tabs must state their link and add-to-chat handlers, which routes plugin page terminal links through the in-app browser. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…host it On a plugin page, the embedded ThreadChat's panel has no thread side-chat tab, so clicking a "Message from side chat" title did nothing. The shared title-action resolver now opens the side chat thread itself when the panel declines the tab; the thread page still opens it in its panel. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…orts Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Embedded ThreadChat now shows slot-registered message actions, so Side
chat's own "Reply in side chat" appeared inside a side chat and in other
plugins' embedded chats, where its side chat tab cannot open. A message
action can now name the timelines it shows in with
experimental_surfaces ("thread" for bb's thread view, "thread-chat" for
an embedded ThreadChat); omitted, it shows on both. Each ThreadScreen
host states its surface, and the timeline filters slots through one hook.
Side chat declares ["thread"].
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
"thread" already means any thread composer in the composer host's surface, embedded ThreadChat included, and "thread-chat" did not say what set it apart from bb's thread view. The values now match the SDK docs' "thread view" and "embedded ThreadChat". Also fixes the two CI failures from the surfaces commit: the collected registration test now expects the filled default, and the bb-plugin-authoring skill documents experimental_surfaces and no longer says embedded ThreadChat hides slot message actions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… plugin opts in ThreadChat now passes the thread's environment to the context row above its composer only with experimental_environmentContext, so side chats no longer repeat the changed-files row their parent thread already shows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The collapsed composer leaves out bb's own + menu and model picker, so plugin actions stay out of it too and show once the composer expands, as on main. This restores the composer files and their test to main's and documents where actions render. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No plugin passes it: Side chat leaves it off and no other first-party plugin embeds ThreadChat away from its thread. Embedded ThreadChat keeps main's behavior of passing no environment to the composer's context row, and the ThreadScreen contract table now states that per surface. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ymichael
force-pushed
the
bb/class-fix-view-level-plugin-surface-contract-tab-thr_j3gude4cva
branch
from
November 18, 2026 22:46
9fd57b9 to
0a0217d
Compare
ymichael
deleted the
bb/class-fix-view-level-plugin-surface-contract-tab-thr_j3gude4cva
branch
November 18, 2026 22:57
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
AGENTS.md says a plugin API that performs a core action must be the path core uses, proven by one contract test table run against every surface. Only part of that was enforced. The view-level panel table (
test/panel-controller-contract.tsx) covered panel tabs, notopenTerminal,openFilePrevieworopenUrl. The terminal and file tables were hook-level and mockedreveal. There was no table for ThreadScreen consumers, Markdown surfaces or single-pane layout. So per-surface switches that turn a feature off for plugin surfaces kept shipping. Each was a small, reasonable-looking exception that no table asserted against:experimental_panelrouted to the focused surface, but theirnavigatecame from the app-level context inThreadActionsProvider, outside every view's navigation host. From a header thread action,experimental_openTerminal,experimental_openFilePreviewandopenUrlreturnedfalseand did nothing. The issue's suspected cause (reveal: openCompactDrawer) is not it: that is the same function asopenDrawer, and terminal selection already writesisOpen: true. That is also why SlopCop's in-view test did not reproduce it.PluginThreadChatpassedincludePluginMessageActions: false, so slot-registered message actions never showed in an embedded ThreadChat.SplitThreadAreakept a single pane mounted across the compact breakpoint only for thethreadandnew-threadkinds. A plugin page swapped betweenStandalonePaneContentandWorkspacePaneContentand lost its DOM and React state.PluginNewThreadComposerstarted an unseeded composer onnull(the personal project) instead of the remembered New thread project.Earlier issues and fixes from the same root cause
This is the 20th fix in the class. Each earlier one patched a single surface:
hostsources against the primary host, not the thread's machine: 502 on server-only deployments, wrong-machine reads and writes elsewhere #4480, Plugin-embedded ThreadChat's composer summary omits the Project chip the main thread view shows #4501, Plugin commands can't open panels on the New thread screen #4951, ThreadChat (side chat, plugin panels) never shows plugin-rendered interactions such as AskUserQuestion forms #6071, Side chat: the "Replying to" quote shows raw @thread: tokens instead of thread pills #6268, Crossing the compact breakpoint remounts the open thread, dropping composer focus and selection #6289 and Forward the createProject capability through experimental_NewThreadComposer so plugin-hosted new-thread composers can offer the picker's New project entry #7015.The open issues the tables catch today are #7065, #2967, #7277 and #5340. #6311 is covered by the Markdown table, which already passes because #6405 removed the closure chain.
What changed
Guards (written first; each failed on main for the past case named):
test/panel-controller-contract.tsxgains three rows: open a terminal, open a file preview (reusing the tab for the same file), and open a URL in the in-app browser. Each row must select the tab and reveal a closed panel. The table runs on the thread view, thread header row, thread header action (new row), New thread screen and plugin page. On main the header-action row failed all three (experimental_openTerminal doesn't reveal a closed right panel in a thread on desktop #7065).ThreadScreen.surface-contract.test.tsxruns against the thread page and plugin ThreadChat full, compact and timeline. It uses real timeline rows. Every row must show slot-registered message actions, and every composer must receive the thread's context-window usage. On main the three ThreadChat rows failed (Embedded ThreadChat should inherit compatible provider features #2967). Context usage already passed on every row, so that half of Embedded ThreadChat should inherit compatible provider features #2967 was fixed by Use one thread screen for the main view, side chat and plugin ThreadChat #6387.markdown-surface-contract.test.tsxruns against assistant messages, pluginMarkdownand plugin documentMarkdown. It checks thread-token mentions, web-link routing through the surface's navigation host, and<video>identity when the navigation host changes. It passes on main and guards SDK Markdown remounts <video> when a host context changes, so videos restart #6311 and Resolve and open Markdown links in one place #6756.SplitThreadArea.test.tsx. Thread, New thread and plugin page panes must keep their DOM nodes and unsaved state across four breakpoint crossings. On main the plugin page row failed (Plugin navigation panels remount across the compact breakpoint and lose form state #7277).PluginNewThreadComposer.test.tsx. An unseeded composer must start on, and submit, the project the user picked in bb's New thread view. It failed on main.One owner, copies deleted:
lib/app-navigation-host.tsxgainsAppNavigationSurfaceProvider. Each surface now registers its resolved navigation host while it has focus: the thread view, New thread, plugin page and Plugins.getFocusedAppPanelControlleris derived from that registry. The panel-onlyfocusedControllersregistry and theisFocusedargument touseAppPanelControllerare deleted.ThreadActionCollectorswraps collectors inFocusedAppNavigationSurfaceProvider. Thread actions'navigate.open*now reaches the same focused surface as theirexperimental_panel. When no surface has focus, it falls back to the app-level host.includePluginMessageActionsis deleted end to end:ThreadScreenTimelineHost,ThreadTimelineSurface,ThreadTimelineRows,PluginThreadChatandThreadDetailView.keepsSinglePaneis deleted fromSplitThreadArea: any single pane stays inWorkspacePaneContent.PLUGIN_MARKDOWN_THREAD_MENTIONSandASSISTANT_THREAD_MENTIONSconstants are merged into oneAUTHORED_MARKDOWN_THREAD_MENTIONSexported frommarkdown-preview.tsx.Follow-up from the independent review: missing host fields and untested panel contexts.
ThreadScreenTimelineHostandThreadScreenComposerHostfield is now required (ThreadScreen.tsx), so each surface must state each handler or an explicitnull. A host field a surface leaves out now fails typecheck.thread-screen-hosts.tsowns the timeline title-action resolver and the thread environment rules (context environment, reusable environment). ThreadDetailView and plugin ThreadChat both use it.onTitleActionwas missing, so these clicks did nothing.contextEnvironmentId: null), as on main, so a side chat does not repeat its parent thread's changed-files row. An opt-in prop for it was dropped because no plugin used it.useThreadUnreadDividerStateas the page, and read tracking waits for the divider, as on the page.ThreadDetailView, not a hand-builtThreadScreen. Two rows were added: opening a changed file from its timeline title, and the composer receiving the new-thread action and each surface's expected context environment (the thread's on the page, none in embedded chats). On main'sPluginThreadChat, these fail 5 of 11 rows.CommandPalettenow builds plugin commands through onebuildFocusedSurfacePaletteActions, which the table also uses. The table gainsactionTabsandnavigationsupport flags, because those three contexts receive only a panel. The Plugins view gets a test that its panel declines every plugin tab without changing its tabs.ThreadTerminalPanel'sonOpenLinkandonSelectionAddToChatare required, so each of the three panel tab renderers must state them. The plugin page's terminal had noonOpenLink; its links now route through that page's in-app browser, as on the thread and New thread surfaces. I did not merge the three renderers into one. Their file-preview cases depend on different surface scopes, and the shared parts are now enforced by types.SDK (backward compatible):
PluginMessageActionRegistrationandThreadChatMessageActionno longer says embedded ThreadChat hides slot actions.ComposerCustomization.actionsdocuments where actions render: the expanded composer, not the collapsed single-line one.defaultProjectIddocuments the remembered-project default.PluginMessageActionRegistration.experimental_surfaces(typeExperimentalMessageActionSurface):"thread-view"is bb's thread view and"embedded-chat"an embeddedThreadChat, matching the SDK docs' wording ("thread"alone already means any thread composer in the composer host'ssurface). Omitted, an action shows on both. The collector fills that default and rejects an empty or unknown list. It has an entry indocs/api_to_audit.md, on the Plugin Guide's message actions card (whose stale "main timeline only" bullet is replaced) and in the bb-plugin-authoring skill, which no longer says embedded ThreadChat hides slot actions.@get-bb/plugin-sdkis set to 0.6.161, above main's 0.6.160.Message action surfaces (review follow-up):
ThreadScreenhost now statesmessageActionSurface(ThreadDetailView"thread-view",PluginThreadChat"embedded-chat"). The timeline reads slots through one hook,useSurfaceMessageActionSlots(lib/message-action-surface.tsx), so every surface filters the same way. This is a filter the registration owns, not a per-surface switch.experimental_surfaces: ["thread-view"]. Every other message action keeps showing in embedded ThreadChat.Not deleted:
PluginNewThreadComposer'sselectionScope="component-local". That switch decides whether SDK seeds (defaultProviderId,defaultModel,defaultEnvironment, …) beat core's remembered picks. Switching to the"new-thread"scope would override third-party plugins' seeds and write plugin picks into core's New thread preferences, and an existing test pins that separation. This PR fixes only the #5340 project fallback. The seeded-but-unknown project id case resolves to personal exactly as a stale remembered id does in core's New thread view, so it is parity and left unchanged.Decisions for review
experimental_ThreadActionsMenu). It matches howexperimental_panelwas already routed. Run from thread A's menu while thread B has focus:experimental_openTerminalwith A's terminal returnsfalse, because B's panel accepts only B's terminals (acceptsThreadTerminal).experimental_openFilePreviewandopenUrlopen in B's panel. A file preview is addressed by environment and path, not by thread.falsefrom every thread action, the header included. Opening A first and then the tab in A's panel would need a new "open a thread with a panel tab" path (see decision 7).falsewhere the tab does not exist, as Embedded ThreadChat should inherit compatible provider features #2967 asks.+menu and model picker too; all of them show once the composer expands. An earlier version of this PR showed plugin actions in the collapsed composer for Render plugin composer actions in compact layouts #3358, but even with a scrolling strip it crowded the one-line composer on phones, so that change was reverted and Render plugin composer actions in compact layouts #3358 stays open.experimental_surfaces: ["thread-view"]. Embedded ThreadChat cannot open its side chat tab, and a side chat inside a side chat is not wanted. Other plugins' message actions still show in embedded ThreadChat.onOpenThreadInfo: null). Thread info is a fixed tab in the thread page's side panel. From a plugin page, the button would open nothing, so it is left off.commandShortcutsEnabled={false}. ⇧⌘M toggles the focused composer's picker, and every composer, plugin composers included, gets it throughExecutionControls. A form-control picker that also grabbed ⇧⌘M would make the shortcut ambiguous.showFileSearch={false}and a no-oponSelect. A plugin page has no project, environment or thread, so there is nothing to search and no recents to select;onSelectcannot fire.How you verified
Live verification (isolated source dev instance, verify-bb)
These ran on the source dev web app at this branch, before the rebase, with a fresh data directory and the connected local host. A probe plugin registered three header thread actions (open a terminal, a file and a URL), a slot message action, three composer actions, and a page holding ThreadChat full and compact plus an unseeded
experimental_NewThreadComposer. A Claude Code Haiku thread produced the assistant messages. Screenshots and measurements are kept locally.true, the panel opened, and a zsh terminal tab was selected.true, the panel opened, and the README.md preview was selected.trueand openedhttps://example.com/probeexternally. The web client has no in-app browser, so the Electron in-app browser path was not run live; the contract table covers it.[2,6]. The compact page shows the close button.Live verification of the review follow-up (second run, isolated dev instance and desktop app)
The second run used a fresh dev instance from this branch (
ae6db4b0d34plus the side-chat fix below). The URL check also used the source desktop app (Electron) attached to the same instance and driven over CDP. Each check compares plugin ThreadChat on the probe plugin's page with the thread page. The fixtures were Claude Code Haiku threads:README.md) and a file outside the workspace (/tmp/.../outside-note.txt);README.mdopened a README.md preview tab in the thread's panel.outside-note.txtopened a host-file preview in each surface's own panel.thread-screen-hosts.test.tsx.mainand not caused by this PR: both surfaces label the row "Message from Agent", with no link, until the hidden side-chat thread is in the query cache. Sender metadata is read only from cached threads. After a reload with the side chat tab closed, the thread page shows the same unlinked label. Not changed here.lastReadAtadvanced and the divider stayed on screen. Read timing matches.https://example.com/terminal-linkin a panel terminal opened an in-app browser tab ("Example Domain") in the plugin page's panel. On main this link had no handler on the plugin page.Tests and checks
After rebasing onto main (
28cdd915db4) and droppingexperimental_environmentContext:typecheck lintpass for@bb/app,@get-bb/plugin-sdk, side chat and plugin-api-docs; the 15 changed app test files pass (533 tests, 16 skipped); plugin SDK (439), side chat (27) and plugin-api-docs (75) tests pass; the plugin SDK version check passes. A live rerun on the rebased build showed "Probe message action" in both the thread page and embedded ThreadChat, with "Reply in side chat" only on the thread page.Each guard was run against main's version of the changed component and failed as described above. All guards pass with the fix.
A targeted run of the 35 affected test files passed after the review follow-up: 1,112 tests, with 16 skipped.
pnpm exec turbo run typecheck lint --filter=@bb/app: pass. The composer plugin lint shows 4 warnings, all of which were already there.node apps/app/scripts/check-bundle-budget.mjsafter the rebase: the boot payload is 418.6 KB brotli against a 419.1 KB budget.The first CI run's other failures were 15 s timeouts in
@bb/logger(Windows) and@bb/dbresolved-item pruning. This PR touches neither package.Not run on a native iOS or Android device, and not in the Electron in-app browser.
After rebasing on main and adding message action surfaces: the 15 affected app test files pass (651 tests, 16 skipped);
@get-bb/plugin-sdktypecheck, lint and tests pass (39 files); side-chat and plugin-api-docs tests pass;typecheck lintpass for@bb/appand both plugins; the boot bundle budget passes.Fixes #7065
Part of #2967. Gaps 1 and 2 are covered; gap 3, the per-chat identity seam for content scripts, is not in this PR.
Fixes #7277
Part of #5340. The unseeded-project half is fixed; the unknown-seed half is kept as parity, as explained above.
🤖 Generated with Claude Code