Skip to content

Use one tap-to-open, chevron-row-to-close model for every composer banner - #4890

Merged
brsbl merged 10 commits into
mainfrom
bb/composer-banner-expand-collapse
Oct 5, 2026
Merged

brsbl merged 10 commits into
mainfrom
bb/composer-banner-expand-collapse

Conversation

@brsbl

@brsbl brsbl commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

After #4889 the workflow cards opened by tapping the card and closed from a full-width chevron row, but every other banner above the composer still toggled from a small rotating header chevron, and grouped banners described extra items with inline "+N more" text. Two expand/collapse models and two count treatments sat in the same stack, inline sections were only clickable on their short label, and the new disclosure pieces were copied between the app and the workflows plugin.

What changed

  • One disclosure model for every composer banner: to-dos, background commands, Goal, prompt mode, machine status, active child threads, and the context banner's parent-thread, status, and changed-files sections open from their whole header (inline sections fill the rest of their header row) and close from a full-width up-chevron row at the bottom of the opened body. Focus moves to the close row on open and back to the header on close.
  • Right-edge column: a chevron appears on hover or keyboard focus in a 32px column aligned with the Plan/Goal dismiss X (hidden at rest, on touch, and while open). Grouped banners (workflow stack, background commands, active child threads) show a +N pill in that column instead of "+N more" text and no chevron.
  • Shared definitions: new shared-ui registry item prompt-stack-disclosure (useDisclosureFocusHandoff, PromptStackCollapseRow, PromptStackHoverChevron, PromptStackCountSlot, PromptStackPeekLayers) used by the app banners and the workflows plugin. The app adds AnimatedDisclosureBody; PromptStackCardChevron is removed (no remaining users).
  • Collapsed bodies are inert, so hidden controls leave the tab order.
  • Workflow stack lifecycle: re-collapses once fewer than two workflows run (including dropping straight to zero), and its expanded state is per thread in both the app and the plugin. The expanded list keeps a stable wrapper so a still-running card does not remount when another finishes.
  • Not changed: the queued-messages drawer (its own drag-between-modes gesture) and the scheduled-send picker (not collapsible).

Registry output regenerated with build-registry.mjs. No wire, CLI, or SDK-export changes.

How you verified

Before: f6cd19aac5 (merge base) · After: 092c7fce5a · Captured at 2× in Chrome for Testing via Browser Automation, branch dev app, seeded thread with every banner kind (2 workflows, 2 background commands, plan mode, Goal, to-dos, 2 active child threads, parent link, 2 untracked files)

Screen / state Viewport Before After
All banners / at rest Desktop · 1440×1100 Before: header chevrons and +N more text After: no resting chevrons, +N pills in the X column
To-dos / hovering the header Desktop · 1440×1100 Before: chevron always visible After: chevron appears on hover, aligned with the X
Changed files / hovering the right end of the row Desktop · 1440×1100 Before: only the short label is clickable After: the whole row highlights
Changed files / opened Desktop · 1440×1100 Before: opened via rotating chevron After: opened with close row
All banners / at rest Mobile · 390×844 Before: banners on mobile After: banners on mobile
Background commands / opened Mobile · 390×844 Before: opened via chevron After: opened with close row
  • Exercised in the dev app on the final head: to-dos, changed files, and the workflow stack each open from the header with focus on the close row, and close back to the header; clicking the far right of the changed-files row opens it; chevron centers measured at 17px from the card edge, matching the Goal X.
  • Tests: ThreadWorkflowCard.test.tsx (open/close and focus hand-off); AnimatedBody.test.tsx (inert when collapsed); ThreadDetailPromptArea.test.tsx (stack re-collapses below two runs); plugins/workflows/src/app.test.tsx (stack 2 → 0 → 2 re-collapses, +N, peek layers, single-card focus, inert); ThreadPromptContextBanner.test.tsx (+1 pill). Run in remote CI only.
  • Slop Cop review on 32e9255d47: security, performance, and code quality found no P0/P1; architecture found one P1 (plugin stack reset skipped when runs dropped to zero or the thread changed), fixed in 073b972d7a with a 2 → 0 → 2 test. A follow-up slimming pass folded the toggle handlers into the shared hook without behavior changes.
  • P2 follow-ups, not in this PR: changed-files row uses flex-1 and may truncate first beside a long PR label and Merge button; two Ladle story hints still describe the old chevrons; focus tests for context-banner sections and Goal/Plan; the plugin card still hand-rolls the animated body markup; the trailing slot assumes 12px host padding.
  • Not covered visually: machine status (needs a suspended host) and the plugin banner (its runs reconcile against live agent threads); both share the verified pieces.

BB-Thread: Collapse or stack elements

