Repository navigation
Description
Summary
The Ladle story sidebar/Thread list/Action alignment does not render on main. The thread-list plugin crashes with useBbContext() needs the test slot environment, so no thread rows show. The check script apps/app/.ladle/tests/sidebar-actions.mjs needs this story, so it cannot run. Four other stories have the same cause, and two of them also crash.
Versions and environment
- bb from source at
main02239e9. - Arch Linux (CachyOS), Node v26.13.1, pnpm 9.15.0.
- Chromium (
/usr/bin/chromium) throughplaywright-core1.58.2.
Steps to reproduce
pnpm installpnpm exec turbo run @bb/templates#generate:templates @bb/plugin-build#generate build:types --filter=@bb/templates --filter=@bb/plugin-build --filter=@get-bb/plugin-sdkcd apps/app && npx ladle serve --port 61287- Open
http://127.0.0.1:61287/?story=sidebar--thread-list--action-alignment&mode=preview. - Run
apps/app/.ladle/tests/sidebar-actions.mjswith abrowser.getPage("main")that returns that page (dev-browser, or a small Playwright harness).
Expected vs actual
Expected: the story shows six thread rows, and the script prints PASS: parent and leaf actions align at 220, 288 and 360px; disclosure precedes quick actions and overflow.
Actual: the page shows Thread list stopped working. Reload. The browser console shows:
Error: useBbContext() needs the test slot environment — mount the component via renderSlot(...) from @get-bb/plugin-sdk/testing/app
at useSlotEnv (packages/plugin-sdk/src/testing/app.tsx)
at useBbContext (packages/plugin-sdk/src/testing/app.tsx)
at forward (packages/plugin-sdk/src/app.ts)
at useSidebarThreadReveal (plugins/thread-list/app/list/useSidebarThreadReveal.ts)
at ThreadList (plugins/thread-list/app.tsx)
The script stops with:
page.waitForSelector: Timeout 30000ms exceeded.
- waiting for locator('[data-sidebar-thread-id="thr_actions_leaf_short"]') to be visible
Other stories with the same cause, on the same server:
| Story | Result on main |
|---|---|
sidebar--thread-list--inbox-read-status |
Same useBbContext() crash |
plugins--codex-mcp-elicitation--computer-use |
useBbNavigate() needs the test slot environment, "The plugin form crashed" |
plugins--workflows--workflow-panel--panel-states |
useBbNavigate() needs the test slot environment in the Loaded panel |
plugins--codex-mcp-elicitation--form, thread--pending-interaction--additional-states--overview, --plugin-form-settled |
Blank page after 4 s, no error |
Evidence
Observed cause:
- The story calls
installTestPluginRuntime()at module load: PluginThreadList.stories.tsx#L31. - That function replaces
globalThis.__bbPluginRuntime.pluginSdkAppwith the fake test SDK: testing/app.tsx#L2209-L2216. The fakeuseBbContext()throws unlessrenderSlot(...)mounts the component: testing/app.tsx#L874-L882. - The story mounts the plugin through the real core host (
SidebarThreadListContent), not throughrenderSlot. The plugin callsuseBbContext()in useSidebarThreadReveal.ts#L74. - Ladle's global provider already installs core's real runtime through
apps/app/.ladle/plugin-runtime.ts.installPluginRuntime()uses??=(plugin-frontend.ts#L235), so the fake SDK stays in place whichever module loads first.
Change that exposed it: before #6942 (e005c1a), Ladle aliased @get-bb/plugin-sdk/app to a static shim, .ladle/plugin-sdk-app.ts. Thus the global runtime had no effect on plugins, and installTestPluginRuntime() in a story did nothing. #6942 removed the alias. Since then, plugins read the global runtime through the SDK forwarders, and the call in the story gives them the fake SDK. The same call is in AskUserQuestionPlugin.stories.tsx, CodexMcpElicitation.stories.tsx, InteractionStates.stories.tsx and .ladle/workflows.stories.tsx (through loadPluginApp, which calls installTestPluginRuntime()).
Because Ladle changes stories without a page reload, one of these stories also gives the fake SDK to every story that opens after it in the same tab.
CI: no workflow in .github/workflows/ runs ladle serve, ladle build or the scripts in apps/app/.ladle/tests/. turbo.json has a storybook task, but no CI job calls it. CI does not catch this.
Related, separate cause: npx ladle build in apps/app also fails on main with Rollup failed to resolve import "virtual:bb-plugin-zod" from "apps/app/src/lib/plugin-zod-runtime.ts". .ladle/vite.config.ts does not include pluginZodRuntime(), which #6959 added to the app and Vitest configs.
Found while testing #8053, bb thread thr_kpwmyxvrr7. Investigation thread: thr_76u78zfygh.
What you ruled out
- Not a duplicate: a search for "needs the test slot environment", "Action alignment", "installTestPluginRuntime ladle" and "sidebar-actions.mjs" finds no issue. Sidebar: parent thread rows permanently reserve hidden quick-action space and truncate titles much earlier than leaf rows #8053 and PR Reserve quick-action space only on collapsed parent rows #8056 are about row layout and do not mention the crash.
- Not a
ThreadRowchange: the plugin rootThreadListcrashes before any row renders.useSidebarThreadRevealhas calleduseBbContext()since Assemble the thread list inside the plugin and bring it to benchmark parity #4039, and the fakeuseBbContext()has thrown outsiderenderSlotsince Add @bb/plugin-sdk/testing #517. - Not the 500 response from
/api/v1/system/providers/catalog: that is Ladle's/apiproxy with no dev server, and the stories render with it once the fake runtime is gone.
Suggested priority and effort
Low priority, small effort. The defect stops Ladle stories and the layout check scripts. The app works. The workaround is to render rows in a unit test, as described in the #8053 notes.
AGENT GENERATED
Activity
bb-slop-cop commentedon Nov 23, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilotui,plugins.confirmed-repro.Keep Ladle plugin stories on the runtime Ladle installs (get-bb#8061)