Repository navigation
fix(a11y): keep focus on the auto improvement clone button while it runs - #33128
Conversation
Design Review (Opus 5.5) — ✅ PASS (a BLOCK with no Trigger and no Outcome does not block)Design-level review of Design-Verdict: PASS cannot evaluate: missing screenshot of the Clone failure state. The diff swaps the plain warn-text line for an BlockersThe new and restyled clone-error surface has no rendered evidence Notes
[DESIGN-REVIEWED] d1b8af2 Description read[DESCRIPTION-READ] 0fcb833152168b4210133f4bb46792146b10a30f97bd48c238d0dee98c349710 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. The fix works at the mechanism: one guarded Notes
What this change shipsInventory (5 items) — 4 justifiedIntent: a keyboard user who presses Clone keeps focus while the clone runs, and one press starts one clone. This is a FIX.
[FIRST-PRINCIPLES-REVIEWED] d1b8af2 Description read[DESCRIPTION-READ] c522683f93e4139e310d9982b9f8988a9c192959c36bd4523422acf1c3401bce That sha256 names the PR description this verdict read. Recompute it with |
UX Review (Opus 5.5) — ✅ PASS (a BLOCK with no Trigger and no Outcome does not block)UX-level review of UX-Verdict: PASS cannot evaluate: missing a screenshot of the failed-clone error. The PR is marked no-visual-delta, but it swaps the small warn-coloured Evidence gaps
[UX-REVIEWED] d1b8af2 Description read[DESCRIPTION-READ] cf679c3467fe9dbc0101f628d8b7272632eff411391b3130322a0367ab52b0f0 That sha256 names everything this verdict read: the PR description, plus the 3 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 |
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: |
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: |
The setup panel's Clone was natively disabled while the clone ran, which took it out of the tab order and dropped the focus of the keyboard user who pressed it, though the repository step stays on screen. Enter in the URL field could also start a second clone. Mark the busy Clone with aria-disabled, route the button and Enter through one start that claims the clone synchronously so a double press in one tick starts one clone, give the busy state the muted look of a disabled primary button, and keep disabling it for an empty URL. A clone request that failed outright left nothing on screen once the spinner cleared; both that failure and the backend's own refusal now show through ErrorNotice.
51e8bcf to
d1b8af2
Compare
bolichen97
left a comment
There was a problem hiding this comment.
Approving. In the auto improvement setup panel, the Clone button used to drop keyboard focus while the clone ran. SetupPanel.tsx now keeps it focusable with aria-disabled (still disabled for an empty URL), and a failed clone is announced instead of dropped.
What I checked:
- Gate: 100 ok, 0 pending. Two checks (Sensitive Change Review and Publish readiness signal) had failed on a GitHub API rate limit; I read both logs, reran each once, and both passed. I then listed the check runs on this head: every remaining red row is an older cancelled or failed run with a newer passing run of the same name.
- A second press is refused through a ref claimed before
mutate, becauseisPendingonly changes on the next render. The samestartCloneserves the button and the Enter key, and the ref is released inonSettled, so it is released after a failure too. - The refusal text and a request that failed outright both go through
ErrorNoticewithout the agent hand-off. The comment explains why: the typed repository URL is unsaved and following the hand-off would discard it. - The new test covers a double click in one tick, the Enter key during the clone, one call to
/setup-clone, focus staying on the button, and the button returning to normal after a refusal. The existing failure test now also checks the alert text. - No regex in the added code.
Not checked: I did not run the tests or the panel in a browser.
I did not set auto-merge, because it is already set on this PR.
…uns (#33128) The setup panel's Clone was natively disabled while the clone ran, which took it out of the tab order and dropped the focus of the keyboard user who pressed it, though the repository step stays on screen. Enter in the URL field could also start a second clone. Mark the busy Clone with aria-disabled, route the button and Enter through one start that claims the clone synchronously so a double press in one tick starts one clone, give the busy state the muted look of a disabled primary button, and keep disabling it for an empty URL. A clone request that failed outright left nothing on screen once the spinner cleared; both that failure and the backend's own refusal now show through ErrorNotice. Original author: Rohan Khanderia (cherry picked from commit 48cac3a)
Ports two wheel-copy fixes of the setup panel. kirodotdev/KiroCrew#33128: the Clone button stays in the tab order while a clone runs (aria-disabled instead of disabled), a second press in the same tick starts no second clone, and a request that fails outright is announced in an alert. kirodotdev/KiroCrew#33344: the current-repository line is one message with a <repo/> slot, translated in all 12 locales, so each language places the repository name where its word order puts it. The bundle has no react-i18next, so tSlot in ui/src/i18n.ts renders the slot. Co-authored-by: KiroCrewCaptain <312312717+KiroCrewCaptain@users.noreply.github.com>
Problem / Motivation
Goal: A keyboard user who presses Clone in the Auto Improvement setup keeps focus on that button while the clone runs, and one press starts one clone.
In the Auto Improvement setup panel, pressing Clone swaps its label for a spinner and makes it natively
disableduntil the clone ends (#33102). A disabled button leaves the tab order, so the keyboard user who pressed it loses focus to the page for the whole clone, though the repository step stays on screen. Enter in the URL field during a clone also starts a second clone.Why it matters
A clone can take a while. A keyboard or screen reader user who starts one loses their place, and a repeated Enter makes the backend run a second clone they did not ask for.
Not a goal
What changed (motivation → approach → change)
disabled={!url.trim() || clone.isPending}on the button, and an Enter handler that checks only the URL.startClone, which claims the clone in a ref before callingmutateand releases it inonSettled.clone.isPendingonly flips on the next render, so the ref is what stops a double press in one tick.aria-disabledinstead ofdisabled, so it keeps focus, and takes the muted look of a disabled primary button with no hover or press effect. An empty URL still disables it.clone.data.errorwas rendered, neverclone.error. Both now render throughErrorNotice, with no hand-off because the typed URL is unsaved (CI review finding on this PR).Backwards compatibility
Compatible: the same button and label; a busy Clone ignores a press, as before, and now also ignores a repeated Enter.
Removes nothing: no control, label or behaviour is removed.
Tests
website/src/apps/auto-improvement/SetupPanel.coverage.test.tsx"keeps keyboard focus on Clone while the clone runs, and ignores a second press": a double click in one tick, a later click and an Enter in the URL field start one clone; the pressed button stays focused, isaria-disabledand notdisabled, and clears once the clone answers. It fails on main, and it also fails with the ref claim removed."raises a mutation error when a failed clone returns no error text" now also asserts the failure is announced as an alert.
The 9 Auto Improvement test files pass (89 tests).
tsc, eslint andnpm run i18n:checkare clean. jsdom keeps focus on a disabled button where a browser does not, so the tab-order half is pinned on the attribute.Proof: not provable -- frontend test (prove.py runs Python only)
Manual verification
N/A — unit coverage sufficient: the test drives the real panel through a held clone and reads the button state, focus and request count.
Screenshots / video
Why no screenshot: the busy Clone looks like a disabled primary button, as it did; the change is that it stays in the tab order, which a still image cannot show.
Related Issues
Fixes #33102
Deferred: #33103
Sibling sweep
Swept: buttons in website/src/apps/auto-improvement disabled from their own in-flight mutation
Sibling: website/src/apps/auto-improvement/SetupPanel.tsx -- changed here (Clone); Run and Stop swap for each other when they succeed, so the pressed one unmounts either way
Sibling: website/src/apps/auto-improvement/AutoImprovementPage.tsx -- tracked in #33103 (finding Commit; open PR #30517 rewrites that flow)
Pattern harvest
Rule candidate: lint
Pattern: a button disabled from its own in-flight mutation while it stays mounted, which drops the focus of the user who pressed it
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project Apache-2.0 license.