Skip to content

fix(design-critique): make the Ask composer the retry after a failed turn - #23690

Merged
bolichen97 merged 1 commit into
mainfrom
fix/21894-ask-retry-placeholder
Oct 24, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
fix/21894-ask-retry-placeholder

Conversation

@iamwhatever

Copy link
Copy Markdown
Contributor

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.

  • The box placeholder now has three states, all from 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.
  • When a turn fails, its question goes back into the box, but only if that same thread is still open and the box is still empty. The draft is shared by every thread, so a question never lands in a different thread, and anything the user already typed is kept.
  • The three new strings are in en.manual.json and every translated catalogue. en-XA was regenerated with scripts/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 === askId check 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.mjs and tsc -p tsconfig.app.json pass.

Manual verification

I rendered the real AskLayer with 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, question refilled

Failed turn, empty box: the placeholder matches the notice.

Failed turn, Ask again placeholder

Answered turn: unchanged "Ask a follow-up…".

Answered turn, Ask a follow-up placeholder

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

  • 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

@iamwhatever
iamwhatever requested review from a team and KiroCrewCaptain as code owners October 24, 2026 07:57
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 24, 2026
@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

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 .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 24, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 164bde9ad67290e26d8c782e4754ca4e583fea2d — 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

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 ships

Inventory (4 items) — 4 justified

Intent: after a failed Design Critique ask, the user retries with one Enter instead of retyping the question. This is a FIX.

  1. Composer placeholder reads "Ask again…" while the newest turn has failed — justified
  2. A failed question is put back into the empty composer, only if its thread is still open — justified
  3. The two existing placeholders are now catalogue strings (i18nT) instead of hard-coded English — justified
  4. Three new keys in en.manual.json and 12 locale catalogues, with en-XA regenerated — justified

[FIRST-PRINCIPLES-REVIEWED] 164bde9

Description read

[DESCRIPTION-READ] 21c712c70ed1f09c4aa3802997bca9a3a4cc6c99699c4c9ed373dcb8739c1b68

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 24, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

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

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

  • In shot-02, "ask again" shows up three times: in the notice, in the reason line, and in the placeholder "Ask again…". The empty-box failed state could reuse "Ask a follow-up…", so the notice is the only thing saying "ask again". The reader called this repetitive.
  • The reader rated the refill only "a guess", because "nothing says the text was filled in for me". If the refilled value were selected on focus, it would show that the app put the text there, and typing would replace it.

[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 .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 24, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] 164bde9

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

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

@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

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

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 164bde9

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

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 no failed flag, so the label goes back to "Ask a follow-up…" during the retry.
  • The refill in the runTurn catch path uses openAskIdRef, 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.json and 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.

@iamwhatever
iamwhatever force-pushed the fix/21894-ask-retry-placeholder branch from fad8e99 to 164bde9 Compare October 24, 2026 08:39

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@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 24, 2026

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@bolichen97
bolichen97 merged commit 794dad4 into main Oct 24, 2026
108 checks passed
@bolichen97
bolichen97 deleted the fix/21894-ask-retry-placeholder branch October 24, 2026 10:02
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 24, 2026

@cruisercohen cruisercohen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

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.

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.

design-critique: the Ask composer after a failed turn still says "Ask a follow-up…" and makes the user retype

4 participants