Repository navigation
fix(design-critique): make the Ask composer the retry after a failed turn - #23690
Conversation
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: this is a small, reversible fix aimed at a real retype-after-failure harm, and it guards against both cross-thread leaks and overwriting a draft the user has started. [DESIGN-REVIEWED] 164bde9 Description read[DESCRIPTION-READ] 4f6868be2c74a02b0c8c97c43abe28c404efb2801730703eb3c5ba64acdaeb26 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 Nothing blocks: both behaviour changes trace to #21894, and the catalogue change is the i18n rule applied to the lines being edited. What this change shipsInventory (4 items) — 4 justifiedIntent: after a failed Design Critique ask, the user retries with one Enter instead of retyping the question. This is a FIX.
[FIRST-PRINCIPLES-REVIEWED] 164bde9 Description read[DESCRIPTION-READ] 21c712c70ed1f09c4aa3802997bca9a3a4cc6c99699c4c9ed373dcb8739c1b68 That sha256 names the PR description this verdict read. Recompute it with |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing blocks. All three placeholder states and the refilled question are in screenshots, and the blind reader read the filled box correctly: "already filled with my old question so I can send it again". Notes
[UX-REVIEWED] 164bde9 Description read[DESCRIPTION-READ] 8a33a3a4e6cd15363d5d9bac37ddbd6a5612d67b047375ee7587fe0ad47792a3 That sha256 names everything this verdict read: the PR description, plus the 6 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 — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
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: |
bolichen97
left a comment
There was a problem hiding this comment.
Looks good to ship. Head reviewed: fad8e99.
What I checked:
- The placeholder now has three states from
i18nT, and "Ask again…" shows only while the newest turn is the failed one. A new pending turn has nofailedflag, so the label goes back to "Ask a follow-up…" during the retry. - The refill in the
runTurncatch path usesopenAskIdRef, so a failed question goes back only into its own open thread.setAskDraft(d => d || question)keeps any draft the user already typed. The cancelled path returns before the refill, which is correct. - The three keys are in
en.manual.json,en-XA.jsonand all 11 translated catalogues. No key is removed. - The tests cover each state. The "has left" test closes the thread before the failure and expects an empty draft, so it guards the thread check. I read the tests; I did not run them.
- No other open PR touches these files, and main has not changed them since the merge base. The linked issue is tier T1.
No findings. Remaining before approval: required checks are still running and the readiness label is not yet passed on this head.
fad8e99 to
164bde9
Compare
bolichen97
left a comment
There was a problem hiding this comment.
Re-reviewed at head 164bde9.
This head is a rebase of the previously reviewed commit onto current main. A range diff of the PR commit shows one change only: the French string for what_dont_you_understand_about_this drops the space before the question mark. No code or test changes. The earlier review still holds: no blocking or should-fix findings, and all five AI review lanes pass on this head.
Looks good to ship. Not approving yet because one maintainer gate is still open: readiness is still checking on this head, with the Backend Tests shards (Linux and Windows) still pending. I will approve and enable auto-merge once readiness reports passed on this head.
bolichen97
left a comment
There was a problem hiding this comment.
Approving at head 164bde9. Maintainer gates checked on this head: readiness label is passed, every check is green, the branch is mergeable, the base is main, and the earlier review found no blocking issues. Queuing squash auto-merge pinned to this commit.
cruisercohen
left a comment
There was a problem hiding this comment.
Approving. Frontend UX + i18n only — not a security-scope change. It makes the Ask composer the retry after a failed turn: the placeholder gains a third state ("Ask again…") shown only while the newest turn is the failed one, and the runTurn catch path refills the failed question back into its own open thread while keeping any draft the user already typed. No auth, network, or logic change.
bolichen97 reviewed the content on this rebased head and found no blocking or should-fix issues; I independently confirmed the placeholder-state logic and that the three i18n keys are present across the catalogues with none removed.
One note: I could not run the website vitest suite (the frontend test env wasn't available to me), so this is based on diff inspection rather than a test run.
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: fix (17 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, security checklist all-NO, no reviewer-lane findings, readiness signal fresh for this head SHA, declared category matches the diff. Category: Design Critique Ask composer names itself the retry after a failed turn and keeps the failed question, with catalog strings and tests; frontend only.
Problem / Motivation
Goal: After a Design Critique ask fails, the box below says it is the retry and already holds the question, so the user can press Enter instead of retyping.
Bug: when an ask turn fails, the notice says "Answer failed — ask again below", but the box below still says "Ask a follow-up…" and is empty. The user has to type the question again from memory. The two placeholders are also hard-coded English, not
i18nT.Why it matters
Every Design Critique user who hits a timeout or a send error gets a box that says the wrong thing and throws away their question. A retry should be one key press.
Not a goal
What changed (motivation → approach → change)
Symptom: after a failed turn the box shows "Ask a follow-up…" and is empty. Cause: the placeholder only checked whether the thread had turns, and the failure path never gave the question back.
i18nT: "What don’t you understand about this?" for a new thread, "Ask again…" when the newest turn failed, and "Ask a follow-up…" otherwise. "Ask again…" matches the failure notice.en.manual.jsonand every translated catalogue.en-XAwas regenerated withscripts/gen-pseudolocale.mjs.File budget: the 13 catalogue files only add the same 3 keys, so they do not count against the 6-file limit (same ruling as #23649).
Decision (issue task 3): yes, refill the question. It is the smallest change that stops the retype. The user still presses Enter, so nothing is sent without them.
Backwards compatibility
Compatible: only placeholder text and the draft after a failure change; no stored data, API or key is changed or removed.
Removes nothing: the diff adds three catalogue keys and one draft refill, and takes no key, path or behaviour away.
Tests
DesignCritiqueAskLayerCov80.test.tsx› "names the composer a retry only while the latest turn is the failed one": "Ask again…" when the newest turn failed, "Ask a follow-up…" once a later turn succeeds.DesignCritiquePage.coverage.test.tsx› "reports a failed follow-up on the turn itself": after a send error the box says "Ask again…" and holds "Still there?".DesignCritiquePage.coverage.test.tsx› "does not drop a failed question into a thread the user has left": closing the thread while the question is in flight leaves the draft empty.Proof: not provable -- frontend test (prove.py runs Python only)
Done by hand instead: with the production files reverted and the tests kept, all three tests fail. With only the
openAskIdRef.current === askIdcheck removed, the "has left" test fails. The tests pass with the fix (61/61 in the two files).vitest run src/i18n(1022 tests),check-i18n-keys.mjs,check-i18n-strings.mjsandtsc -p tsconfig.app.jsonpass.Manual verification
I rendered the real
AskLayerwith the app CSS in headless Chromium, from a throwaway static build that is not committed. The placeholder and value were read from the DOM: failed turn → placeholder "Ask again…" and value = the question; failed turn with an empty box → "Ask again…"; answered turn → "Ask a follow-up…". No page errors.Screenshots / video
Failed turn: the question is back in the box.
Failed turn, empty box: the placeholder matches the notice.
Answered turn: unchanged "Ask a follow-up…".
Related Issues
Closes #21894
Sibling sweep
Swept: git grep -nE "placeholder={" -- website/src/apps/design-critique/
Sibling: website/src/apps/design-critique/Composer.tsx:144 -- not affected -- this is the main link box, not a retry surface. Its English strings are counted in website/src/i18n/untranslated-baseline.json for the i18n remediation.
Pattern harvest
Not generalizable: the defect is one surface's placeholder not knowing about its own thread's failed state. That is a per-component state check, not a pattern a rule can catch.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)