Skip to content

Open Plan approval forms automatically - #4929

Merged
ymichael merged 1 commit into
mainfrom
bb/expand-plan-approval-thr_88iux8zkcc
Oct 5, 2026
Merged

ymichael merged 1 commit into
mainfrom
bb/expand-plan-approval-thr_88iux8zkcc

Conversation

@ymichael

@ymichael ymichael commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

Plan approval cards started collapsed, hiding both the plan and the decision buttons. A thread could be waiting for approval while showing only a small “Plan review” strip above the composer.

What changed

Open Plan approval cards automatically, matching the existing question behavior. Users can still collapse the card, and each new plan request starts expanded. Ordinary command approvals retain their current collapsed default. No CLI, SDK, server/daemon wire, or protocol changes.

How you verified

The expanded-default and next-plan regression tests fail on origin/main before the fix and pass afterward. pnpm exec turbo run test --filter=@bb/app -- src/components/thread/pending-interactions passes all 17 tests; app lint and typecheck pass (lint has existing warnings).

In an isolated built BB app, use real Claude Code to request a Plan approval. The base build shows the collapsed strip; the changed build opens the plan and decisions automatically. Browser checks cover manual collapse/reopen and a compact viewport; clicking Approve plan resolves the actual server interaction and Claude replies APPROVED. A fresh pending plan is retained privately for review. Matching before/after captures use the same prompt and viewport in separate real threads because stopping the base server cancelled its pending interaction.

The first CI run exposed a workspace route budget overage also reproduced on unchanged main: both builds contained exactly 1,087,984 raw bytes, 120 over the prior limit. Main subsequently fixed that budget in #4933. This PR is rebased onto that fix and contains only the two Plan UI files; no separate budget allowance remains. The local bundle check passes with unchanged payload. Final-head checks: 30 passed, 0 failed, 3 skipped; only the contributor gate remains queued waiting for a GitHub runner (requeued once).

AGENT GENERATED

@ymichael
ymichael force-pushed the bb/expand-plan-approval-thr_88iux8zkcc branch from 472c5a2 to a51f78d Compare October 5, 2026 19:37
@ymichael
ymichael force-pushed the bb/expand-plan-approval-thr_88iux8zkcc branch from a51f78d to 8aff221 Compare October 5, 2026 19:43
@ymichael
ymichael merged commit 0bd81a2 into main Oct 5, 2026
34 of 35 checks passed
@ymichael
ymichael deleted the bb/expand-plan-approval-thr_88iux8zkcc branch October 5, 2026 20:09
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