Skip to content

fix(apps): give the trust dialog's trusted-failure retry its own label - #20859

Merged
bolichen97 merged 1 commit into
mainfrom
fix/trust-dialog-retry-label-20798
Oct 15, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
fix/trust-dialog-retry-label-20798

Conversation

@bolichen97

@bolichen97 bolichen97 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: On the trust dialog's failure states, the retry button says what it does, it is off while it cannot work, and a control named in a sentence reads as a name.

After trust is saved and only the action failed, the retry still reads "Trust and try again", so the headline has to explain that the button's own word asks for nothing. While the gateway is unreachable, the not-saved failure says to wait for the reconnect, but its retry stays on. The headlines name controls in running text ("choose Trust and try again"), which reads as part of the sentence.

Why it matters

A button that says "Trust" when no trust is asked makes a consent dialog harder to trust. A button that is on while its own next-step line says to wait invites a retry that can only fail the same way.

Not a goal

  • Changing what the dialog grants, the consent gate, the grant-then-retry sequence or the rollback.
  • Relabelling the consent state's confirm buttons or the working labels.
  • Turning the retry off in the trust-saved state while offline: only the not-saved state's copy names the wait.
  • The other trust-modal screenshot harnesses.

What changed (motivation → approach → change)

Once trust is saved, the retry gets its own label, "Try again", on the enable, install and update paths, in all 12 catalogs. The label says what it does, so the three trust-saved headlines no longer explain it: they say the app is trusted but the action failed, then how to remove the trust in Settings. That button carries a plain retry icon, not the trust shield. The not-saved state keeps "Trust and try again" and its shield, because there the retry does ask for trust.

On the not-saved failure, the retry turns off while the gateway is unreachable and back on when it returns. Its offline line names it: "Trust and try again" stays off until it reconnects. Cancel stays on. The not-saved headlines name no control, so they never point at a button that is off: "Choose "Trust and try again"" moves into the connected next step, before the agent hand-off.

A control named inside a sentence is quoted, in the locale's own quote pair (the one its title puts around the app name): the retry labels, "Ask the agent", and "Cancel" where an exit sentence opens on it. Bengali, Hindi, Japanese and Korean exit sentences use the verb, not the label, so they stay as they are; the Bengali hand-off keeps its stem as the verb, because the label's ending is the formal register that catalog keeps out of running copy. en-XA is regenerated. TrustAppModal.tsx picks the label by state and disables the retry from the same gateway-connection store the offline line reads.

State Retry label Offline
trust saved, action failed "Try again" (new) on
nothing saved "Trust and try again" off (new)

Backwards compatibility

Compatible: copy and one button's disabled state only; no API, key removal or stored data changes. One catalog key is added (confirm_retry_granted).

Removes nothing: the retry is disabled only while the gateway is unreachable on the not-saved failure, and comes back on reconnect; Cancel and every other path are unchanged.

Tests

  • website/src/i18n/trustModalFailureCopy.test.ts, every authored catalog: confirm_retry_granted differs from the not-saved label, and the trust-saved headlines share one clause and name neither retry label; the not-saved headlines do not name the retry, while the connected next step and the offline line name the quoted not-saved label; the connected next step names the quoted hand-off (the Bengali stem otherwise); no exit sentence opens on a bare Cancel label.
  • website/src/test/TrustAppModal.test.tsx: the trust-saved retry shows confirm_retry_granted and not the not-saved label on the enable, install and update paths, with the retry icon and no shield; the not-saved retry keeps its label; offline it is disabled, a click does nothing, Cancel stays enabled, and it re-enables on reconnect; the trust-saved retry stays enabled offline.
  • Determinism: both files run 3 times with shuffled order (--sequence.shuffle, seeds 7919, 15838, 23757): 117/117 each time. Also run: all of website/src/i18n/ with I18N_BASE_REF set (1061 passed), npm run i18n:check and lint:i18n (diff-scoped QA 0 findings), tsc -p tsconfig.app.json, eslint on the changed files.

