Repository navigation
feat(chat): redesign the tool-approval card and Trust menu - #36150
kyleseaman wants to merge 2 commits into
Conversation
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of 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 |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of 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
What this change shipsInventory (10 items) — 6 justifiedIntent: 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.
[FIRST-PRINCIPLES-REVIEWED] ae32965 Description read[DESCRIPTION-READ] 8d4eb9032d02027ec272b3844cc18c788e467948fb7d549a57c6549caeaf5ae9 That sha256 names the PR description this verdict read. Recompute it with |
UX Review (Opus 5.5) — ✅ PASSUX-level review of 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
[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 |
Opus 5.5 Review — 🔴 changes requested (blocking)Reviewed 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 [BLOCK-MERGE] ae32965 Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
|
Screenshots for the review-fix commit (frontend-only capture harness, MCP card: the tool's own name beside its server, under the agent's description. The lone all-tools control after its first click. Trust menu with the "Always allow this tool" row from #35002. Trust menu for a read-only command: a rule under the two rows the duration covers. |
91c26c4 to
7500f41
Compare
Code change approver recommendation: A person should decideWhy: 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 |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Thanks for the careful redesign. One gap has to close before this can go further.
- 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 inwebsite/capture/approval-card-redesign.tsxcannot 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 anoverridescene (deny_override meta) and aghostscene (no registered pill, tool_call_id set), or reusewebsite/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 setscommandto'', so the payload memo at line 98 returns the wholeapprovalToolInput. The card then prints the refused command in the payload box and again inDenyOverrideWarning, although the comment at line 89 says the warning is where the command is stated. Could the payload skip the command whenapprovalDenyRuleis set, with a test that an override card renders noapproval-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.tschange 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_tooland the deny-override decisions also get no receipt. website/src/test/ChatInput.approval.test.tsxgrows to 1651 lines. Moving the new Trust-menu and receipt blocks into a sibling file keeps it under the 1,600-line split point.
7500f41 to
649dfc8
Compare
|
Recordings and frames for the UX review on 649dfc8 (frontend-only capture harness, 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.webmrec-allow-once-dark.webmrec-reject-once-light.webmrec-reject-once-dark.webmrec-all-tools-arm-light.webmrec-all-tools-arm-dark.webm |
|
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:
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:
|
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.
370f210 to
11bdf09
Compare
11bdf09 to
0d0e8d9
Compare
0d0e8d9 to
eed37ae
Compare
eed37ae to
95738d7
Compare
|
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:
Done well: the full command shows once, untruncated, in a box the menu moves clear of. The override payload drops only the Optional:
|
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.
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.
95738d7 to
ae32965
Compare


















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.
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 (
keepClearinwebsite/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.tsxmounts it and loses about 120 lines.website/src/components/chat-input/approval.tspicks the title and writes the receipt line. A standing grant's line clears when the composer moves to another session.website/src/components/TrustDropdown.tsxkeeps the plain menu for channels and adds the timed menu for chat.website/src/components/ui/dropdown-menu.tsxgains 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.mddescribes the new card.website/capture/approval-card-redesign.tsxand 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_toolcall with the server's ref as on main, and a refused grant shows disabled with its reason.Review fixes on top (second commit):
tool_namefrom 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.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. Theduration_sessiontranslator 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.trust_unavailabletooltip, because base deliberately shows no extra line on that card (ChatInput.approval.test.tsxasserts it); "Reject all" wording is the Reject menu, which this PR leaves unchanged (Not a goal).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 examplefs_write /work/config.json) with its lifetime, as the plain menu does. The threescope_call_*values become<mono/> — <lifetime>in every language. The payload is unchanged:trust_commandwith that same string.UX review on 649dfc8 (BLOCK), point by point:
approvalPillLayoutIdinToolApprovalCard.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); underprefers-reduced-motionthe card and receipt swap at once with no animation (ChatInput.approvalTrust.test.tsxcovers both paths). Recordings below.data-reserveattribute in the same grid cell, not in the text), so the second click lands where the first did.TrustDropdown.test.tsxchecks it.DropdownMenuLabel;TrustDropdown.tsxis back at its baseline count.KiroCrewCaptain's comment on 95738d7 (no blocking finding), optional points:
shownSlotcheck infinish()(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 menukey(an armed "All tools" row does not carry over to the next request in the same session). None was unneeded.tool_purposewording: the spec (messaging.md) and the comment aboveapprovalDescriptionnow 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.
Each has a test in
ChatInput.approvalTrust.test.tsxthat fails without its fix.KiroCrewCaptain's comment on 370f210 (no blocking finding), optional points:
ChatInput.approvalTrust.test.tsxnow holds a grant on a deferred promise, switches to slot-2, resolves it and asserts no receipt shows; and drivestrustfor a coordinator request, asserting it is sent as a one-shot approve whose receipt says "Allowed once". Each fails with its guard removed.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).KiroCrewCaptain's review on 649dfc8 (CHANGES_REQUESTED), point by point:
TrustDropdown.tsxis back at its baseline count of 2.ChatInput.approval.test.tsxnow only imports them fromapprovalCardFixtures.tsx(1,313 lines).approval.tson 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.website/src/test/TrustDropdown.lift.test.tsxstubsgetBoundingClientRectand checkssideOffsetis 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:
overridescene (deny-override meta) and aghostscene (no registered stand-in pill), with light and dark frames below.ChatInput.denyOverride.test.tsxchecks that an override card renders noapproval-input. This is the one intended change to what the card displays; nothing sent to the backend changes. The box drops only thecommandfield (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 ascwd: "make"besidemake, stays, and shell input the card cannot split shows as it came (both tested).always_allow_toolor the deny-override decisions: unchanged, as on main, which shows none for them; adding them would mean new copy outside this PR's grants.website/src/test/ChatInput.approvalTrust.test.tsx, with shared fixtures inwebsite/src/test/approvalCardFixtures.tsx.ChatInput.approval.test.tsxis 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
onActioncalls and thettl_secondsvalues are the ones on main; only the labels and layout change.TrustDropdownwithouttimedGrantsrenders 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 thescope_*keys;src/i18n/deadKeys.test.tsandcheck-i18n-keys.mjspassTests
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 withoutttl_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.tsxandChatInput.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/toolas 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.mjsfromwebsite/). 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:
The Trust menu as it opens, clear of the command:
One hour chosen and the all-tools row armed by its first click:
Review fixes, light then dark. The MCP card names the tool beside its server:
The lone all-tools control after its first click:
The Trust menu with the "Always allow this tool" row:
A rule under the rows the duration covers:
UX polish round: the session-long rows under their own heading, the override card, and the Show in chat chip:
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:
More frames
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
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)