Repository navigation
feat(sidebar): add progressive disclosure to threads lists instead of showing all threads - #3090
Closed
MayankBansal12 wants to merge 5 commits into
Closed
MayankBansal12 wants to merge 5 commits into
MayankBansal12 wants to merge 5 commits into
Conversation
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]>
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
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
sidebarProgressiveDisclosureexperiment for By project and By machine. When enabled, each thread tree: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
isBusyThreadso attention-state detection uses the same definition as collapsed sidebar activity.There are no host-daemon wire changes, so
HOST_DAEMON_PROTOCOL_VERSIONwas not incremented.How you verified
Added focused tests covering:
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