Manual verification

website/scripts/capture-trust-modal-update-copy.mjs runs the real built SPA with stubbed APIs and asserts each state before it takes the frame. BEFORE is a dist built from this PR's base, AFTER from this head; both runs passed. BEFORE shows the bug on main: the trust-saved retry reads "Trust and try again", and offline the headline says to choose the retry while it stays on. AFTER asserts nothing offline tells the reader to choose it.

Screenshots / video

Trust saved, update failed: the retry is "Try again".

before: trust saved
after: trust saved

Nothing saved, gateway unreachable: the retry is off.

before: offline
after: offline

Other states (after)

after: consent
after: not saved, connected
after: working

Related Issues

Closes #20798

Pattern harvest

Not generalizable: a dialog-specific copy decision about which label a retry carries in each failure state.

Checklist

  • At most two commits (one is the norm), 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

@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners October 15, 2026 14:57
@bolichen97
bolichen97 requested a review from CrysisDeu October 15, 2026 14:57
@bolichen97
bolichen97 enabled auto-merge (squash) October 15, 2026 14:57
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 15, 2026
@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 8e4604dfcc11143463493b754e71f545e622d5b2 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Check that the gateway-connection store goes back to connected once the gateway is reachable. If it stays false, the not-saved retry stays disabled.

[DESIGN-REVIEWED] 8e4604d

Description read

[DESCRIPTION-READ] ac1e991df01f2c46c6da07b763e11939f7fdbaae70566f1f4cb7ef67400739c8

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 Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — 🟡 CONCERNS

Premise-level review of 8e4604dfcc11143463493b754e71f545e622d5b2 — 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/CONCERNS are advisory.

First-Principles-Verdict: CONCERNS

Quoting "Cancel" also rewrites three consent-state lines, which sit outside the Goal's "failure states".

Not justified as shipped

  • Item 6 — oversized: the Goal is scoped to "On the trust dialog's failure states, … a control named in a sentence reads as a name". But on_cancel, install_on_cancel and update_on_cancel are the consent-state lines. The capture script's captureConsent asserts UPDATE_ON_CANCEL before any failure. That is 3 lines × 7 authored catalogs (de, en, es, fr, it, pt, ru) plus en-XA. No convention in website/docs asks for quoted labels: I grepped for quoted control or button names and got 0 hits.
    Subtraction: revert the quoting in those three keys, drop them from CANCEL_LINES, and keep only the *_on_cancel_granted lines that the failure state shows.
    Clears when: the consent-state lines are reverted, or a human amends the Goal.

What this change ships

Inventory (7 items) — 6 justified

Intent: make the trust dialog's retry say what it does in each failure state, and keep it off while it cannot work. This is a FIX (Closes #20798).

  1. After trust is saved and the action failed, the retry reads "Try again" instead of "Trust and try again" — justified
  2. That retry shows a plain retry icon instead of the trust shield — justified
  3. The trust-saved headlines drop the clause explaining the retry's "Trust" — justified
  4. On the not-saved failure, the retry is disabled while the gateway is unreachable and re-enabled on reconnect — justified
  5. "Choose Trust and try again" moves from the not-saved headlines into the connected next step — justified
  6. "Cancel" is quoted in all six cancel lines, consent state included — oversized: the consent state is outside the Goal's failure states
  7. The offline next step and the agent hand-off name their controls in quotes — justified

[FIRST-PRINCIPLES-REVIEWED] 8e4604d

Description read

[DESCRIPTION-READ] b71bd20d63b02802ef852cb0f24e9d684fab9127e4081f6aeaa22ff01a5ab898

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 Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

UX-level review of 8e4604dfcc11143463493b754e71f545e622d5b2 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

UX-Verdict: PASS

