Skip to content

feat(sidebar): add progressive disclosure to threads lists instead of showing all threads - #3090

Closed
MayankBansal12 wants to merge 5 commits into
get-bb:mainfrom
MayankBansal12:bb/add-thread-list-progressive-disclosure-thr_q6u9hj8z8w
Closed

MayankBansal12 wants to merge 5 commits into
get-bb:mainfrom
MayankBansal12:bb/add-thread-list-progressive-disclosure-thr_q6u9hj8z8w

Conversation

@MayankBansal12

@MayankBansal12 MayankBansal12 commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Human comments

  • This PR limits thread/project sessions in the By project and By machine sidebar modes to attention based items (unread + busy + pending interaction + recent 5)
  • Manually mode uses a separate section-aware, drag-and-drop thread tree and this PR doesn't covers it.
  • Collapse to get back to initial state is not part of the current PR and will be added in future
  • The feature is behind the experiments under Sidebar Progressive Disclosure
Screencast.From.2026-09-05.02-23-27.mp4

What was wrong

The sidebar modes rendered every root thread group at once. This made large thread lists harder to scan, with no way to reveal older groups while keeping sessions that need attention easily visible.

What changed

Added the default-off sidebarProgressiveDisclosure experiment for By project and By machine. When enabled, each thread tree:

  • Shows the first five groups in the current sort order.
  • Keeps busy, waiting-for-input, unread-finished, and selected thread groups visible beyond that limit.
  • Reveals ten additional non-attention groups per Show more click.
  • Hides the control once every group is visible.
  • Preserves the existing full-list behavior when the experiment is disabled.

The experiment is available in Settings and through bb settings experiment sidebarProgressiveDisclosure <true|false>. Configuration docs, the generated guide template, and the built-in CLI skill reference were updated.

Manually remains unchanged because it uses a separate section-aware, drag-and-drop thread tree and requires its own disclosure behavior.

The shared thread activity helpers now expose isBusyThread so attention-state detection uses the same definition as collapsed sidebar activity.

There are no host-daemon wire changes, so HOST_DAEMON_PROTOCOL_VERSION was not incremented.

How you verified

Added focused tests covering:

  • Full-list behavior when the experiment is disabled.
  • Lists at or below the five-group limit.
  • Busy, waiting-for-input, unread-finished, and selected groups beyond the limit.
  • Ten-item incremental expansion.
  • Attention groups not consuming expansion slots.
  • Settings toggle updates.

Commands run:

  • pnpm exec turbo run test --filter=@bb/app -- src/components/sidebar/ProjectThreadTree.disclosure.test.tsx src/views/SettingsView.experiments.test.tsx — 12 tests passed.
  • pnpm exec turbo run typecheck --filter=@bb/app — passed.

Fixes #1509

Collapse thread lists to their first five root items with a Show
more/Show less toggle, keeping busy, unread-done, and selected
threads visible when collapsed.
Show more reveals the next ten hidden items instead of everything,
and a Collapse control snaps the list back to the attention set.
Add a focused ProjectThreadTree suite for the attention set, chunked
Show more, and Collapse behavior, and update the existing interaction
test to the Collapse control.
The attention filter retained busy, unread-finished, and selected items, but not
hasPendingInteraction, so a thread blocked on a prompt was kept only when its
runtime displayStatus happened to be running. It is not: hasPendingInteraction is
a SQL EXISTS over pending interaction rows and never consults thread status, and
resolveThreadRuntimeStateFromLatestSession reports waiting-for-host once the host
drops. Either path hid the highest-priority row in the sidebar, which
resolveThreadListIndicator ranks second only to unread-error.

Retain it explicitly, and cover the idle-runtime case that incidental coverage
misses. Docs that enumerate the retained set now name it.

Also folds in the rest of the work that sat on this branch:

- Gate the whole behavior behind a default-off sidebarProgressiveDisclosure
  experiment, wired through the domain key, server settings, the Settings
  toggle, docs/configuration.md, the bb-cli skill reference, and the guide
  template.
- Drop the thread list collapse control and match the Show more button to
  sidebar row styling.
- Export isBusyThread from client-core and use it for the one definition of
  "busy": getCollapsedChildActivity computed the same six-way OR as its working
  field, so it now calls the helper and the single-use child locals are inlined.
- Fold the attention check into one traversal. It walked each item three times:
  two scans over the flattened descendants plus projectThreadItemContainsThread,
  which visits the same thread set. The selectedThreadId undefined guard was
  dead, since thread.id is always a string.
- Derive the Show more visibility from item counts instead of a hand-maintained
  hasHiddenItems flag; the rendered list is always a subsequence of the input.
- Stub system config in ProjectList.modes.test.tsx, which renders
  MachineModeSections without a QueryClient and threw once ProjectThreadTree
  started reading the experiment.
SawyerHood added a commit that referenced this pull request Sep 4, 2026
## Human comments

## What was wrong

The By project and By machine sidebars rendered every root thread group,
making long lists difficult to scan. This builds on #3090: its
disclosure control looked like another thread row, and its count-based
expansion could hide previously revealed threads when attention cleared.
Keyboard expansion also left focus after the newly revealed rows or
removed the focused button entirely.

## What changed

Added the default-off `sidebarProgressiveDisclosure` experiment from
#3090. It shows five root groups plus busy, waiting-for-input,
unread-finished, and selected groups, then reveals ten additional groups
per click. Manually mode retains its existing behavior.

“Show more” is muted text aligned with thread titles, brightens on
hover, and disappears when the list is exhausted. Revealed group
identities remain visible through activity and sort-order changes.
Keyboard activation mounts and focuses the first newly revealed row,
including offscreen and collapsed groups. There is no Show less control.

The experiment is available through Settings, the existing settings
API/SDK, and `bb settings experiment sidebarProgressiveDisclosure true`.
Updated the configuration docs, CLI guide, and skill reference. No
host-daemon wire changes.

## How you verified

- `pnpm exec turbo run test --filter=@bb/app --
src/components/sidebar/ProjectThreadTree.disclosure.test.tsx
src/components/sidebar/SidebarWindowedItems.test.tsx` — 19 tests passed.
- `pnpm exec turbo run typecheck --filter=@bb/app` — passed.
- `pnpm exec turbo run lint --filter=@bb/app` — passed with existing
warnings during implementation.
- Regression tests for visibility and focus failed against the original
PR implementation and passed with the fixes.
- Verified the dev sidebar in Chrome with 17 fixture threads: 5 → 15 →
17 expansion, keyboard focus on each new batch, matching title
alignment, muted styling, and no Show less control.

Fixes #1509

> AGENT GENERATED

---------

Co-authored-by: mayank <[email protected]>
@SawyerHood SawyerHood closed this Sep 4, 2026
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.

[UI] Sidebar thread lists: attention-first progressive disclosure instead of showing every thread item

2 participants