Skip to content

Unify thread-list header actions and nested view controls - #3402

Merged
brsbl merged 7 commits into
mainfrom
bb/thread-list-direction-main-thr_ccffp4w2p2
Sep 10, 2026
Merged

brsbl merged 7 commits into
mainfrom
bb/thread-list-direction-main-thr_ccffp4w2p2

Conversation

@brsbl

@brsbl brsbl commented Sep 10, 2026 •

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

  • Thread-list controls changed placement and menu structure between Pinned, projects, sections, machines, and loose threads. Worktree creation was hidden in its menu, and independently styled buttons made the sidebar harder to scan and maintain.
  • Pinned could remain stuck above unrelated groups after its threads scrolled away. Compact worktree actions were inaccessible to touch, and reversing Updated at also reversed the existing active-first priority.

What changed

  • All organizing headers share New thread followed by … on hover/focus, with visible controls on touch. Every header menu offers New project, New section, and compact nested Organize and Sort by menus, followed by existing context-specific actions.
  • Organize is an exclusive choice and closes after selection. Sort remains open while tuning; selecting the current field reverses its arrow and direction while Updated at keeps active threads first. The additive sidebar.sortDirection preference uses the existing persistence, SDK, and CLI paths; default preserves prior ordering.
  • Worktrees expose New thread inline, leaving Rename and Archive in their menu. Project editing actions are grouped together and separated from the existing Remove action. No creation destinations or destructive consequences change.
  • Shared row-control components and semantic color/state tokens keep titles primary, grouping labels quieter, and controls secondary—including on hovered or selected rows. Navigation More uses a quieter resting color. Pinned now scrolls with its contents.
  • Production Sidebar Overview stories replace the discarded prototype. The implementation removes superseded controls and delegates menu open/close state to the shared dropdown; the slimming pass removes 96 net lines (78 production, 18 tests) without changing approved behavior. Thread nesting, archive placement, plugin actions, and command-palette behavior are outside this change.

How you verified

  • Remote CI passed at exact head cde7aeceeeb00958b82badfecd03437b04059f2d: build/typecheck/lint, all app/server/package/integration tests, and Linux/macOS package smoke. All 14 reported checks passed; native iOS and Node compatibility were workflow-skipped. No local CI-equivalent checks were run.
  • Rebased onto main@e02f6e64cc7afdf490e70a662c6445b5b8dee407, retaining the prior merge resolutions. Tree comparison confirms the result is exactly the previous implementation plus upstream changes; the PR remains 27 files. Main's touch-visibility regression exercises the actual shared project controls through closed, open, and reclosed states.
  • Exact-head Chrome for Testing 153.0.8010.36 verification passed at 1440×900 and 390×844: project menu ordering, Organize closing after selection, Sort remaining open during direction changes, and compact Back/close/reopen reset. Project controls remain visible and interactive with 36×36 touch targets before/during/after opening. Restored fixture preferences persist after reload.
  • Earlier bounded QA covered project/machine/custom views, active-first sorting, light/dark control states, plugin styling, Pinned scrolling, worktree creation/rename, and collapsed touch controls. Retained regression tests cover action ordering, callbacks, focus behavior, menu lifecycle, preference validation, and active-first date sorting.
  • Remaining verification limits: phone coverage is Chrome touch emulation, not native iOS/Safari. The existing compact retained-focus aria-hidden warning also occurred during close/reopen; the app root remained non-inert and exposed. The warning is not claimed fixed by this rebase.
  • One cumulative review was completed previously; no second review was run. git diff --check passed.
  • Screenshots use the same synthetic data, route /, project view, Updated at sorting, light theme, and open Atlas project menu. Before: exact merge base e02f6e64cc7afdf490e70a662c6445b5b8dee407. After: exact head cde7aeceeeb00958b82badfecd03437b04059f2d. Desktop images are matching 460×844 crops of a 1440×900 viewport; phone images are full 390×844 captures.
Surface Before After
Desktop project menu Before — desktop project menu After — shared header menu
Phone project menu Before — phone project menu After — phone header menu

BB-Thread-ID: thr_ccffp4w2p2