Check that the offline line in shot-04, "Kiro Crew is not connected right now", tells people what it is not connected to. In shot-03 the reader asked: "Connected to what? My internet? Some server?"

[UX-REVIEWED] 8e4604d

Description read

[DESCRIPTION-READ] 6332b0e24fdb5a9415503061d9461737544ae7161cce4749d66ab8d6d916d14c

That sha256 names everything this verdict read: the PR description, plus the 10 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 Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] 8e4604d

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

False positive or not applicable? A repository writer can comment:
/ai-review override fable 8e4604dfcc11143463493b754e71f545e622d5b2: <one-sentence reason>

@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

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

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 8e4604d

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 8e4604dfcc11143463493b754e71f545e622d5b2: <one-sentence reason>

@bolichen97
bolichen97 force-pushed the fix/trust-dialog-retry-label-20798 branch from ea9990f to 65fd1e9 Compare October 15, 2026 15:17
@bolichen97

bolichen97 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor Author
  • span=bbb6e2daaa5a The headline points at a button that is turned off

fixed in 65fd1e9: the three not-saved headlines name no control in any of the 12 catalogs.
"Choose “Trust and try again”." moved into the connected next step (failed_generic_next_ask), before the agent hand-off.
Offline the notice reads only the headline and "… stays off until it reconnects", so nothing points at the disabled button.
Pinned by trustModalFailureCopy.test.ts (headlines never contain the retry label; connected step names it) and the capture harness (offline AFTER asserts no "Choose …").

@bolichen97

bolichen97 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor Author
  • span=dcd7663a4d7c Quoting control names applies to this one dialog only

rebutted: the dialog-wide scope is the issue's own task, not an inferred one.
#20798 item 3: "decide one dialog-wide style for naming a control in a sentence (quoted or bold), and apply it in all 12 catalogs."
The UX lane on #20781 raised it there; this PR settles it for the trust dialog only, as asked.
A catalog-wide convention for the ~60 other strings is a separate product decision outside this PR's goal and its frozen Not a goal.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • Gateway-connected flag must go back to true after a reconnect on desktop

rebutted: the desktop build runs the same SPA and socket hook as the browser.
The flag is set true by markGatewayConnected in hooks/websocket/reconnectCatchUp.ts on every socket open (initial and reconnect) and false only by markGatewayDisconnected in connection.ts.
The Ask the agent hand-off already hides and returns on this same flag on every build.
TrustAppModal.test.tsx pins the retry re-enabling when the flag flips back to connected.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running and removed readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention labels Oct 15, 2026
@bolichen97
bolichen97 force-pushed the fix/trust-dialog-retry-label-20798 branch from 65fd1e9 to 10dea35 Compare October 15, 2026 15:34
@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=36dc12ae5f72 Quoting the six Cancel lines goes beyond the defect

rebutted: #20798 item 3 asks for ONE dialog-wide style for naming a control in a sentence, applied in all 12 catalogs.
"Cancel changes nothing:" names the Cancel button as the sentence's subject; leaving it bare while the retry and hand-off are quoted would ship two styles in one dialog, the inconsistency the item exists to remove.
Only exit lines that open on the label itself are quoted; bn/hi/ja/ko use a verb there and stay unchanged, pinned by trustModalFailureCopy.test.ts.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=4061d91f29a6 Try again still carries the trust shield icon

fixed in 10dea35: the trust-saved retry renders RotateCcw instead of ShieldAlert; the not-saved retry keeps the shield because it does ask for trust.
Pinned in TrustAppModal.test.tsx (the granted retry has svg.lucide-rotate-ccw and no shield svg); after-03 screenshot refreshed.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=fb0f68ced2f1 Name what dropped in the offline line

rebutted (disproportional): the subject "{{productName}} is not connected right now" is the base wording from #20781 that this PR keeps; only the retry clause after it changes.
It matches how the dashboard already names the same gateway drop elsewhere ("{{productName}} disconnected"), and naming the local server would add a second term for one state across 12 catalogs.
A dashboard-wide wording for the disconnected gateway is outside this PR's goal.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • A dropped WebSocket must not strand a user whose plain requests still work

