Skip to content

Sidebar chronological mode + project chip in composer footer - #219

Merged
SawyerHood merged 4 commits into
mainfrom
sidebar-organize-and-project-chip
Jun 18, 2026
Merged

SawyerHood merged 4 commits into
mainfrom
sidebar-organize-and-project-chip

Conversation

@SawyerHood

Copy link
Copy Markdown
Collaborator

Summary

Three related sidebar/composer UX changes plus a dev-launcher tweak.

1. Chronological organization mode for the sidebar

Adds an Organize sidebar menu (…) to the Projects and Threads section headers. It's a global, localStorage-persisted setting:

  • By project (default) — today's grouping.
  • Chronological list — collapses everything non-pinned into a single All Threads bucket across all projects. The Sort by submenu (shown only in this mode) chooses Updated at (the existing status-aware activity heuristic) or Created at (literal createdAt desc). The Pinned section is preserved.

Implementation: the sibling comparator is now threaded through buildProjectThreadGroups (default unchanged) instead of hardcoding compareStandardThreads. The flat bucket renders via a new ChronologicalThreadTree that derives projectId per top-level item so cross-project rows still route correctly.

2. Current project in the composer footer

Adds a read-only project chip (folder icon + name) to the follow-up composer footer, next to the environment/branch chips. Resolved from the shared sidebar-navigation cache via a new useProjectDisplayName selector (no extra subscriptions/refetch). Hidden for the personal project. The new-thread page already has an editable ProjectSelector, so this only covers the existing-thread footer where the project is fixed.

3. bb-dev-app: desktop only with --desktop

The launcher started the Electron desktop app on every current/main/branch run. Now it starts only the dev server by default; the desktop shell is gated behind a new --desktop flag (parsed in any position). AGENTS.md updated.

Testing

  • pnpm exec turbo run typecheck --filter=@bb/app ✅
  • pnpm exec turbo run test --filter=@bb/app for projectThreadGroups and ThreadEnvironmentSummary ✅ (added regression tests: comparator swap reorders independently of status; project chip shows/hides on projectName).
  • zsh -n scripts/bb-dev-app ✅; verified current (no flag) leaves the desktop session stopped.

🤖 Generated with Claude Code

SawyerHood and others added 4 commits June 17, 2026 21:39
Add an "Organize sidebar" menu to the Projects and Threads section headers
(global setting, persisted in localStorage). "By project" keeps today's
grouping; "Chronological list" collapses everything non-pinned into a single
All Threads bucket across all projects, with a "Sort by" submenu choosing
Updated at (the existing status-aware activity heuristic) or Created at
(literal createdAt desc).

- Thread the sibling comparator through buildProjectThreadGroups instead of
  hardcoding compareStandardThreads, so the chronological list can swap sort.
- Render the flat bucket via a new ChronologicalThreadTree that derives
  projectId per top-level item so cross-project rows still route correctly.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Add a read-only project chip (folder icon + name) to the follow-up composer
footer, next to the environment/branch chips, so an existing thread surfaces
its project. Resolved from the shared sidebar-navigation cache via a new
useProjectDisplayName selector (no extra subscriptions). Hidden for the
personal project, where the label is not meaningful.

The new-thread page already has an editable ProjectSelector, so this only
covers the existing-thread footer where the project is fixed.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
The launcher started the Electron desktop app on every current/main/branch
run, which is heavier than most QA needs. Start only the dev server by
default and gate start_desktop behind a new --desktop flag; parse flags in
any position. Document the new default and flag in AGENTS.md.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Address codex review: ChronologicalThreadTree reused buildProjectThreadGroups,
so threads stayed nested under parents (hidden when a parent was collapsed) and
sorted only among siblings rather than globally — i.e. not actually a
chronological list.

- Add buildChronologicalThreadList: one top-level row per non-side-chat thread,
  globally ordered by the chosen comparator, no nesting or worktree grouping.
- Gate useProjectDisplayName's query with enabled when no project id is given,
  so personal threads don't trigger the bootstrap fetch.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@SawyerHood
SawyerHood merged commit b1a6590 into main Jun 18, 2026
6 checks passed
@SawyerHood
SawyerHood deleted the sidebar-organize-and-project-chip branch June 18, 2026 04:51
SawyerHood added a commit that referenced this pull request Jul 1, 2026
## What

Restores parent/child **nesting** in the sidebar's **"Manually"**
(chronological) organization mode. Child/subtask threads now render
indented under their parent again, instead of as flat top-level rows.

## Why / history

- **#219** introduced "Manually" mode as a flat list.
- **#319** (*"Nest sidebar children when grouping is disabled"*) changed
it to nest parent/child threads.
- **#258** (*sidebar folders*) regressed #319:
`buildChronologicalThreadList` began flattening every thread to
`children: []`, and the renderers (`ChronologicalThreadTree` /
`ChronologicalFolderThreadSections`) hard-code `groupBy: "folder"` —
routing manual mode through the flat branch and leaving #319's nesting
path unreachable. Projects mode kept nesting the whole time via
`buildProjectThreadGroups`.

## Change

`buildProjectThreadGroups` and `buildChronologicalThreadList` were
near-identical and had drifted apart — that divergence *is* the bug.
Both now route through one shared `assembleThreadItems` helper,
differing only by the `groupEnvironmentThreads` flag (on for projects,
off for chronological). Folder grouping / manual order run on the root
items, so descendants stay nested under their parent and follow it into
its folder — matching Projects mode.

Intentional trade-off: in Manually mode you can no longer drag a *child*
into a different folder independently of its parent (children follow
their parent), identical to Projects mode.

## Tests

- `@bb/app` typecheck: pass
- All sidebar tests: 81/81 pass
- Added regression test `nests a child thread under its parent root
inside a folder` — verified it **fails on the old flat code** (produced
a loose `'child'` row) and **passes with the fix**.
- Manually QA'd in the dev app: switching Organize by → Manually shows
the three subtasks nested under the manager thread with the tree guide
line.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.8 (1M context) <[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