AGENT GENERATED

@brsbl
brsbl force-pushed the bb/thread-list-direction-main-thr_ccffp4w2p2 branch from 0d8422c to cde7aec Compare September 10, 2026 19:12
@brsbl
brsbl merged commit de93612 into main Sep 10, 2026
16 checks passed
@brsbl
brsbl deleted the bb/thread-list-direction-main-thr_ccffp4w2p2 branch September 10, 2026 19:49
brsbl added a commit that referenced this pull request Sep 10, 2026
## Human comments

## What was wrong

- Custom-organized sidebar threads could be moved by drag and drop, but
their row actions offered no destination picker.

## What changed

- Adds **Move to section** with `MoveTo` to active root-thread actions
in **Custom** view: desktop dropdown/right-click submenus and a compact
long-press step with **Back**.
- Follows saved sidebar order, including **Threads**, and omits
**Pinned**. The current destination is disabled for unpinned threads.
Existing mutations preserve move persistence; moving a pinned thread
unpins it, and choosing its stored section only unpins it.
- Integrates with the shared sidebar header controls from #3402. The
focused diff remains 12 files; main's bundle limits are unchanged.

## How you verified

- Remote [CI](https://github.com/get-bb/bb/actions/runs/34524003966) for
`d334e6953963fd5891a1fdb7eb75f020cd604d0f`: **14 passed, 2 skipped**,
including checks, app/server/package/integration tests, and macOS/Ubuntu
package smoke. Optional Node compatibility and native iOS jobs were
skipped. The app fits unchanged bundle limits: **1681.7 KB raw / 410.9
KB brotli** against **1683.2 KB / 419.0 KB**.
- Menu and mutation tests cover desktop/context parity, eligibility,
compact Back/reset, destination no-op, section moves, and both pinned
transitions. Existing optimistic-update and serialized-unpin coverage
remains.
- Final-head Chrome for Testing **153.0.8010.36**: shared header **By
project → Custom** eligibility; desktop dropdown and right-click moves
to a section and **Threads**; hard-reload persistence and disabled
current destination; compact touch long-press, **Back**, close/reopen
reset, and saved moves. No captured runtime errors or compact app-root
`inert`/`aria-hidden` changes. All six synthetic threads and sidebar
settings were restored. The unchanged pinned transitions were exercised
before this rebase and retain passing remote mutation coverage.
- Native iOS is unverified: the local Xcode/CoreSimulator setup is
incompatible and cannot resolve `simctl`; remote iOS coverage was
skipped. Phone-width Chrome does not establish native iOS or Safari
behavior.

| Surface | Before — merge base `de9361268088` | After — head
`d334e6953963` |
| --- | --- | --- |
| Desktop web · 1440 × 900 | ![Before: shared sidebar headers and row
actions without Move to
section](https://github.com/user-attachments/assets/1bd7059a-e7af-454b-8cbd-a581f773027c)
| ![After: Move to section alongside shared sidebar
headers](https://github.com/user-attachments/assets/53f120a5-c178-4638-8d07-0d4f05aee7dd)
|
| Phone web · 390 × 844 | ![Before: compact long-press row actions
without Move to
section](https://github.com/user-attachments/assets/ce444e5c-34ca-4b0f-b178-6c23b5452269)
| ![After: compact Move to section step with
Back](https://github.com/user-attachments/assets/1b80ab7a-888f-4b9b-8205-ccae4cc6074e)
|

- Both revisions use `scripts/bb-dev-app current` under **Node
22.19.0**, sequentially in the same managed worktree. Captures match the
synthetic **Release notes** thread in **Follow-ups**,
`/threads/thr_move_release`, **Custom** organization, light theme, scale
1, and viewport per row. Images were inspected directly.

BB-Thread-ID: thr_ccffp4w2p2

> AGENT GENERATED
ymichael added a commit that referenced this pull request Sep 17, 2026
## Human comments

## What was wrong

Two defects in the sidebar's sticky stack
(`apps/app/src/components/ui/theme.css`), the second exposed by fixing
the first.

1. Every tier offset derives from one chain:
`--bb-sidebar-sticky-label-top` → `--bb-sidebar-sticky-project-top`
(label top + label height + label gap) →
`--bb-sidebar-sticky-parent-base-top` → per-level `parent-stride`. That
chain assumes each section pins its own label. `BuiltInSidebarSection`
passes `stickyHeader={false}` for Pinned (added in #3402, "Pinned now
scrolls with its contents"), so its label renders `relative top-auto`
and scrolls away — but the offsets below it still reserved the label's
slot. An expanded pinned parent thread therefore froze 36px below the
top of the scroll area with a dead band above it that the other pinned
rows scrolled through. It only surfaces when a pinned root has children
and is expanded, which is the only case where a pinned row becomes a
sticky tier.
2. The stack's top padding is inside the scrollport, so rows stay
visible while they scroll through it. A sticky label hides that strip
behind its own opaque `::before` shield; a pinned parent row has no top
shield, because until (1) was fixed something sticky was always above
it. With the row now flush at the padding, the child scrolling
underneath showed through the strip above it — measured at `scrollTop:
160`, the stuck row spans 8–36px while its first child spans −4–24px,
leaving that child's 0–8px slice visible.

## What changed

- `apps/app/src/components/sidebar/TopLevelSidebarSection.tsx`: the
section's `SidebarStickyGroup` root now exposes
`data-sidebar-sticky-header="false"` when `stickyHeader` is false
(attribute absent in the sticky default, so no markup churn for the
common case).
- `apps/app/src/components/ui/theme.css`: one rule collapses
`--bb-sidebar-sticky-project-top` to
`--bb-sidebar-sticky-stack-padding-top` for those groups. Since
`project-top` is the origin the parent base and every parent level
derive from, this corrects the project tier and all parent depths at
once, and composes with the existing `[data-sidebar-sticky-section]`
rule that drops the parent base onto `project-top` for label → parent
trees like Pinned.
- `apps/app/src/components/ui/theme.css`:
`[data-sidebar-sticky-stack]::before` adds one sticky cap the height of
the stack's top padding, pulled over the strip with a negative top
margin. Layout is unchanged (row rects measure identically before and
after) and it is invisible at rest. It keys off the stack rather than
any one tier, so it covers labels, project rows, and parent rows alike.

CSS and data-attribute only: no JS measurement, no wire or CLI surface
changes, so no `HOST_DAEMON_PROTOCOL_VERSION` bump.

## How you verified

Reproduced first in Ladle (`sidebar--overview--overview`) and then
confirmed both fixes against a `pnpm start:worktree` production build
driven with dev-browser, measuring each row's offset from the top of the
scroll container.

Sticky offset of an expanded pinned parent (430px, `pointer: coarse`):

| scrollTop | before | after |
| --- | --- | --- |
| 40 | 36px, dead band above | 8px, flush |
| 140 | 36px, dead band above | unstuck, in flow |
| 280 (4-level chain) | n/a | 8 / 50 / 92 / 134px |

The `Threads` section is unaffected: its label still pins at 8px with
parents at 36px directly beneath it. The scrollport strip was verified
at 1280px in both themes — the child slice visible above the pinned row
before the cap is gone after it. The partially clipped row *below* a
pinned row remains: that is a row sliding under an opaque sticky row,
i.e. ordinary sticky-list behavior.

Tests added that fail before and pass after:

- `BuiltInSidebarSection.test.tsx` asserts the sticky group reports
`data-sidebar-sticky-header="false"` for Pinned and omits the attribute
for Threads.
- `theme.test.ts` asserts the collapsed label slot for non-sticky
headers, that the section-variant rule still chains off `project-top`,
and that the cap is sticky, opaque, and offset by its own negative
margin.

Commands:

- `pnpm exec turbo run typecheck lint test --filter=@bb/app` → 544 test
files, 4804 tests passing; no lint errors.
- One run hit a failure in
`src/views/thread-detail/SplitThreadArea.archive.test.tsx` (a routing
assertion unrelated to these changes); it passed in isolation and on a
forced full re-run, so it appears flaky.

> AGENT GENERATED

---------

Co-authored-by: Claude Opus 5 (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