Skip to content

Auto-collapse concurrent workflow cards above the composer - #4889

Merged
brsbl merged 1 commit into
mainfrom
bb/collapse-or-stack-elements-thr_e2uq3rv44u
Oct 5, 2026
Merged

brsbl merged 1 commit into
mainfrom
bb/collapse-or-stack-elements-thr_e2uq3rv44u

Conversation

@brsbl

@brsbl brsbl commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

Every running workflow got its own full card above the composer, each with a header and a full-width phase strip. With four or more concurrent runs the cards pushed the composer down and the thread content off screen, and there was no way to fold them away.

What changed

  • Auto-collapse (2+ running): concurrent workflows collapse into a stack. The front card is the newest run (name, agents, elapsed time, inline phase strip) with a +N count pill; up to two card edges peek beneath it. Tapping the stack expands every card.
  • One expand/collapse model: cards no longer carry a chevron. Tap a card (or the stack) to open; close from a full-width up-chevron row at the bottom — below the list for the stack, inside the card for a single workflow's phase detail. Because the cards grow upward from the composer, the close row lands where the tapped header was. Focus moves to the close row on open and back to the card/stack on close.
  • Lighter cards: each workflow card is a single row with its phase strip inline instead of a full-width strip underneath.
  • Workflows plugin banner (plugins/workflows) follows the same rules; its "open in side panel" arrow is kept on each card.
  • New ThreadWorkflowStack (apps/app/src/components/promptbox/banner/); ThreadWorkflowCard split into ThreadWorkflowSummary + card; stack-open state lives in ThreadDetailPromptArea. Each card now uses useId instead of fixed DOM ids, fixing duplicate ids when several cards render.

No wire, CLI, or plugin-API changes.

How you verified

Before: 09ff18a73b (merge base) · After: 6fb4b8bb50 · Captured at 2× in Chrome for Testing via Browser Automation, branch dev app with seeded running-workflow threads

Screen / state Viewport Before After
4 running workflows / at rest Desktop · 1440×900 Before: four full cards After: collapsed stack with +3
4 running workflows / stack tapped (no stack on base; same as at rest) Desktop · 1440×900 Before: four full cards After: expanded cards with collapse row
1 workflow / phase detail open Desktop · 1440×900 Before: card opened via chevron After: card opened with collapse row
4 running workflows / at rest Mobile · 390×844 Before: four full cards on mobile After: collapsed stack on mobile
4 running workflows / stack tapped (no stack on base; same as at rest) Mobile · 390×844 Before: four full cards on mobile After: expanded cards on mobile
1 workflow / phase detail open Mobile · 390×844 Before: card opened on mobile After: card opened with collapse row on mobile
  • Exercised in the dev app: expand/collapse of the stack and of a single card, focus moving to the collapse row and back, and a background-command shelf below the workflows.
  • Tests: ThreadDetailPromptArea.test.tsx (stack collapsed by default, expands, cards toggle independently, collapses, focus follows) and plugins/workflows/src/app.test.tsx (stack, +N, peek layers, collapse, single-card open/close with focus). Run in remote CI only.
  • Known tradeoff: on mobile the inline phase strip leaves less room, so workflow names truncate sooner than on base.
  • Not covered visually: the plugin banner (its runs reconcile against live agent threads, so it can't be seeded); covered by its tests.

BB-Thread: Collapse or stack elements

🤖 Generated with Claude Code

AGENT GENERATED

Two or more running workflows collapse into a stack whose front card shows
the newest run with a +N count; tapping it expands every card. A full-width
chevron row below the list (and inside an opened card) collapses again, with
focus following each toggle. Applies to Claude Code workflows and the
workflows plugin banner.

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
brsbl merged commit f6cd19a into main Oct 5, 2026
34 checks passed
@brsbl
brsbl deleted the bb/collapse-or-stack-elements-thr_e2uq3rv44u branch October 5, 2026 05:23
brsbl added a commit that referenced this pull request Oct 5, 2026
…nner (#4890)

## 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](https://github.com/user-attachments/assets/7c601af1-3b2b-4e9a-85f8-f2084c0623d0)
| ![After: no resting chevrons, +N pills in the X
column](https://github.com/user-attachments/assets/b1f3d965-405a-4342-80f9-d300a7895b81)
|
| To-dos / hovering the header | Desktop · 1440×1100 | ![Before: chevron
always
visible](https://github.com/user-attachments/assets/832e5b66-67ab-45dd-b3fd-cf33f9f9ab68)
| ![After: chevron appears on hover, aligned with the
X](https://github.com/user-attachments/assets/97dceab2-d2b6-4c25-b76a-0931fca4b31c)
|
| Changed files / hovering the right end of the row | Desktop ·
1440×1100 | ![Before: only the short label is
clickable](https://github.com/user-attachments/assets/dee41780-c894-4a14-9fb4-f781da3b8807)
| ![After: the whole row
highlights](https://github.com/user-attachments/assets/fe3d2df6-6208-4978-a2a9-05f115204ea2)
|
| Changed files / opened | Desktop · 1440×1100 | ![Before: opened via
rotating
chevron](https://github.com/user-attachments/assets/cc950479-8088-4656-962f-cddaed3fe3f4)
| ![After: opened with close
row](https://github.com/user-attachments/assets/a75e9e35-56fc-4789-8026-7466e2262844)
|
| All banners / at rest | Mobile · 390×844 | ![Before: banners on
mobile](https://github.com/user-attachments/assets/bc361b31-04f8-418b-8f50-65a3f13d72aa)
| ![After: banners on
mobile](https://github.com/user-attachments/assets/3095384b-c52d-4c50-a790-3dcb52368e75)
|
| Background commands / opened | Mobile · 390×844 | ![Before: opened via
chevron](https://github.com/user-attachments/assets/9d8212df-4aa3-4d3b-9ea2-578065d140f5)
| ![After: opened with close
row](https://github.com/user-attachments/assets/ca43cc8f-0dd2-4875-8d5d-6b9de203e33a)
|

- 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](https://brsbl.getbb.app/projects/proj_khiw2za95v/threads/thr_e2uq3rv44u)

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

> AGENT GENERATED


![final-bg-open-mobile](https://github.com/user-attachments/assets/a9d6e391-a79a-4fc9-af3c-83c705541657)

---------

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