rebutted: the user is not stranded. Cancel stays enabled while the retry is off (TrustAppModal.test.tsx asserts it), and closing the dialog grants nothing.
Reopening starts again from consent: useTrustGate.open() resets failed/granted, so the confirm is enabled whatever the flag says.
The retry is off only on the not-saved failure and only while the flag is false; it re-enables the moment the socket reopens (also pinned).

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=fe091b307e9e Control-name quoting rests on a preference

rebutted: the quoting is the source issue's own task, not a preference this PR adds. #20798 item 3: "decide one dialog-wide style for naming a control in a sentence (quoted or bold), and apply it in all 12 catalogs."
The ask is a style decision for this dialog, so a reader-misread report is not its precondition. The bare strings found sit outside trustAppModal, outside item 3's scope.
Same class as dcd7663a4d7c and 36dc12ae5f72; a catalog-wide naming style for the other modals is a separate product decision, not this PR.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=2df77fc6973f Delete the clause that repeats the Try again label

fixed in 25d2580: the three trust-saved headlines drop "To try again, choose “Try again”;" in all 12 catalogs and keep only how to remove the trust.
Pinned in trustModalFailureCopy.test.ts (the granted headlines name neither retry label) and the capture harness (AFTER asserts the headline does not repeat the label).

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • Trust-saved Try again stays on while offline

accepted-and-deferred: deliberate here. #20798 item 2 names only the not-saved retry, whose copy already says to wait; turning the trust-saved one off needs a new offline line in 12 catalogs, which is new scope.
Tracked in #20884 (deferred-finding, assigned, due 2026-11-12).

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • Trust-saved retry stays on offline: is it deliberate?

accepted-and-deferred: yes, deliberate in this PR. #20798 item 2 names only the not-saved retry; the trust-saved one would need its own offline line in 12 catalogs so the disabled button has a reason.
Tracked in #20884 (deferred-finding, assigned, due 2026-11-12).

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • Try again screenshot comes from the update path with the retry icon

confirmed: after-03 is captured by website/scripts/capture-trust-modal-update-copy.mjs on the Update path (Update button, update_failed headline, update outcome line), and shows the RotateCcw icon on "Try again".
The trust-saved state renders no next-step line (nextStep is null outside failed_generic), so nothing there tells the reader to choose the retry, offline or not; the harness asserts the headline does not repeat the label.

@bolichen97

Copy link
Copy Markdown
Contributor Author

yes: #20798 item 3 asks for "one dialog-wide style for naming a control in a sentence", not a failure-state style. The consent-state exit lines (on_cancel, install_on_cancel, update_on_cancel) are in the same dialog and name the same Cancel button.
Quoting them keeps one style across every state; the frozen goal's "a control named in a sentence reads as a name" has no state qualifier.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • Offline line: connected to what

rebutted (same class as fb0f68ced2f1): the subject "{{productName}} is not connected right now" is the base wording from #20781; this PR changes only the retry clause after it.
It matches how the dashboard names the same gateway drop elsewhere ("{{productName}} disconnected"); a new term for one state across 12 catalogs is outside this PR's goal.

@bolichen97

Copy link
Copy Markdown
Contributor Author

Backend Tests (Windows) (5) fails on test/test_acp_bindings.py (approval_withdrawable, approve_tool): main is red from #20743, tracked in #20893 and fixed by #20894. This PR only touches the website. Waiting for #20894, then rebasing.

@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 Oct 15, 2026
Once trust is saved and only the retried action failed, the retry button
read "Trust and try again", so the headline had to explain that the
button's own word asked for nothing. That state's retry now reads "Try
again" on every path (enable, install, update) in every locale, and its
headline just names it.

On the not-saved failure while the gateway is unreachable, the next step
said to wait for the reconnect but the retry stayed on. The retry is now
off for exactly that long, and the sentence names it: it stays off until
the reconnect. Cancel stays on.

A control named inside a sentence is quoted, in the locale's own quote
pair, across the dialog's failure and exit sentences in all 12 catalogs.

The dialog's grant and consent gate are unchanged.

Closes #20798
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased onto main 0694e63, which carries the test_acp_bindings census fix (#20902; #20894 closed as its duplicate). test/test_acp_bindings.py passes locally (147 passed); CI re-running.

@bolichen97
bolichen97 force-pushed the fix/trust-dialog-retry-label-20798 branch from 25d2580 to 8e4604d Compare October 15, 2026 17:39
@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 Oct 15, 2026
@bolichen97

bolichen97 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor Author
  • span=b7cd8d830a5e Quoting Cancel rewrites three consent-state lines

rebutted: on_cancel, install_on_cancel and update_on_cancel are also the not-saved FAILURE state's exit lines. terminalCopy('failed_generic', …) returns them as exit on the enable, install and update paths (TrustAppModal.tsx), so they render on a failure state the Goal names.
Leaving them bare would put a bare "Cancel" under a failure headline whose next step quotes “Trust and try again”: two styles in one failure state, the inconsistency #20798 item 3 asks to remove.
The consent state shows the same strings because they are one key per path; splitting them per state would add 3 keys × 12 catalogs for no reader-visible gain.

@bolichen97

bolichen97 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor Author
  • Gateway-connection store goes back to connected once reachable

answered (same as the earlier rounds): markGatewayConnected in hooks/websocket/reconnectCatchUp.ts sets the flag true on every socket open, initial and reconnect; only markGatewayDisconnected in connection.ts sets it false.
TrustAppModal.test.tsx pins the not-saved retry re-enabling when the flag flips back; Cancel stays enabled throughout, and reopening the dialog resets to consent.

@bolichen97

bolichen97 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor Author
  • Offline line: not connected to what

rebutted (same class as fb0f68ced2f1, answered on 65fd1e9 and 25d2580): "{{productName}} is not connected right now" is #20781's wording, kept here; this PR changes only the retry clause after it.
It matches how the dashboard names the same gateway drop elsewhere ("{{productName}} disconnected"); a new term for one state across 12 catalogs is outside this PR's goal.

@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 Oct 15, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor

Hold at 8e4604d for human review. This changes the app trust consent dialog, a security-related surface reserved for a person even when the code looks sound.

All current-head AI concerns are answered, and the answers hold up. The First Principles rebuttal is correct because the not-saved failure renders on_cancel and its siblings as its exit lines. The deferred trust-saved offline item is tracked in #20884, which is assigned, labelled and dated. Checks are green.

One point for the human reviewer. In the granted state the button now reads 'Try again' with a plain retry icon (TrustAppModal.tsx#L628-L631), but the click still calls api.trustApp before retrying (L285-L298). The new headline points the user to Settings to remove the trust. If they do that in another window while this dialog stays open, 'Try again' grants trust again with no trust wording on the button. The old copy said outright that this button 'asks for no new trust', which was only true while the grant stood. The smallest fix is to skip trustApp on the granted-state retry (call only gate.retry), so the label matches what the click does. If the re-grant is intended, the label should keep saying so.

— crew-pr-reviewer (r104)

@bolichen97
bolichen97 merged commit a02f571 into main Oct 15, 2026
103 checks passed
@bolichen97
bolichen97 deleted the fix/trust-dialog-retry-label-20798 branch October 15, 2026 22:49
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 15, 2026

@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.

Approved by a maintainer who read the review lane findings on this head and accepted them as follow-up work; the findings stay on the record for whoever picks them up.

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.

Trust dialog: give the trusted-failure retry its own label, and settle offline retry and control naming

4 participants