Skip to content

Widen the plugin sidebar thread DTO with the columns bb's list reads - #4023

Merged
SawyerHood merged 2 commits into
mainfrom
thread-list/1a-dto-columns
Sep 22, 2026
Merged

SawyerHood merged 2 commits into
mainfrom
thread-list/1a-dto-columns

Conversation

@SawyerHood

@SawyerHood SawyerHood commented Sep 21, 2026 •

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

The plugin-facing thread DTO (PluginSidebarThread) is a hand-picked copy of the internal ThreadListEntry. The copy dropped nine columns the built-in sidebar reads to sort, group, and filter: execution status, runtime display status, queued work, pin sort key, visibility, lifecycle owner, fork source, environment path, and the worktree flag. It also coerced the queued-waiting and queued-failed indicators to none. A plugin list built on the DTO could not reproduce bb's own behavior, which blocks moving the sidebar into a plugin (plan, added in this PR).

What changed

  • packages/plugin-sdk/src/app-contract.ts: PluginSidebarThread gains status, runtimeStatus, queuedWork, pinSortKey, isHidden, lifecycleOwnerThreadId, sourceThreadId, and environment.path / environment.isWorktree. PluginSidebarThreadIndicator gains queued-failed and queued-waiting. Every enum field documents its treat-unknown fallback.
  • apps/app/src/lib/plugin-sidebar-threads.ts: the mapper fills the new fields and stops coercing queued indicators.
  • Guide field list, audit entry, and the provider-usage test fixture updated.

This is layer 1 of a stack; nothing depends on it below.

How you verified

New mapper tests cover status and lineage, hidden threads, and queued indicators with their labels and precedence. Ran:

pnpm exec turbo run typecheck --filter=@get-bb/plugin-sdk --filter=@bb/app --filter=bb-plugin-provider-usage
pnpm exec turbo run test build:types --filter=@get-bb/plugin-sdk --filter=bb-plugin-provider-usage
vitest: plugin-sidebar-threads, plugin-sidebar-hooks, faviconAttentionDot, plugin-authoring-docs

🤖 Generated with Claude Code

AGENT GENERATED

SawyerHood and others added 2 commits September 21, 2026 16:54
The plugin-facing copy of ThreadListEntry dropped status, runtime status,
queued work, pin sort key, visibility, lineage, and the environment path and
worktree flag, all of which the built-in sidebar reads to sort, group, and
filter. Add them so a replaced list can reproduce bb's behavior, and report
queued-failed and queued-waiting as indicators instead of coercing them to
none. Also adds the thread-list plugin plan.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@SawyerHood
SawyerHood force-pushed the thread-list/1a-dto-columns branch from e7862f3 to 553d67a 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 35455c8 into main Sep 22, 2026
16 checks passed
@SawyerHood
SawyerHood deleted the thread-list/1a-dto-columns branch September 22, 2026 00:18
SawyerHood added a commit that referenced this pull request Sep 22, 2026
…ns (#4024)

## 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](https://claude.com/claude-code)

> AGENT GENERATED

---------

Co-authored-by: Claude Fable 5.1 <[email protected]>
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