Repository navigation
Conversation
Move bb's thread actions into apps/app/src/core-contributions/thread-actions.ts, where bb/core-contribution-imports allows only what a plugin gets, with no suppressions. Copy link builds its URL with navigate.experimental_threadHref, toasts go through sonner, and failed requests through the new experimental_showErrorToast, which is core's showMutationErrorToast. The compact-viewport read stays on the public use-compact-viewport registry hook. Inside the app bundle sonner is the raw package, while plugins get bb's toaster through the runtime shim. bb:core-plugin-sdk-app now resolves sonner for core-contribution source (not tests or stories) to that same shimmed toast, which plugin-frontend now shares. Co-Authored-By: Claude Opus 5.5 <[email protected]>
plugin-sonner.ts statically imported sonner to build the plugin toast, and core's thread actions load at boot, so sonner landed in the boot payload and failed the bundle budget. createPluginToast now reaches sonner only through the toaster it attaches when it mounts: raw and custom toasts run through withSonnerToast's attached toast, and getHistory/getToasts read it through readSonnerToasts, returning nothing before the toaster mounts. plugin-sonner.ts exports only that toast. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
ymichael
force-pushed
the
bb/move-core-thread-actions-behind-the-core-contrib-thr_ka3ws6qnhx
branch
from
November 23, 2026 21:20
ad530e4 to
ea41392
Compare
ymichael
deleted the
bb/move-core-thread-actions-behind-the-core-contrib-thr_ka3ws6qnhx
branch
November 23, 2026 21:58
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
bb's own thread actions (Open in split, Copy link, Pin, Mark read, Notify parent, Rename, Regenerate title, Archive, Delete, New thread in environment) were registered through
experimental_threadAction, but fromapps/app/src/lib/thread-actions/core-thread-actions.ts, outside theapps/app/src/core-contributions/boundary. They imported private app modules:getThreadLocationPathfor Copy link,appToastfor toasts, andshowMutationErrorToastfor failed requests. So nothing showed that a plugin could build them, and the slot docs' "core uses this too" was only partly true. Two of those reads had no public path at all. Plugins had no way to show bb's failed-request toast. And a plugin'simport { toast } from "sonner"reaches bb's toaster only through the runtime shim, which core code bundled into the app never passes through.What changed
apps/app/src/core-contributions/thread-actions.tsas a default-exporteddefinePluginApp.bb/core-contribution-importspasses with no suppressions.lib/thread-actions/core-thread-actions.tsonly collects them intoCORE_THREAD_ACTIONS, the same wayplugin-slots.tscollects message time.getThreadLocationPath→navigate.experimental_threadHref(thread.id), made absolute withnew URL(href, location.origin), as that method's JSDoc already describes. One known difference:experimental_threadHreftakes only the thread id and reads the project from bb's cache. For a thread bb has not loaded, Copy link now copies/threads/<id>, which redirects to the project route. Main copied the project URL. Every surface checked live had the thread loaded and copied the same URL as main.appToast→toastfromsonner, the path the Guide documents for plugins.showMutationErrorToast→ newexperimental_showErrorToast(below).collectCoreContributionSlots→ moved out of the file. The contribution only default-exports its definition.context.threadRequests.requestArchive/requestDelete(Give plugins bb's Archive and Delete flows, and route core's through them #7961), so they are unchanged.experimental_showErrorToast({ error, fallbackMessage }): voidin@get-bb/plugin-sdk/app. It is core'sshowMutationErrorToast, with the same parameter names.AbortError.fallbackMessageand the description is the server's message for an SDK error. Without a body message, the description is the error's message without theHTTP <status>:prefix.docs/api_to_audit.mdentry spell this out, including the trailing-period and "Request failed" cases.app/ui/mutation-errors.ts;error.message, i.e.HTTP 4xx: ....inspection.experimental_errorToasts. GuideapiSymbols(host-components card), the bb-plugin-authoring reference (still 500 lines) and the SDK version (0.6.187) are updated.sonnerfor core contributions.vite-core-plugin-sdk-app.ts(Vite, Vitest and Ladle) now also resolvessonnerimported fromapps/app/src/core-contributions/(not tests or stories) tolib/plugin-sonner.ts. That module exports the samecreatePluginToastinstanceplugin-frontend.tshands to plugins, andplugin-frontend.tsnow imports it from there, so there is one toast object. The shim callsappToastwith no plugin attribution, so core's toasts and notification-center entries are unchanged.createPluginToastno longer captures sonner'stoastat module load. It reaches sonner only through the toasterAppToasterViewattaches (withSonnerToast, plusreadSonnerToastsforgetHistory/getToasts, which return nothing before the toaster mounts). That keeps sonner off the boot path even though core's thread actions load at boot.useIsCompactViewportfrom@bb/shared-ui/hooks/use-compact-viewport. That is already public as the registry itemuse-compact-viewport, which the bundled thread-list plugin vendors, and the boundary lint accepts it. Its value is the slots'isCompactViewportprop. A second SDK hook would have been a parallel public path, so there is none.How you verified
pnpm exec turbo run typecheck lint test --filter=@bb/app --filter=@get-bb/plugin-sdk --filter=@bb/domain --filter=bb-plugin-plugin-api-docs --filter=bb-plugin-bb-guide: green.pnpm exec oxlint -c .oxlintrc.json apps/app/src/core-contributions: 0 findings, no disable comments.ThreadActionsMenu.test.tsxspies onappToast.successwhile Copy link runs from the core contribution. It only passes if the contribution'ssonnerimport resolves to bb's toaster.sonner→lib/plugin-sonner.tsonly for non-test files undersrc/core-contributions/. It stays raw for*.test.ts,*.stories.tsx,lib/plugin-sonner.tsitself, otherlib/files and look-alike folders.@get-bb/plugin-sdk/appresolution is unchanged.pnpm start:worktreewith headless Chrome. The same scripts ran against this branch and against main's build on the same data dir:🤖 Generated with Claude Code