Skip to content

feat(chat): redesign the tool-approval card and Trust menu - #36150

Open
kyleseaman wants to merge 2 commits into
mainfrom
feat/approval-card-redesign
Open

kyleseaman wants to merge 2 commits into
mainfrom
feat/approval-card-redesign

Conversation

@kyleseaman

@kyleseaman kyleseaman commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: The chat approval card says in plain words what the agent is asking for, and its Trust menu offers one row per scope under a single duration choice.

Today the card opens with a lock icon and a monospace tool label. The Trust menu prints the whole command three times (this session, an hour, until midnight) and the command family three more, so for a long command the menu fills the window and the real choice, how wide and how long, is hard to find. "Trust all tools" is one click, the same as the narrowest grant. Only a timed grant leaves a line saying what was granted.

Why it matters

The approval card is where a person consents to what an agent runs. A card that is hard to read gets answered by reflex, and the widest grant sits one click away from the narrowest.

Not a goal

What changed (motivation → approach → change)

The card now reads top to bottom as: what state it is in, what is being asked, what kind of request it is, the exact command, then three controls.

Part Before After
Header lock icon status pill: Waiting for approval, then Approved or Rejected
Title tool label in mono with simplified tool names on, the agent's own description when the approval carries one; otherwise the same label, in the body font
Kind none "Shell command" or "MCP tool · server" chip, plus "Read-only"
Command in the menu rows, repeated once, whole, in a code box on the card
Buttons Allow once, Trust, Reject, all equal Reject, Trust, Allow once; Allow once is filled
Trust menu one row per scope and lifetime a duration choice (1 hour, Until midnight, This session) over one row per scope
All tools one click two clicks
After a decision a line for timed grants only one line for every decision: what was granted and when it ends
Transcript row out of view a mirror of the tool row slid into the bar the card stays the same; it rounds fully, drops the approval-mode hint and offers Show in chat

The exact-command grant is a string match, and its row now reads "This exact command" instead of printing the string. So the string has to stay readable while the menu is open: the menu measures where the card's command box starts and opens above it (keepClear in website/src/components/TrustDropdown.tsx). The capture script measures the two boxes and reports no overlap in both scenes and both themes.

The duration applies to the command and family rows only, because only those grants record a lifetime. The read-only and all-tools rows last the session and say so on the row.

Where the pieces live:

  • website/src/components/chat-input/ToolApprovalCard.tsx (new) draws the card and the receipt. website/src/components/ChatInput.tsx mounts it and loses about 120 lines.
  • website/src/components/chat-input/approval.ts picks the title and writes the receipt line. A standing grant's line clears when the composer moves to another session.
  • website/src/components/TrustDropdown.tsx keeps the plain menu for channels and adds the timed menu for chat.
  • website/src/components/ui/dropdown-menu.tsx gains a segmented radio group, so the duration choice is reachable with the arrow keys like any menu row.
  • website/src/pages/chat/composerFocus.ts: the focus-approval chord lands on Allow once. It used to land on the row's first button, which is now Reject.
  • website/src/i18n: 30 new catalog keys in all 12 languages with translator notes, and six retired.
  • docs/system-specs/modules/messaging.md describes the new card.
  • website/capture/approval-card-redesign.tsx and its shoot script render the real composer in each state.

After the rebase onto main, the card also carries #35002's "Always allow this tool" row in the timed menu. It sits with the rows the duration does not cover, sends the same always_allow_tool call with the server's ref as on main, and a refused grant shows disabled with its reason.

Review fixes on top (second commit):

  • GPT 6.1: the Trust menu is keyed per session, approval and row, like Reject, so an armed all-tools confirmation or a chosen duration never carries over to another session's card.
  • Opus 5.5: an MCP card shows the tool's own name (tool_name from the gateway's identity) in a mono chip beside the server, because the heading may be the agent's description. The heading follows the simplified-names setting again instead of always using the description.
  • UX notes: a rule under the command and family rows, then an "Until this chat ends" heading (new key session_rows_label, all 12 languages) over the read-only and all-tools rows, show that the duration covers only the command and family rows. The always-allow row sits above that heading, since it lasts until removed in settings. An override card no longer repeats its refused command as the call payload; the warning shows it once. The duration_session translator note says the grant never carries over to another chat. New frames show the lone all-tools control armed, the menu with the always-allow row, the override card and the Show in chat chip.
  • UX notes not taken, with the reason: the disabled Trust button keeps its reason in the trust_unavailable tooltip, because base deliberately shows no extra line on that card (ChatInput.approval.test.tsx asserts it); "Reject all" wording is the Reject menu, which this PR leaves unchanged (Not a goal).
  • Local GPT review: a non-shell grant is keyed on the tool, and for a file write on its one file (path_trust_key), whatever the call's other arguments, so "This exact call" overstated how narrow it is. That row now prints the server's own scope label (full_command, for example fs_write /work/config.json) with its lifetime, as the plain menu does. The three scope_call_* values become <mono/> — <lifetime> in every language. The payload is unchanged: trust_command with that same string.
  • Design note: a test pins that the command box still renders under a description heading.

