Skip to content

Finish the sidebar move: one copy of each app/thread-list component - #5275

Merged
ymichael merged 5 commits into
mainfrom
bb/finish-the-sidebar-move-dedupe-app-and-thread-li-thr_a4rgc4dg9y
Oct 9, 2026
Merged

ymichael merged 5 commits into
mainfrom
bb/finish-the-sidebar-move-dedupe-app-and-thread-li-thr_a4rgc4dg9y

Conversation

@ymichael

@ymichael ymichael commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

When the sidebar row layer moved into the thread-list plugin (#4036), about seventeen components were copied instead of moved. The app and the plugin each kept a copy, and the copies drifted: different touch delays, a release-click fix only in the app, extra rename features only in the plugin, and a fourth confirm dialog in the tasks plugin. Separately, bb's core sidebar.collapsed* UI preferences were left behind when the plugin migrated its own preferences. The app kept writing all six, only sidebar.collapsedThreads still had a reader (mobile recents), and that made recents' collapse state sync across devices by accident.

What changed

Three commits. Each component now has one home, placed by the rule now written down in docs/forkable-plugins.md ("What belongs in shared-ui"):

  1. Shared presentation primitives go to packages/shared-ui and the plugin registry. These are use-dialog-state, use-drag-click-suppression, use-reorder-dnd, use-sidebar-reorder-dnd, sortable-motion, compact-long-press-menu, action-menu-items, confirm-delete-dialog, rename-dialog, inline-rename, inline-rename-editor, sidebar-visibility-customize, sidebar-customize-panel, sidebar-row-classes, sidebar-hover-actions, context-selection and thread-list-empty-state. Where the app and the plugin need different behaviour, the difference is a prop:
    • Each side passes its own touch sensor: the app's drawer-aware one, and the plugin's 500 ms long-press one from Require a deliberate long press to reorder sidebar threads #4329.
    • The app renders the inline rename editor through its lazy split.
    • MachineRenameDialog uses the shared RenameDialog shell.
    • The tasks plugin's ConfirmDialog is replaced by ConfirmDeleteDialog, which gains className, size and confirmDisabled props.
  2. The thread status glyph is host-rendered through the SDK. The app still draws the glyph in the palette, related threads and mobile recents, so the host now exposes it as experimental_ThreadStatusGlyph (indicator, archived, rowStatus, hideIdleDraftLabel, size), and the plugin deletes its copy. The plugin still resolves the indicator itself, which lets it fold in collapsed children and drafts.
    • The SDK test fake exposes the requested indicator as data attributes.
    • Glyph rendering tests moved to the app's ThreadStatusGlyph.test.tsx.
    • SDK bumped to 0.6.36; the thread-list SDK floor is now 0.6.36.
    • Added an api_to_audit.md entry and the Plugin Guide surface symbols.
  3. Mobile recents keeps its collapse state on the device. It is stored in local storage under bb.mobileRecents.collapsedThreads. useMobileRecentsThreadReveal replaces the app's sidebar reveal hook and keeps the one behaviour recents used: navigating to a thread, or a thread becoming unread, opens its collapsed ancestors. The six sidebar.collapsed* keys leave the UI preference registry, the demo server and docs/configuration.md. The server already ignores stored rows for unknown keys. The thread-list migration no longer reads them.

No server/daemon wire changes. Net −1,769 non-test lines (+399 generated registry JSON).

User-visible differences:

  • The plugin's long-press menus now swallow the click that follows a long press (Open recent thread actions on hold #4813), as the app's already did.
  • MachineRenameDialog now returns focus to the opener after closing.
  • Tasks confirm dialogs clear their content while closing.
  • Mobile recents collapse no longer syncs across devices, and starts expanded once per device.
  • An install that has not started bb since 2026-09-21 loses its old sidebar collapse state.

How you verified

Ran with pnpm exec turbo run typecheck lint test on the touched packages:

Package Tests
app 5,640
thread-list 451
tasks 412
db 615
client-core 279
domain 220
plugin-sdk 368
plugin-build 165
plugin-api-docs 73
demo-server 15
plugin-registry 1

All pass. The server UI preferences test file also passes (18 tests).

  • Lint: 0 errors.
  • Typecheck: clean, except one error that already fails on main from Convert large text pastes into ordinary attachments #5098 (lazySecondaryPanelComponents.tsx:287), in a file this PR does not touch.
  • Fork check: pnpm check:plugin-forks plugins/thread-list plugins/tasks passes.
  • SDK version guard: check-plugin-sdk-version.mjs passes.

🤖 Generated with Claude Code

AGENT GENERATED

qa and others added 5 commits October 9, 2026 12:59
…stry

The thread-list plugin port (#4036) copied sidebar primitives instead of
moving them, and the app and plugin copies drifted. Presentation
primitives with no domain knowledge now have one home in
packages/shared-ui, published to plugins through the registry:
use-dialog-state, use-drag-click-suppression, use-reorder-dnd,
use-sidebar-reorder-dnd, sortable-motion, compact-long-press-menu,
action-menu-items, confirm-delete-dialog, rename-dialog, inline-rename,
inline-rename-editor, sidebar-visibility-customize,
sidebar-customize-panel, sidebar-row-classes, sidebar-hover-actions,
context-selection and thread-list-empty-state.

Where the app and plugin need different behaviour, the shared code takes
it as a prop: each side passes its own touch sensor (the app's
drawer-aware sensor, the plugin's deliberate long-press sensor, which now
owns its 500 ms hold); the app renders the inline rename editor through
its lazy split with field-sizing-content; the plugin keeps its shared
rename session and compact rename dialog. MachineRenameDialog uses the
shared RenameDialog shell, and the tasks plugin's confirm dialog is
replaced by ConfirmDeleteDialog with className, size and
confirmDisabled props.

docs/forkable-plugins.md gains a "What belongs in shared-ui" section.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The thread-list plugin carried its own copy of bb's thread status glyph
while the app still draws the glyph in the search palette, related
threads, and mobile recents. The host now exposes it as
experimental_ThreadStatusGlyph (indicator, archived, rowStatus,
hideIdleDraftLabel, size); the app's ThreadStatusGlyph is that
implementation and takes a resolved indicator, and the plugin renders
its rows and collapsed rollups through it and deletes its copy. The
plugin keeps resolving the indicator itself, so it can fold in
collapsed children and client-local drafts.

The SDK test fake exposes the requested indicator and row status as
data attributes; plugin tests assert what the row asks for, and the
icon, label, tone, and precedence checks moved to the app's
ThreadStatusGlyph test. runtimeMember now types the runtime lookup at
the installedApp boundary, which keeps PluginSdkApp under TypeScript's
union complexity limit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…bar keys

Since the thread-list plugin took over the sidebar, bb's core
sidebar.collapsed* UI preferences were only maintained by the app's
useSidebarThreadReveal, and only sidebar.collapsedThreads still had a
reader: mobile recents, which therefore synced its collapse state across
devices by accident.

Mobile recents now keeps collapsed thread ids in local storage
(bb.mobileRecents.collapsedThreads). useMobileRecentsThreadReveal
replaces the sidebar reveal hook and keeps the one behaviour recents
used: navigating to a thread, or a thread becoming unread, opens its
collapsed ancestors in recents.

The six core keys (sidebar.collapsedSections, collapsedProjects,
collapsedThreads, collapsedEnvironments, collapsedThreadSections,
collapsedMachines) leave the UI preference registry, the demo server,
and docs/configuration.md; the server already ignores stored rows for
unknown keys. The thread-list plugin's one-time migration no longer
reads them, so an install that has not started bb since 2026-09-21
starts with its sidebar groups expanded.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ymichael
ymichael force-pushed the bb/finish-the-sidebar-move-dedupe-app-and-thread-li-thr_a4rgc4dg9y branch from 9227bda to 3d2e6be Compare October 9, 2026 20:04
@ymichael
ymichael merged commit 2f004d5 into main Oct 9, 2026
48 checks passed
@ymichael
ymichael deleted the bb/finish-the-sidebar-move-dedupe-app-and-thread-li-thr_a4rgc4dg9y branch October 9, 2026 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant