Skip to content

Collapse pending approvals into a one-row strip above the composer - #3094

Merged
SawyerHood merged 3 commits into
mainfrom
bb/create-html-redesign-mockups-thr_kdzf43b37c
Sep 4, 2026
Merged

SawyerHood merged 3 commits into
mainfrom
bb/create-html-redesign-mockups-thr_kdzf43b37c

Conversation

@SawyerHood

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

The pending-approval banner above the composer claimed most of the viewport: a full-height command block, the same command repeated as a flattened "Action:" paragraph, and no way to get it out of the way without deciding. When a child thread asked for an approval, the parent's transcript was pushed up until the message that caused the request was no longer readable. The bridge's backtick-wrapped commands also leaked a literal backtick into the block.

What changed

apps/app/src/components/thread/pending-interactions/ThreadPendingInteractionBanner.tsx

  • Approvals and plan reviews now arrive collapsed as a one-row strip: attention dot, reason, first command line in mono, child-thread link, every decision button, and a chevron. The strip is fully actionable.
  • The full card opens on demand with a header row, the reason, the subject body, and Deny on the left. Esc collapses an open approval or plan-review card.
  • Open state is keyed by interaction id, so it never carries over to the next request.
  • Command previews cap at four lines with a "Show N more lines" control. The working directory sits under the preview. The "Action:" line that repeated the whole script is dropped, and backtick-wrapped commands are unwrapped.
  • Decisions are ordered Deny, Allow for session, Allow once. The strip uses the compact PromptBannerActionButton the context banner already uses; the card keeps the full-size buttons.
  • User questions still open by default because answering needs the form, but they get the same header and collapse control. Plugin-defined requests are unchanged.

Stories gained a multi-line child-thread script row. No wire, CLI, or SDK changes.

How you verified

  • ThreadPendingInteractionBanner.test.tsx: 12 tests pass, five new. They cover the collapsed default and deciding from the strip, the four-line preview and dropped "Action:" duplicate, Esc and the per-request reset, the child-thread link in both states, and the user-question default. The collapsed-default and no-duplicate assertions fail on main.
  • pnpm exec turbo run typecheck lint test --filter=@bb/app: clean (479 files, 3905 tests).
  • Ladle: every approval story rendered collapsed and expanded in dark mode.
  • Dev app: spawned an acp-cursor thread in accept-edits mode that requested a real out-of-allowlist command. The strip rendered at 38px, the chevron opened the card, Esc collapsed it, and Allow once from the strip resolved the interaction server-side; Cursor ran the command and the thread went idle.

AGENT GENERATED

SawyerHood and others added 3 commits September 4, 2026 23:24
Approvals and plan reviews now arrive as a single actionable row with the
reason, first command line, source thread, and every decision. The full
card opens on demand and Esc collapses it. Command previews cap at four
lines, the duplicated Action: line is gone, and backtick-wrapped commands
are unwrapped.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…th, restore toggle focus

Collapsing a user question no longer discards draft answers because the
card body stays mounted and is only hidden. The strip wraps based on the
banner's own width instead of the viewport so narrow panes keep every
decision reachable. The disclosure button keeps focus across toggles and
after Escape, and the child-thread link is always visible in the strip.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
The user-question form stays mounted when collapsed so drafts survive,
but its questionOpen context and numeric select handlers now follow the
banner's expanded state, so hidden questions no longer consume keystrokes.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@SawyerHood
SawyerHood merged commit df3f4ea into main Sep 4, 2026
16 checks passed
@SawyerHood
SawyerHood deleted the bb/create-html-redesign-mockups-thr_kdzf43b37c branch September 4, 2026 23:56
ymichael pushed a commit that referenced this pull request Oct 8, 2026
## Human comments

Small change, I think it's definitely a mistake that you need to expand
first before you can take an action.

<img width="1120" height="122" alt="image"
src="https://github.com/user-attachments/assets/c3124477-b730-443f-a2c6-1eaac5808606"
/>

## What was wrong

A pending approval (command, file edit, or tool use) arrived above the
composer as a collapsed row that only said "Approval needed". That row
has no decision buttons, so every approval cost a click before you could
read what was being asked or answer it. Questions, plugin forms, and
plan reviews (since #4929) already arrived open, so approvals were the
only request card that started collapsed.

#3094 introduced the collapsed strip with every decision button on it,
so it was fully actionable. #3147 moved the decisions into the expanded
card to keep the compact row on a single line on mobile, which turned
the collapsed default into an extra step with nothing to do on it.

## What changed

- Approvals now arrive open with the command preview and the decision
buttons, like every other pending interaction card.
- With every caller opening on arrival, `PendingInteractionShell` drops
its `initiallyExpanded` prop and always starts open. A request card is
only collapsed when you collapse it, and new request types cannot come
back collapsed by default.
- The chevron, the title, and Esc still collapse the card. The next
request arrives open again.

No wire, CLI, or SDK changes.

## How you verified

- `ThreadPendingInteractionBanner.test.tsx`: the approval tests now
start from the open card. They cover the open default, deciding without
expanding first, collapsing to the label-only row and reopening, Esc,
and a new request arriving open after the previous one was collapsed.
Against main's banner, 7 of these 16 tests fail.
- `pnpm exec turbo run typecheck lint test --filter=@bb/app`: clean
(5639 tests).
- Ladle, Approval / Compact Permissions story at 1280 px and 390 px:
main shows two label-only "Approval needed" rows; this branch shows both
cards open with Deny / Allow for session / Allow once.
- `pnpm start:worktree` with a real Claude Code approval (`curl` outside
the sandbox): the card arrives open with the command and decisions on
desktop and mobile.

> AGENT GENERATED

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

---------

Co-authored-by: qa <qa@x>
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