UX review on 649dfc8 (BLOCK), point by point:

  • Blocker, card-to-receipt hard swap: the receipt now mounts in the card's own place, and the card's status pill and the receipt's share a framer-motion layout id per slot (approvalPillLayoutId in ToolApprovalCard.tsx). On a decision the pill moves into the receipt and turns into Approved or Rejected while the rest of the card fades. The card's exit, the pill's move and the receipt's entry share one slow eased fade (0.45 s, no spring, no clip); under prefers-reduced-motion the card and receipt swap at once with no animation (ChatInput.approvalTrust.test.tsx covers both paths). Recordings below.
  • Evidence gap, arming the lone all-tools control: recorded below.
  • Note, two meanings of "always": the heading is now "Until this chat ends" in all 12 languages; its translator note forbids the word.
  • Note, armed button grows: the lone control reserves the armed label's width (the other label drawn from a data-reserve attribute in the same grid cell, not in the text), so the second click lands where the first did. TrustDropdown.test.tsx checks it.
  • CI's restyle ratchet: the heading is a plain line like the Duration label, not a restyled DropdownMenuLabel; TrustDropdown.tsx is back at its baseline count.

KiroCrewCaptain's comment on 95738d7 (no blocking finding), optional points:

  • Button order: left as is; it is for the maintainer's design sign-off on Chat approval card: say what is being asked, one Trust row per scope with a duration, and a receipt after the decision #36134.
  • Three guards had no failing test. Each now does, proven by deleting only that guard and watching the test fail: the shownSlot check in finish() (a late slot-1 reply leaves slot-2's notice in place), the notice clear in the slot cleanup effect (a standing grant's receipt does not come back when the composer returns to its session), and the Trust menu key (an armed "All tools" row does not carry over to the next request in the same session). None was unneeded.
  • tool_purpose wording: the spec (messaging.md) and the comment above approvalDescription now say it heads the card only with simplified tool names on; "as on main" is gone from the spec sentence.

Opus 5.5 on eed37ae (BLOCK, fixed): a standing grant's receipt and the next card's pill held the same shared layout id, so the receipt lost its verdict pill and the new pill flew out of it. Invariant now: a card, its pill or a receipt never shows against another request or another session.

  • The shared layout id is keyed on the slot and the request (approval id and row); the receipt carries the id of the request it answered.
  • The receipt records the slot it was made in and shows only over that slot's composer.
  • A one-shot receipt is skipped when this tab's own resolve frame has already moved the card to the slot's next request before the reply lands.
  • The card's and the receipt's presences are keyed on the slot, so a session switch drops the last session's card and receipt in the same render instead of fading them over the new composer.

Each has a test in ChatInput.approvalTrust.test.tsx that fails without its fix.

KiroCrewCaptain's comment on 370f210 (no blocking finding), optional points:

  • No test for the session-switch guard or the downgrade receipt: ChatInput.approvalTrust.test.tsx now holds a grant on a deferred promise, switches to slot-2, resolves it and asserts no receipt shows; and drives trust for a coordinator request, asserting it is sent as a one-shot approve whose receipt says "Allowed once". Each fails with its guard removed.
  • The disarm comment in TrustDropdown.tsx: now names what disarms the all-tools row (choosing a duration or closing the menu; for the lone control, leaving it or Escape).
  • Width of the lone all-tools control: the capture script logs its measured width, idle and armed: 351px and 351px in both themes.

KiroCrewCaptain's review on 649dfc8 (CHANGES_REQUESTED), point by point:

  • Restyle ratchet red: fixed on 8c484aa and on this head; the heading is a plain line and TrustDropdown.tsx is back at its baseline count of 2.
  • UX blocker open on that head: the shared pill, reserved width and "Until this chat ends" heading were committed locally but not yet pushed when that review ran. They are in 8c484aa and this head, and the recordings were taken from that code.
  • Optional, duplicate fixtures: ChatInput.approval.test.tsx now only imports them from approvalCardFixtures.tsx (1,313 lines).
  • Optional, stale comment at approval.ts on the transcript-row subscription: rewritten to say what the card does when the row scrolls out of view, and the Before/After table has a row for it.
  • Optional, menu lift untested: website/src/test/TrustDropdown.lift.test.tsx stubs getBoundingClientRect and checks sideOffset is the distance from the command box's top to the trigger's, plus 4, and 4 when there is nothing to clear. It fails with the lift removed.

KiroCrewCaptain's review (CHANGES_REQUESTED on 7500f41), point by point:

  • Required, no frame of the override card or Show in chat: the capture now has an override scene (deny-override meta) and a ghost scene (no registered stand-in pill), with light and dark frames below.
  • Required, override card repeats its refused command: the card's payload box now drops the entry that is the refused command, as it does for the command box, so the warning states it once. ChatInput.denyOverride.test.tsx checks that an override card renders no approval-input. This is the one intended change to what the card displays; nothing sent to the backend changes. The box drops only the command field (the one the gateway reads the command from), and only when it is the string shown: a field whose value happens to equal the command, such as cwd: "make" beside make, stays, and shell input the card cannot split shows as it came (both tested).
  • Optional, button order: kept as Reject, Trust, Allow once, the order this redesign chose; the maintainer design sign-off pending on Chat approval card: say what is being asked, one Trust row per scope with a duration, and a receipt after the decision #36134 decides it.
  • Optional, receipt comment: corrected. A standing grant's line outlives the next card but still clears after the usual 8 seconds.
  • Optional, no receipt for always_allow_tool or the deny-override decisions: unchanged, as on main, which shows none for them; adding them would mean new copy outside this PR's grants.
  • Optional, test file size: the Trust-menu and receipt tests move to website/src/test/ChatInput.approvalTrust.test.tsx, with shared fixtures in website/src/test/approvalCardFixtures.tsx. ChatInput.approval.test.tsx is 1,387 lines.

Three places differ from the mockup on purpose. Trust stays as a disabled button when no grant can be recorded, so the row keeps its order. An MCP call with arguments shows one "Trust all tools for this session" control, because the server offers no exact-call grant for it. The duration label reads "Duration", not "For", because a bare preposition fails the catalog's sentence-fragment check.

Backwards compatibility

Compatible: every grant, its visibility rule, the onAction calls and the ttl_seconds values are the ones on main; only the labels and layout change. TrustDropdown without timedGrants renders the menu it renders today.

Reader: website/src/components/TrustDropdown.tsx:COMMAND_SCOPE_KEYS -- chat -- the only reader of the six retired trust_this_command_* / trust_all_base_* timed keys now reads the scope_* keys; src/i18n/deadKeys.test.ts and check-i18n-keys.mjs pass

Tests

  • website/src/test/ChatInput.approval.test.tsx: the title falls back to the label when the approval carries no description; the kind and Read-only chips; the whole command stays on the card, whitespace intact, while the menu is open, and the exact-command row is described by it; extra shell input (a working directory) still shows; each Trust row sends the same request as before, with and without ttl_seconds; all tools sends nothing on the first click; every decision leaves its receipt; a one-shot receipt gives way to the next card and a standing one does not; a standing receipt does not follow the composer into another session (red without the fix); the row order and the three-control cap.
  • website/src/test/ChatInput.approvalTrust.test.tsx and ChatInput.approval.test.tsx (review fixes): the tool-name chip and the simplified-names setting; an armed all-tools row does not survive a switch to another session's card; the until-midnight row sends the seconds left in the day (pinned clock); the always-allow row sends @server/tool as its pattern, and a refused one is disabled and sends nothing; the separator sits under the timed rows.
  • website/src/test/TrustDropdown.test.tsx: the timed menu's duration choice and rows, which rows take the lifetime, the second click, what resets when the menu closes, and that the plain menu is unchanged.
  • website/src/test/approvalFocusShortcut.test.tsx: the chord lands on the primary control and on nothing while it is disabled.

Determinism: the three files passed 10 of 10 repeats and one run with tests and files shuffled (--sequence.seed=36134), 183 tests each.

Local gates on this head: tsc, eslint, i18n:check, phantom classes, restyle ratchet, jscpd, UI index, line cap, docs lint, semgrep on the diff, and the 632 change-related frontend test files (16,319 tests) pass. Not run locally: the production build, bundle size, i18n:render, the Electron suite and backend tests.

Pushed head ae329651be2a8d84469a34cf57273cf5fcd5cd0b: local gates on it after the rebase (tsc, i18n:check, restyle ratchet, the ChatInput, TrustDropdown, approval and i18n test files (180 files / 2,640 tests)) pass; the full prepush gate and a local GPT 6.1 review passed on the identical patch before the rebase.

Manual verification

Rendered the real composer against the built stylesheet in each of the five states, opened both menus, armed the all-tools row, and took a timed grant and a rejection through to their receipts, in a light and a dark theme (node capture/shoot-approval-card-redesign.mjs from website/). Not done: a run against a live gateway with an agent parked on an approval, and a narrow-viewport pass.

Screenshots / video

Five states, both menus and both receipts, light then dark:

Light theme: five card states, Trust and Reject menus, receipts

Dark theme: five card states, Trust and Reject menus, receipts

The Trust menu as it opens, clear of the command:

Trust menu open above the command box, light

One hour chosen and the all-tools row armed by its first click:

Trust menu with 1 hour chosen and All tools armed, dark

Review fixes, light then dark. The MCP card names the tool beside its server:

MCP card with tool name chip, light

MCP card with tool name chip, dark

The lone all-tools control after its first click:

Lone all-tools control armed, light

Lone all-tools control armed, dark

The Trust menu with the "Always allow this tool" row:

Trust menu with Always allow this tool, light

Trust menu with Always allow this tool, dark

A rule under the rows the duration covers:

Trust menu with separator under timed rows, light

Trust menu with separator under timed rows, dark

UX polish round: the session-long rows under their own heading, the override card, and the Show in chat chip:

Trust menu with session heading, light

Trust menu with 1 hour chosen and All tools armed, dark

Override card, light

Override card, dark

Show in chat state, light

Show in chat state, dark

Recordings: Allow once, Reject once, and arming the lone all-tools control (light, then dark):

rec-allow-once-light.webm
rec-allow-once-dark.webm
rec-reject-once-light.webm
rec-reject-once-dark.webm
rec-all-tools-arm-light.webm
rec-all-tools-arm-dark.webm

The Trust menu with the "Until this chat ends" heading, and the lone all-tools control armed at its reserved width:

menu-trust-light

menu-trust-dark

state-mcp-armed-light

state-mcp-armed-dark

More frames

Shell command card, light

Shell command card, dark

MCP tool card, light

Trust unavailable, light

Trust menu for a read-only command, light

Reject menu, light

Receipt after a timed grant, light

Receipt after a rejection, dark

Related Issues

Closes #36134

#35002 (Always allow this tool) has merged and is folded in above. #26416 adds a row to the same menu and will need a rebase after this one, or the reverse.

Checklist

  • At most two commits (the redesign, then the review fixes), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@kyleseaman
kyleseaman requested review from a team and KiroCrewCaptain as code owners November 12, 2026 22:46
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 12, 2026
@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of ae329651be2a8d84469a34cf57273cf5fcd5cd0b and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] ae32965

False positive or not applicable? A repository writer can comment:
/ai-review override gpt ae329651be2a8d84469a34cf57273cf5fcd5cd0b false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of ae329651be2a8d84469a34cf57273cf5fcd5cd0b — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

No design-level concerns. The redesign keeps every grant and its payload, the six retired Trust keys have no remaining readers, and the description attaches rendered evidence for this revision.

Notes

[DESIGN-REVIEWED] ae32965

Description read

[DESCRIPTION-READ] b48c01b5fc6cb511029d734e5580ba2c06cad081c1fdb9397ccfaa35a3f0aa34

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of ae329651be2a8d84469a34cf57273cf5fcd5cd0b — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

The button reorder and the out-of-view card change go beyond the Goal and have no named user who was failing. Both are reversible UI changes, so they are notes and not blockers.

Notes

  • Item 5, unjustified move: Allow once, Trust, Reject became Reject, Trust, Allow once. The diff rewrites the Tool approval bar button layout differs between main and subagent requests, shifting Approve and risking accidental Trust #34971 pin toEqual(['Allow once', 'Trust', 'Reject']) and gives only "one reflex click from Allow once" as the reason, with no report of anyone misclicking. The description defers the order to "the maintainer's design sign-off on Chat approval card: say what is being asked, one Trust row per scope with a duration, and a receipt after the decision #36134". Subtraction: keep the base order and move only the filled style.
  • Item 9, oversized: the out-of-view card swaps "a mirror of the tool row slid into the bar" for a Show in chat chip. The Goal (plain wording, one Trust row per scope) does not ask for this. Subtraction: drop that change from ToolApprovalCard.tsx and keep the base mirror. Clears when: the mechanism is removed, or a human amends the Goal.
  • Item 10, one consumer, generalized: the new DropdownMenuRadioSegments and the segment prop in ui/dropdown-menu.tsx have exactly 1 consumer (TrustDropdown.tsx:1106; grepped DropdownMenuRadioSegments). Subtraction: use the existing DropdownMenuRadioGroup with a className in TrustDropdown.tsx.

What this change ships

Inventory (10 items) — 6 justified

Intent: let a person see plainly what the agent asks to run, and pick how wide and how long to trust it without hunting through a long menu. ADDITION.

  1. Card heading shows the agent's description or tool label in the body font, with a kind chip — justified
  2. The whole command shows once, in a box on the card, not repeated in menu rows — justified
  3. Trust menu: one duration choice above one row per scope — justified
  4. "All tools" needs a second click — justified
  5. Button order reversed; Allow once is the filled button — unjustified move
  6. A receipt line after every decision, not only timed grants — justified
  7. Status pill animates into the receipt — oversized
  8. The focus chord lands on Allow once — justified
  9. Out-of-view card: the row mirror is replaced by a Show in chat chip — oversized
  10. New segmented radio primitive in the shared dropdown — one consumer, generalized

