Skip to content

Expose sidebar sections and section-aware new-thread options to plugins - #4024

Merged
SawyerHood merged 3 commits into
thread-list/1a-dto-columnsfrom
thread-list/1b-sections-and-new-thread
Sep 22, 2026
Merged

SawyerHood merged 3 commits into
thread-list/1a-dto-columnsfrom
thread-list/1b-sections-and-new-thread

Conversation

@SawyerHood

@SawyerHood SawyerHood commented Sep 21, 2026 •

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

A thread carried sectionId, but experimental_useSidebarThreads() dropped the sections list that rides on the same bootstrap payload, so a plugin list could not name "Later" or "Slop Cop". openNewThread had 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.
  • openNewThread accepts sectionId and environmentId, carried as sectionId and reuseEnvironmentId router state exactly as ProjectList and useCreateThreadInEnvironment do.
  • open sets the thread's conversation-collapsed atom to false before navigating, matching ThreadRow.
  • Testing harness accepts 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 openNewThread state shapes, the no-state case, the open side effect against the jotai default store, and unknown-thread open. Same typecheck/test filters as #4023 plus packages/plugin-api-map.

🤖 Generated with Claude Code

AGENT GENERATED

SawyerHood and others added 2 commits September 21, 2026 16:55
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]>
@SawyerHood
SawyerHood force-pushed the thread-list/1b-sections-and-new-thread branch from 82f06fe to 38feddc Compare September 21, 2026 23:56
@SawyerHood
SawyerHood marked this pull request as ready for review September 22, 2026 00:15
@SawyerHood
SawyerHood merged commit c7a3510 into main Sep 22, 2026
16 checks passed
@SawyerHood
SawyerHood deleted the thread-list/1b-sections-and-new-thread branch September 22, 2026 00:18
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]>
@ymichael ymichael mentioned this pull request Oct 8, 2026
2 tasks done
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