🤖 Generated with Claude Code

AGENT GENERATED

final-bg-open-mobile

…nner

Composer banners (to-dos, background commands, goal, prompt mode, machine
status, and the context banner's parent, child-thread, status, and
changed-files sections) drop their header chevrons: the header opens the
banner and a full-width up-chevron row at the bottom of the body closes it,
with focus handed between the two. The collapse row, count pill, peek
layers, and focus hand-off move into a shared-ui registry item so the core
app and the workflows plugin share one definition. Collapsed bodies are now
inert, and the workflow stack re-collapses when fewer than two workflows
run and no longer carries its expanded state across threads.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

brsbl and others added 9 commits October 4, 2026 22:51
The context banner's changed-files and status sections and the machine
status toggle now take the remaining width of their header row, so tapping
anywhere outside the row's other controls opens them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Collapsed composer banner headers show a down chevron at their right edge on
hover or keyboard focus. It stays hidden at rest, on touch screens, and
while the banner is open. Small icon-only section toggles keep their compact
width and show no chevron.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Background commands and active child threads replace their "+N more" text
with the same +N count pill the workflow stack uses.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The +N count pill now sits flush with the right edge of its banner header.
On hover or keyboard focus the disclosure chevron takes its place instead of
reserving its own space; touch screens keep the pill.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The hover chevron and +N pill sit in a 32px trailing slot at the header's
right edge, centered on the same column as the Plan and Goal dismiss X.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The hover chevron keeps its own slot in the dismiss column instead of
replacing the +N pill, so the count stays visible on hover and the pill
sits immediately to the left of the chevron.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Grouped banners (workflow stack, background commands, active child threads)
show only the +N pill, centered on the Plan/Goal dismiss column; the pill
already signals that the banner opens. Banners without a count keep the
hover chevron in that column.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…changes

The stack-expanded reset ran after the banner's early return, so a stack
that went from two runs straight to none stayed expanded for the next
batch. Reset before returning and key the banner by thread so expanded
state never carries across threads.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
useDisclosureFocusHandoff takes the toggle and returns the trigger and
collapse-row handlers, replacing the per-banner wrappers and the context
banner's sectionDisclosure helper. Unexport internal class strings, drop an
unused prop and a one-use helper, and leave inert coverage to AnimatedBody.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@brsbl
brsbl merged commit 52da286 into main Oct 5, 2026
34 checks passed
@brsbl
brsbl deleted the bb/composer-banner-expand-collapse branch October 5, 2026 07:30
brsbl added a commit that referenced this pull request Oct 5, 2026
## Human comments

## What was wrong

After #4890, banners without a `+N` count show their disclosure chevron
only on hover. A single running workflow card has no count, so at rest
nothing marked it as expandable, and on touch screens it never showed at
all.

## What changed

- New `PromptStackChevron` in the shared-ui `prompt-stack-disclosure`
registry item: the same trailing slot as the hover chevron (aligned with
the Plan/Goal dismiss X), visible at rest, hidden while open.
- `ThreadWorkflowCard` and the workflows plugin's `WorkflowComposerCard`
use it, so a single workflow card (and each card in an expanded stack)
shows the chevron at rest. Grouped banners keep the `+N` pill; other
banners keep the hover-only chevron.
- Registry output regenerated with `build-registry.mjs`.

## How you verified

Before: `52da28609e` (merge base) · After: `f526eead4d` · Captured at 2×
in Chrome for Testing via Browser Automation, branch dev app, seeded
thread with one running workflow

| Screen / state | Viewport | Before | After |
| --- | --- | --- | --- |
| One workflow / at rest | Desktop · 1440×900 | ![Before: no chevron at
rest](https://github.com/user-attachments/assets/a4d4799a-549b-4def-a4b4-80116bede58c)
| ![After: chevron at
rest](https://github.com/user-attachments/assets/7894db38-f7be-4afb-b0ec-b16e916eaa1b)
|
| One workflow / at rest | Mobile · 390×844 | ![Before: no chevron on
touch](https://github.com/user-attachments/assets/aaa2accc-3b79-4508-a47c-5ae45811e42e)
| ![After: chevron on
touch](https://github.com/user-attachments/assets/2031af10-e474-436e-9107-c86a17f4a40e)
|

- Measured the card's chevron opacity at rest: 0 before, 1 after, on
both viewports.
- `ThreadWorkflowCard.test.tsx` now asserts the chevron is present while
closed and absent while open. Run in remote CI only.

BB-Thread: [Collapse or stack
elements](https://brsbl.getbb.app/projects/proj_khiw2za95v/threads/thr_e2uq3rv44u)

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

> AGENT GENERATED

Co-authored-by: Claude Opus 5.5 <[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