[FIRST-PRINCIPLES-REVIEWED] ae32965

Description read

[DESCRIPTION-READ] 8d4eb9032d02027ec272b3844cc18c788e467948fb7d549a57c6549caeaf5ae9

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

UX-level review of ae329651be2a8d84469a34cf57273cf5fcd5cd0b — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

UX-Verdict: PASS

No blockers. The blind reader correctly identified Allow once, the Trust rows and the duration choice. Four recordings cover the card-to-receipt change.

Notes

  • The session_rows_label heading "Until this chat ends" sits above rows that already end "— for this session". The heading repeats the rows and adds a second word for the same thing. The blind reader said: "Now I'm unsure whether 'session' and 'chat' are the same thing." Either drop the heading and keep the divider, or name it "This session only" and remove the row suffixes.
  • On the override card (shot-15), "Reject ▾" moves to the right and "Choose how to allow ▾" comes first. Everywhere else Reject sits on the left. The reader noticed the flip, so a user who has learned where Reject is will reach for the wrong button. Keep Reject on the left on that card too.

[UX-REVIEWED] ae32965

Description read

[DESCRIPTION-READ] c57ae4721c21e0d0f901f5087e4710abc64a3c8a1ef9c12d8e058fbbf00ca5b5

That sha256 names everything this verdict read: the PR description, plus the 33 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — 🔴 changes requested (blocking)

Reviewed ae329651be2a8d84469a34cf57273cf5fcd5cd0b — this comment is updated in place on each push.

One blocking finding: the Trust menu's "This exact command" grant now relies on a command box that can hide the end of the command, and nothing on screen says the box scrolls.

BLOCKING — website/src/components/chat-input/ToolApprovalCard.tsx:1410
<pre ref={commandRef} ... data-testid="approval-command" className="m-0 flex-1 min-w-0 max-h-[30vh] overflow-y-auto whitespace-pre-wrap break-all font-mono text-text">{command}</pre> with TrustDropdown.tsx:1029 ) : <span className="min-w-0">{i18nT(COMMAND_SCOPE_KEYS[lifetime])}</span>,
Trigger: the agent sends a shell command taller than 30vh, such as a heredoc file write or a command padded with blank lines in front of a trailing ; curl … | sh. useToolApproval → ToolApprovalCard shows it in this capped box. The TimedTrustMenu command row now prints only "This exact command — …", where the old row printed the whole fullCommand with no limit. Choosing that row calls onAction('trust_command', fullCommand, …).
Outcome: the scrollbar is hidden at rest and the box has no edge-fade or "more below" cue. A clean cut at a newline therefore looks like the whole command. The user grants a lasting exact-string trust for text they never saw, from an untrusted agent.
Anchor: no-scrollbar-at-rest
Fix: give the command box a scroll cue (useScrollEdgesY + MORE_BELOW_MASK, or a "more below" affordance). Or, when the box overflows (scrollHeight > clientHeight), print the full command in the exact-command row again.

[BLOCK-MERGE] ae32965
[OPUS-REVIEWED] ae32965

Verdict parsed from the review's SHA-scoped output markers for commit ae329651be2a8d84469a34cf57273cf5fcd5cd0b.

False positive or not applicable? A repository writer can comment:
/ai-review override fable ae329651be2a8d84469a34cf57273cf5fcd5cd0b false-positive: <reason, 20 to 500 characters>

@github-actions github-actions Bot added merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 13, 2026
@kyleseaman

Copy link
Copy Markdown
Contributor Author

Screenshots for the review-fix commit (frontend-only capture harness, node capture/shoot-approval-card-redesign.mjs from website/), light then dark:

MCP card: the tool's own name beside its server, under the agent's description.
MCP card with tool name chip, light
MCP card with tool name chip, dark

The lone all-tools control after its first click.
Lone all-tools control armed, light
Lone all-tools control armed, dark

Trust menu with the "Always allow this tool" row from #35002.
Trust menu with Always allow this tool, light
Trust menu with Always allow this tool, dark

Trust menu for a read-only command: a rule under the two rows the duration covers.
Trust menu with separator under timed rows, light
Trust menu with separator under timed rows, dark

@kyleseaman
kyleseaman force-pushed the feat/approval-card-redesign branch from 91c26c4 to 7500f41 Compare November 17, 2026 16:33
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running labels Nov 17, 2026
@KiroCrewCaptain

Copy link
Copy Markdown
Collaborator

Code change approver recommendation: A person should decide

