Repository navigation
Add the thread list placeholder and a sidebar benchmark - #4035
Merged
Merged
Conversation
SawyerHood
force-pushed
the
thread-list/0-compiled-in-loader
branch
from
September 21, 2026 23:57
d00b3b0 to
9b2b719
Compare
SawyerHood
force-pushed
the
thread-list/0-compiled-in-loader
branch
from
September 22, 2026 00:08
9b2b719 to
9b915eb
Compare
SawyerHood
marked this pull request as ready for review
September 22, 2026 00:15
SawyerHood
force-pushed
the
thread-list/0-compiled-in-loader
branch
4 times, most recently
from
September 22, 2026 01:38
66ff2b1 to
c6fd700
Compare
SawyerHood
force-pushed
the
thread-list/0-compiled-in-loader
branch
from
September 22, 2026 02:06
582e210 to
72385c8
Compare
Plugin frontends load after the plugins inventory request, so a sidebar that is a plugin would paint late on every cold start. Add a compiled-in table to the loader: a listed plugin imports through the app build instead of the server bundle, is seeded before the inventory answers, never reloads on a server hash change, and is skipped on the next boot when the server last reported it disabled. Also a boot-settled signal and the placeholder the thread-list slot will render while loading, missing, or crashed. The table is empty until the thread-list plugin lands. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Mounts the built-in list with 3,000 generated threads under a simulated viewport so windowing engages, then times mount, a status patch, a membership refetch, and a pin. Runs only with BB_SIDEBAR_BENCH=1. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Co-Authored-By: Claude Fable 5.1 <[email protected]>
The zod-resolution suite copies packages/plugin-sdk/bundled-types, which build:types produces, but the test task only waited for build. Whether the directory existed depended on task scheduling. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Each case renders the whole product map twice; it takes under a second locally and nearly ten on a busy CI runner, past the five-second default. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Compiling the thread-list plugin into the app duplicated the frontend loader for one plugin and added a localStorage memo to hide a list-then-blank flash. The placeholder covers the cold start instead: it shows skeleton rows until the plugin bundle mounts, and the boot signal lets it tell "still loading" from "no thread list plugin is enabled" once the first reconcile finishes. Co-Authored-By: Claude Fable 5.1 <[email protected]>
The placeholder needs to know when plugin frontends have settled. The loader module carries the plugin runtime shims (pierre, radix, tiptap through shared-ui), so a static import from the sidebar would pull the on-demand vendors into the boot payload. plugin-frontend-boot-state.ts already exposes usePluginFrontendsSettled without those imports; the custom signal on the loader is gone. Co-Authored-By: Claude Fable 5.1 <[email protected]>
SawyerHood
force-pushed
the
thread-list/0-compiled-in-loader
branch
from
September 22, 2026 02:36
72385c8 to
e5a08fd
Compare
SawyerHood
added a commit
that referenced
this pull request
Sep 22, 2026
## Human comments ## What was wrong The thread-list plugin (#4031) had state but no rendering. The built-in sidebar's row layer reaches into about twenty host modules (`@/components/ui/sidebar`, `ThreadActionsProvider`, `ThreadTitleMentions`, split-layout atoms, react-router, prompt-draft storage, the shortcut context) that a plugin cannot import. ## What changed Everything under `plugins/thread-list/app/`, all importing only `@get-bb/plugin-sdk/app`, `@bb/shared-ui`, `@bb/client-core`, `@bb/core-ui`, `@bb/domain` types, and npm packages (verified by grep for `@/`, `react-router-dom`, `@tanstack/react-query`, `@bb/sdk`): - `model/`: an adapter from `PluginSidebarThread` to the internal `ThreadListEntry` shape, cached per DTO identity, so every `@bb/client-core` builder and comparator runs unchanged; `useSidebarData()` regroups threads by project the way the bootstrap payload does. - `ui/`: ports of the sticky-stack primitives, hover-action classes, drag-click suppression, reorder DnD, action-menu items, the compact long-press menu, the shortcut pill, clipboard with `sonner` toasts, dialog state, the confirm-delete dialog, the empty state, and the environment display helpers. - `rows/`: row classes, item keys, sortable motion, droppable types, row controls, the child chevron, the split mini-map (from `useSidebarSplitLayout()`), inline rename with duck-typed error mapping, the status glyph, the section-move provider, the thread actions menu, and `ThreadRow`. The row's link is a plain anchor on `thread.href` (the host routes it); cmd-click calls `open(id, { split: true })`; drafts, row status, and shortcuts come from the per-row hooks; the title renders `ThreadTitle`; moves and unarchive go through `useSdk()`. - New plugin dependencies: `@dnd-kit/*`, `@radix-ui/react-slot`, `@radix-ui/react-compose-refs`, `@bb/core-ui`, `@bb/domain`. Nothing is wired into a list yet; `app.tsx` still renders `Original`. The next layer assembles sections, projects, and machines. Prerequisite: #4035. ## How you verified 124 plugin tests (112 new): 93 `ThreadRow` cases covering open, split, rename via double-click and menu, every menu item's action or SDK call including move-to-section and pinned-move sequencing, copy link, unarchive pending state, drag-click suppression, chevron toggles, glyph precedence, plugin status, the shortcut pill, and the cross-project glyph; 11 inline-rename cases including error duck-typing; 2 mini-map cases; 6 adapter and grouping cases. `pnpm exec turbo run typecheck test --filter=bb-plugin-thread-list`, `prepare:bundled` builds (1.8 MB dev bundle). 🤖 Generated with [Claude Code](https://claude.com/claude-code) > AGENT GENERATED --------- Co-authored-by: Claude Fable 5.1 <[email protected]>
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.
Layer 9 of the thread-list plugin stack. Base: main. #4036 (row layer) and #4039 (list assembly) stack on it.
Human comments
What was wrong
The plugin list loads as a bundle after boot, so a cold start has nothing to show in the sidebar until the bundle mounts, and the host had no way to tell "still loading" from "no thread list plugin is enabled". There was also no benchmark to hold the plugin list to the built-in list's performance.
What changed
apps/app/src/components/sidebar/ThreadListPlaceholder.tsx: the three sidebar states the flip in the next layers will render: loading skeleton rows, "No thread list plugin is enabled" with a link to Plugins, and " stopped working" with a reload button. The flip reads the existingusePluginFrontendsSettledhook fromplugin-frontend-boot-state.tsto pick loading versus missing; nothing in the sidebar imports the loader module statically, because it carries the plugin runtime shims and would pull the on-demand vendors into the boot payload (an earlier revision did exactly that and failed the bundle budget).apps/app/src/components/sidebar/sidebar.bench.test.tsx: gated (BB_SIDEBAR_BENCH=1) jsdom benchmark, 3,000 threads, simulated viewport so windowing engages, measuring mount, status patch, membership refetch, and pin. The baseline for the built-in list is inplans/thread-list-plugin.md.apps/app/src/components/ui/theme.css: Tailwind source entry for the plugin directory.turbo.json:@bb/plugin-build#testwaits for the SDK's bundled types so the zod resolution race stops.packages/plugin-api-map/test/mobile-guide.test.ts: 30 s budget for the layout case on loaded runners.An earlier revision of this PR also compiled the thread-list plugin frontend into the app build and seeded it at boot. That path was dropped (last commit): it duplicated the loader for one plugin and needed a localStorage memo to avoid a list-then-blank flash. The placeholder covers the cold start instead.
No wire changes, no SDK surface changes.
How you verified
ThreadListPlaceholder.test.tsxcovers the three states.plugin-frontend*.test.ts(65 tests) pass with the loader back to main's version.pnpm exec turbo run typecheck --filter=@bb/app🤖 Generated with Claude Code