Skip to content

Show active child threads as rows and unfold the rest from a count chip - #6009

Closed
alexandre-vl wants to merge 6 commits into
get-bb:mainfrom
alexandre-vl:bb/child-threads-card-thr_mwgsr32qtd
Closed

alexandre-vl wants to merge 6 commits into
get-bb:mainfrom
alexandre-vl:bb/child-threads-card-thr_mwgsr32qtd

Conversation

@alexandre-vl

Copy link
Copy Markdown
Contributor

Human comments

What was wrong

The active child threads card above the composer has the problems #6007 fixes for background commands. On main (b143a2286), apps/app/src/components/promptbox/banner/ThreadPromptContextBanner.tsx gives it a header that reads "Active child threads" next to a count pill (:1138, :1141), so even with a single child you have to open the card to see which child is running. The prompt stack is anchored to the composer, so opening the card grows it upward. The header you clicked jumps 94 px, or 106 px on a phone, and the separate collapse row lands under the pointer (:1179-1186). When a child waits on you, the header shows its question, but clicking the header only opens the list (:1112, from #5423). Answering takes a second click on the same question in the list.

What changed

Before (main)After
Before: the header shows the waiting child's question and a 3 pillAfter: the waiting child's row and a 3 chip with a chevron
Before, open: the header moved up, rows below it, a chevron row to closeAfter, open: the other children above, the waiting child's row stays where it was
Before: clicking the header pushes it up; closing takes the chevron rowAfter: the chip unfolds the others above and folds them back from the same place
Before, one child: Active child threads 1
Before, one child, open: the child's title appears only now
After, one child: its row, which opens it
Before, 390 px touch Before, 390 px touch, openAfter, 390 px touch After, 390 px touch, open

A source dev instance with Claude Code child threads: two run sleep and one waits on a question. A second parent has a single working child. Chromium at 2x: 1280×800, then a 390×844 touch viewport.

Answering from the folded card, and the dark theme After: one click on the waiting row opens its question; Cancel returns to the list; the chip folds it After: the question opened from the folded card After, dark, open
  • The card is now the rows themselves. Each child is one row:
    • a spinner while it works;
    • a question mark and "child: question" while it waits on you.
  • The first child is always visible. Waiting children still come first.
  • With two or more children, a count chip with a chevron (3 ⌃) ends the first row. It unfolds the others above it, so the next most relevant child sits right above the visible row. The chip stays put and folds the list back.
  • A single child is a plain row that opens it.
  • A waiting child's row opens its question, even when the card is folded. This takes one click instead of two.
  • Answer child thread questions inside the banner #5423 had the header only open the list because the header was also the toggle. Now the rows don't toggle; the chip does.
  • The question view is unchanged: "‹ Active child threads", the stepper, Cancel and Esc work as before. Going back shows the unfolded list.
  • More than five unfolded rows scroll inside max-h-40, as on main. The list opens scrolled to the rows next to the chip.
  • Motion matches Show every background command's duration and fold them from the row you clicked #6007:
    • the list is revealed from its bottom edge;
    • rows fade in 40 ms apart;
    • prefers-reduced-motion turns the transitions off.
  • Rows mount on the first open and are dropped once fewer than two children remain.
  • Accessibility:
    • the chip is a button labelled "3 active child threads", with aria-expanded and aria-controls;
    • the rows are links and buttons in on-screen order;
    • keyboard focus draws an inset ring.
  • The card uses the same chrome as the background-commands card in Show every background command's duration and fold them from the row you clicked #6007, so the two cards above the composer look alike.

Files:

  • apps/app/src/components/promptbox/banner/ThreadPromptContextBanner.tsx:
    • ChildThreadRow replaces ChildThreadsBody;
    • ActiveChildThreadsCard renders the rows, the chip and the question view;
    • the child-threads section ids are gone, along with the collapse row and the count slot.
  • apps/app/src/components/promptbox/banner/ThreadPromptContextBanner.test.tsx and ThreadPromptContextBanner.child-questions.test.tsx: tests for the rows, the chip and its order, the one-click question, and where focus lands after the last answer.
  • apps/app/src/components/promptbox/banner/ThreadPromptContextBanner.stories.tsx: story hints.
  • No wire, SDK, CLI or setting change.

Stacked on #6007. The first two commits belong to #6007, and this PR is the last commit (compare).

How you verified

  • pnpm exec turbo run typecheck lint test --filter=@bb/app: passes. 6242 tests pass (4 skipped) across 647 files. Lint reports 0 errors and 248 warnings, down from 252.

  • Six of the changed tests fail against main's banner and pass here:

    • the single-child row;
    • the question kept on the visible row;
    • the waiting child's row after remounts;
    • the chip's unfold and row order;
    • the one-click question;
    • focus after the last answer.

    The two other changed tests pass on both: auto-expanding on a new question, and hiding the stepper and the toggle while a question is open.

  • Screenshots: a source dev instance (pnpm dev) with a fresh data directory, and real Claude Code (Haiku 5.5) child threads. Chromium was driven through dev-browser. The GIFs come from a CDP screencast.

  • Geometry, measured in Chromium:

    • On main, the header's top moves from 598 px to 504 px with three children and to 548 px with one. On a 390×844 touch viewport it moves from 736 px to 630 px.
    • Here, the chip moves from 598 px to 599 px at 1280×800; the 1 px comes from the composer's elastic height. It stays at 737 px on 390×844.
  • Not checked: Safari/WebKit, the iOS app, a screen reader.

AGENT GENERATED

…ou clicked

Each background command is one row with its live duration. With two or
more, the newest row is the toggle: older commands open above it, oldest
first, and the same row folds them back, so it never moves under the
pointer in the bottom-anchored prompt stack. The expanded state is per
thread and folds back below two commands.
Older rows tick only while unfolded and are dropped once fewer than two
commands run. The card is keyed by thread and its open state resets on a
thread switch. The list reveals from its bottom edge, the toggle's label
keeps a background agent's model, and keyboard focus draws an inset ring
inside the card.
The first child's row is always visible and opens the child, or its
question when it waits on you. With more children, a count chip at the
end of that row unfolds the others above it and folds them back from the
same place. A single child is a plain row.
Upstream get-bb#6023 moved active child threads out of the context banner into
ThreadChildThreadsBanner, a core row above the thread context segments,
and the pull request segment and its tests into the GitHub PR Status
plugin. ThreadChildThreadsBanner still renders ActiveChildThreadsCard, so
the rows and the count chip carry over as they are: the import takes
main's version without AnimatedBody, and the banner tests keep main's
Banner harness with this branch's expectations.
# Conflicts:
#	apps/app/src/components/promptbox/banner/AnimatedBody.test.tsx
#	apps/app/src/components/promptbox/banner/ThreadBackgroundCommandsCard.test.tsx
#	apps/app/src/components/promptbox/banner/ThreadBackgroundCommandsCard.tsx
#	apps/app/src/views/thread-detail/ThreadDetailPromptArea.test.tsx
…s-card-thr_mwgsr32qtd

# Conflicts:
#	apps/app/src/components/promptbox/banner/ThreadPromptContextBanner.tsx
@github-actions github-actions Bot closed this Nov 4, 2026
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

This is an automated message. We have closed this pull request because it has been open for more than two weeks.

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