Why: the decider estimates a 12% chance that this change introduces a defect, within the 12% limit for approving on its own, but it changes 2494 lines, more than the 400 it may approve on its own.

This is a UI redesign of the chat approval card and its Trust menu. I checked the grant payloads against main: the same actions, the same patterns, and ttl_seconds only for the hour and today choices. The unattended and coordinator downgrade still holds. The plain menu used by channels is unchanged, and the retired translation keys have no remaining readers. I also checked the state lifecycle: the menu is keyed per session and approval and resets when closed, and receipts are scoped to their session and clear themselves. The focus chord's fallbacks behave as before, and the override card is unaffected. The tests cover each of these behaviours, and CI is fully green. What remains is a minor over-claim in the description and doc drift, both non-blocking.

Tier: 2, held for a person: reviewer-finding: UX Review.

An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit 7500f41ce4 · 2494 changed lines. If this recommendation is wrong, reply here: replies are how the approver is evaluated.

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the careful redesign. One gap has to close before this can go further.

  1. No frame of the rule-override card or the "Show in chat" state (website/src/components/chat-input/ToolApprovalCard.tsx:184, :139-150). The UX review on this head says it cannot evaluate either state. None of the screenshots in the body or the later comment shows them, and the capture harness in website/capture/approval-card-redesign.tsx cannot render them. It has no deny-override scene, and lines 134-142 register a stand-in tool pill, so the card never reaches the ghost state that shows the chip. As things stand, both redrawn states would merge without anyone seeing them rendered. Smallest fix: add an override scene (deny_override meta) and a ghost scene (no registered pill, tool_call_id set), or reuse website/capture/deny-override-card.tsx. Then attach light and dark frames of both for this head so the UX lane can run again.
    While you are in there: on an override card, line 90 sets command to '', so the payload memo at line 98 returns the whole approvalToolInput. The card then prints the refused command in the payload box and again in DenyOverrideWarning, although the comment at line 89 says the warning is where the command is stated. Could the payload skip the command when approvalDenyRule is set, with a test that an override card renders no approval-input?

Once that is fixed, this still changes a card users already rely on, and the linked issue #36134 asks for a maintainer's design sign-off before merge. A maintainer will post that decision here.

Optional:

  • Allow once now sits where Reject used to be (the rightmost control). A user who clicks there out of habit to reject would run the call once. Keeping the old order and only filling Allow once would also make the composerFocus.ts change unnecessary.
  • The receipt comment in approval.ts (around line 408) says a standing grant's line keeps its full time, but the existing 8 second auto-dismiss still clears it. always_allow_tool and the deny-override decisions also get no receipt.
  • website/src/test/ChatInput.approval.test.tsx grows to 1651 lines. Moving the new Trust-menu and receipt blocks into a sibling file keeps it under the 1,600-line split point.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: passed Eligible automated validation passed for the current revision labels Nov 17, 2026
@kyleseaman

Copy link
Copy Markdown
Contributor Author

Screenshots for the UX polish round (frontend-only capture harness), light then dark:

The Trust menu: a rule under the rows the duration covers, then "Always for this session" over the session-long rows.
Trust menu with session heading, light
Trust menu with 1 hour chosen and All tools armed, dark

A rule-override card: the refused command shows once, in the warning.
Override card, light
Override card, dark

A pending card whose transcript row is out of view: the Show in chat chip.
Show in chat state, light
Show in chat state, dark

@kyleseaman
kyleseaman force-pushed the feat/approval-card-redesign branch from 7500f41 to 649dfc8 Compare November 17, 2026 19:23
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Nov 17, 2026
@kyleseaman

Copy link
Copy Markdown
Contributor Author

Recordings and frames for the UX review on 649dfc8 (frontend-only capture harness, node capture/shoot-approval-card-redesign.mjs from website/), light then dark.

A decision settling into its receipt: the status pill moves from the card into the receipt and turns into the verdict.

rec-allow-once-light.webm
rec-allow-once-dark.webm
rec-reject-once-light.webm
rec-reject-once-dark.webm
rec-all-tools-arm-light.webm
rec-all-tools-arm-dark.webm

menu-trust-light

menu-trust-dark

state-mcp-armed-light

state-mcp-armed-dark

@github-actions github-actions Bot removed the readiness: checking Automated validation is still running label Nov 17, 2026
@KiroCrewCaptain

Copy link
Copy Markdown
Collaborator

This changes behaviour users already rely on, so it needs a design sign-off from a maintainer before it can merge. A maintainer will post the decision here. To propose a design, follow the request-for-change process in CONTRIBUTING.md (docs/request-for-change/).

