Repository navigation
Expose sidebar sections and section-aware new-thread options to plugins - #4024
Merged
SawyerHood merged 3 commits intoSep 22, 2026
Merged
SawyerHood merged 3 commits into
SawyerHood merged 3 commits into
Conversation
SawyerHood
force-pushed
the
thread-list/1b-sections-and-new-thread
branch
from
September 21, 2026 23:37
9b65cc0 to
82f06fe
Compare
The sections list rides on the same bootstrap payload the sidebar threads hook already reads, so a replaced list can name the buckets its threads belong to. openNewThread gains sectionId and environmentId, carried on router state exactly as bb's section menu and environment header do, and open now re-expands a collapsed conversation like bb's own row. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Co-Authored-By: Claude Fable 5.1 <[email protected]>
SawyerHood
force-pushed
the
thread-list/1b-sections-and-new-thread
branch
from
September 21, 2026 23:56
82f06fe to
38feddc
Compare
Co-Authored-By: Claude Fable 5.1 <[email protected]>
SawyerHood
marked this pull request as ready for review
September 22, 2026 00:15
SawyerHood
added a commit
that referenced
this pull request
Sep 22, 2026
## Human comments
## What was wrong
Three things bb's row paints are client-local and cannot ride on the
thread array: whether the composer holds an unsent draft (pencil and
working-draft glyphs), the row status another plugin's app-wide script
set through `experimental_setThreadRowStatus`, and the jump-shortcut
pill shown while the app command modifier is held. A plugin list had no
way to read any of them, so a status set by the drafts or workflows
plugin would vanish when the list changed hands.
## What changed
Four hooks on `@get-bb/plugin-sdk/app`, backed by the same stores the
built-in row uses:
- `useSidebarThreadDraft(threadId)` → `{ hasUnsubmittedDraft }` over
`usePromptDraftHasInput`
- `useSidebarThreadDraftIds()` → `ReadonlySet<string>` over
`usePromptDraftInputThreadIds`, for collapsed-group rollups
- `useSidebarThreadRowStatus(threadId)` over `usePluginThreadRowStatus`
- `useSidebarThreadShortcut(threadId)` → `{ label, ariaKeyshortcuts } |
null` over the sidebar shortcut context
Testing harness gains `sidebarDraftThreadIds`, `sidebarRowStatuses`, and
`sidebarShortcuts` options. Guide, API index, and surfaces updated.
These ship without the `experimental_` prefix by owner decision recorded
in the plan.
Prerequisite: #4024.
## How you verified
Hook tests with a faked draft store, the real row-status store, and the
real shortcut context provider. Typecheck and tests on the SDK, app, API
map, and the guide parity suite.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
> AGENT GENERATED
---------
Co-authored-by: Claude Fable 5.1 <[email protected]>
2 tasks done
2 tasks done
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
A thread carried
sectionId, butexperimental_useSidebarThreads()dropped the sections list that rides on the same bootstrap payload, so a plugin list could not name "Later" or "Slop Cop".openNewThreadhad no way to file the new thread under a section or reuse an environment, both of which bb's own list does through router state. Opening a thread from a plugin row also skipped the collapse-reset side effect bb's row performs on the secondary panel.What changed
PluginSidebarThreadsState.sections(PluginSidebarSection: id, name, createdAt, updatedAt) from the same query, no extra request.openNewThreadacceptssectionIdandenvironmentId, carried assectionIdandreuseEnvironmentIdrouter state exactly asProjectListanduseCreateThreadInEnvironmentdo.opensets the thread's conversation-collapsed atom to false before navigating, matchingThreadRow.sidebarThreads.sections. Guide, API index, audit entry, and surfaces updated.Prerequisite: #4023.
How you verified
Hook tests for sections passthrough and loading state, the three
openNewThreadstate shapes, the no-state case, the open side effect against the jotai default store, and unknown-threadopen. Same typecheck/test filters as #4023 pluspackages/plugin-api-map.🤖 Generated with Claude Code