Review result on head 370f210: no blocking finding. The Trust menu still sends the same actions, patterns and ttl_seconds values as main, and the backend still checks each pattern against the pending request. Trust for all tools now takes two clicks, which is stricter. Its armed state is reset per card. After a downgraded trust click, the receipt says "Allowed once", the decision the server was actually asked for. Channel surfaces keep the plain menu. PR Readiness is green on this head.

The earlier change requests, item by item:

  • Restyle ratchet over baseline: fixed. TrustDropdown.tsx no longer renders the styled DropdownMenuLabel heading, and Readiness passes on this head.
  • UX blocker (hard swap from card to receipt, recordings made from unpushed code): fixed. approvalPillLayoutId and the reserved width are in this head, and the UX review on this head PASSes after reading the card-to-receipt recordings.
  • Optional items: done. The duplicate fixtures are gone, the comment about the view-dependent bar now matches the code, and TrustDropdown.lift.test.tsx pins the menu lift.
  • Button order: left for the maintainer's design decision, as the body says.

Done well: the full command now shows once, untruncated, in a box the menu moves clear of, and the exact-command row points screen readers to that box.

Optional:

  • approval.ts:404 and :488: no test fails if the session-switch guard or the downgrade receipt is removed. One test could hold approveChatSlot on a deferred promise, switch to slot-2, then resolve it and assert that no approval-receipt shows.
  • TrustDropdown.tsx:344: the comment says any other action disarms "All tools". Only choosing a duration or closing the menu does that. Change the comment to match the code.
  • The claim that the lone all-tools control keeps its width rests on a data-reserve attribute check in jsdom. Logging the control's measured width, idle and armed, in the capture script would show the width does not change.

@KiroCrewCaptain
KiroCrewCaptain dismissed their stale review November 18, 2026 01:30

Withdrawn: every item in this review is fixed or answered on the current head (see the follow-up comment). Other holds on this PR are listed there.

@kyleseaman
kyleseaman force-pushed the feat/approval-card-redesign branch from 370f210 to 11bdf09 Compare November 18, 2026 02:13
@github-actions github-actions Bot added merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running and removed readiness: passed Eligible automated validation passed for the current revision labels Nov 18, 2026
@kyleseaman
kyleseaman force-pushed the feat/approval-card-redesign branch from 11bdf09 to 0d0e8d9 Compare November 18, 2026 03:10
@github-actions github-actions Bot removed the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 18, 2026
@kyleseaman
kyleseaman force-pushed the feat/approval-card-redesign branch from 0d0e8d9 to eed37ae Compare November 18, 2026 05:46
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 18, 2026
@kyleseaman
kyleseaman force-pushed the feat/approval-card-redesign branch from eed37ae to 95738d7 Compare November 18, 2026 08:38
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Nov 18, 2026
@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Nov 18, 2026
@KiroCrewCaptain

Copy link
Copy Markdown
Collaborator

This changes behaviour users already rely on, so it needs a design sign-off from a maintainer before it can merge. A maintainer will post the decision here. To propose a design, follow the request-for-change process in CONTRIBUTING.md (docs/request-for-change/).

Review result on head 95738d7: no blocking finding. Every Trust row still sends the same action, pattern and ttl_seconds as main. Trust stays disabled where main disables it, and channel and dashboard cards keep the plain menu. After a downgraded trust click, the receipt names the decision the server was actually asked for. PR Readiness is green on this head, and every AI review lane passes on it.

Earlier review items, one by one:

  • Restyle ratchet over baseline: fixed. TrustDropdown.tsx no longer renders the styled heading, and Readiness passes.
  • Card to receipt hard swap: fixed. approvalPillLayoutId and the reserved width are in this head, and the UX review passes on it.
  • Duplicate fixtures, the disarm comment (TrustDropdown.tsx:344) and the menu lift test: done.
  • Override and "Show in chat" frames, the doubled command on the override card, and the test file size: fixed earlier, still fixed.
  • Button order: left for the maintainer's design decision, as the body says.

Done well: the full command shows once, untruncated, in a box the menu moves clear of. The override payload drops only the command key, and only when it equals the string the card shows.

Optional:

  • For the sign-off: Allow once now sits right-most, where main's Reject menu sat, and the dashboard's ApprovalCard.tsx keeps Approve, Trust, Reject. Keeping main's order would also leave composerFocus.ts unchanged.
  • Deleting any one of three guards leaves the two approval test files green: the shownSlot.current === activeSlot check in finish() (approval.ts:420), the notice clear in the slot cleanup effect (approval.ts:216-220), or the Trust menu key (ToolApprovalCard.tsx:237). The body says each guard has a test that fails without it. A same-slot test (arm "All tools", then a new approval arrives for the same slot) and a test where a late slot-1 reply leaves slot-2's notice in place would make that true.
  • messaging.md:492 and the comment above approvalDescription in approval.ts say the heading uses tool_purpose whenever the row carries one. The code does that only when simplified tool names are on. Please also drop "as on main" from the spec sentence.

@KiroCrewCaptain
KiroCrewCaptain dismissed their stale review November 18, 2026 11:09

Withdrawn: every item in this review is fixed or answered on the current head (see the follow-up comment). Other holds on this PR are listed there.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: passed Eligible automated validation passed for the current revision readiness: checking Automated validation is still running labels Nov 18, 2026
kseamaws and others added 2 commits November 18, 2026 12:25
The chat approval card now says what is being asked: a status pill,
a plain description of the request, a type chip, and the whole command
shown once in a code box. Reject, Trust and Allow once stay three
controls, with Allow once the one filled button.

The Trust menu on that card has one duration choice (1 hour, Until
midnight, This session) above one row per scope: this exact command,
any <base> command, read-only commands, all tools. The duration applies
to the command and family rows. All tools takes a second click. The
exact-command row names no command, so the menu opens clear of the
card's command box.

A decision made in the tab leaves one line saying what was granted and
when it ends.

Which grants exist, when each is offered, and what is sent to the
backend are unchanged. Channel approvals keep the plain menu.

Part of #36134
…per request

The card's heading can be the agent's own description of a call, so an
MCP card now also shows the tool's gateway name beside its server, and
the heading follows the simplified-names setting again. The Trust menu
is keyed by session, approval and row like Reject, so an armed
all-tools confirmation never carries over to another session's card.

A non-shell grant is keyed on the tool, and for a file write on its one
file, whatever the call's other arguments. Its row now prints the
server's own label for that scope (for example "fs_write /path") with
its lifetime, as the plain menu does, instead of "This exact call".

UX notes: a rule under the command and family rows, and a heading over
the rows that always last the session ("Until this chat ends"), show the duration covers only
the command and family rows; the always-allow row sits above that
heading. An override card no longer repeats its refused command as the
call payload. The payload box drops only the `command` field, and only
when it is the string shown; every other field stays even when its
value equals the command, and input the card cannot split shows as it
came. The session-length note says the grant never carries over
to another chat. The capture adds the armed lone all-tools control, the
always-allow row, the override card and the Show in chat state.

Review: the receipt comment now says a standing grant's line outlives
the next card but still clears after the usual 8 seconds. The Trust-menu
and receipt tests move to ChatInput.approvalTrust.test.tsx with shared
fixtures, keeping ChatInput.approval.test.tsx under the split point; it imports
those fixtures rather than declaring them again. The comment on the
transcript-row subscription now says what the card does when that row
scrolls out of view, and a test pins the Trust menu's lift above the
command box.

UX review: the receipt now mounts in the card's own place, and the
card's status pill and the receipt's share a layout id, so on a decision
the pill moves into the receipt and turns into the verdict instead of
the card vanishing. The card's exit, the pill's move and the receipt's
entry share one slow eased fade (0.45 s, no spring); under reduced
motion the card and receipt swap at once with no animation. The lone all-tools
control reserves its armed label's width, so the second click lands
where the first did. The heading is drawn as a plain line, not a
restyled menu label. The capture script records a decision and the
first click on the lone all-tools control.

Later review notes: tests pin that a receipt landing after the composer
moved to another session is dropped, and that a trust verb for a
coordinator request is sent as a one-shot allow whose receipt says so.
The disarm comment names what actually disarms the all-tools row, and
the capture logs the lone control's measured width idle and armed.

The shared layout id is keyed on the slot and the request (approval id
and row), and the receipt carries the id of the request it answered, so
a standing grant's receipt that is still up when the next card arrives
never shares a layout stack with the new card's pill. The receipt records
the slot it was made in and shows only over that slot's composer, in
presence keyed on the slot, so it fades out as it faded in but is gone
in the same render when the composer moves to another session.

A one-shot receipt is not shown when this tab's own resolve frame has
already moved the card to the slot's next request before the reply
lands, and the card's presence is keyed on the slot like the receipt's,
so a session switch drops the last session's card at once instead of
fading it, buttons and all, over the new composer.

Tests pin the three remaining guards: an armed all-tools row does not
carry over to the next request in the same session (the Trust menu's
key), a late reply for the last session leaves this session's notice in
place, and a standing grant's receipt does not come back when the
composer returns to its session. The heading comment and the spec say
tool_purpose heads the card only with simplified tool names on.
@kyleseaman
kyleseaman force-pushed the feat/approval-card-redesign branch from 95738d7 to ae32965 Compare November 18, 2026 12:27
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: passed Eligible automated validation passed for the current revision readiness: checking Automated validation is still running labels Nov 18, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

readiness: action required A blocking check or review needs attention

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Chat approval card: say what is being asked, one Trust row per scope with a duration, and a receipt after the decision

3 participants