Repository navigation
fix(a11y): keep focus on the remaining issue radar buttons while busy - #33667
KiroCrewCaptain merged 1 commit into
Conversation
1d9f612 to
1ae570b
Compare
1ae570b to
59d1004
Compare
|
Rebased onto current main (new head Static Ratchet Gate remains red on a pre-existing main baseline mismatch ( |
59d1004 to
de1ddc7
Compare
|
Rebased onto current main (new head |
Opus 5.5 Review (fork) — ✅ no blocking findingsReviewed |
First Principles Review (Opus 5.5, fork) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS This fixes a real defect (Closes #33120) at the place it comes from. The new Notes
What this change shipsInventory (6 items) — 5 justifiedIntent: a keyboard or screen-reader user who presses an Issue Radar action button keeps focus on it while the action runs. FIX.
[FIRST-PRINCIPLES-REVIEWED] b5b0a85 Description read[DESCRIPTION-READ] d35d30d676148b6a3634aafdcb2ee887a73f9eacedbb129303ee20c90918db92 That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the change fixes the stated focus loss at its root (native Notes
[DESIGN-REVIEWED] b5b0a85 Description read[DESCRIPTION-READ] 2a38d8946039b332d1a6cd11202e81cd250fb29bb57b4953bab93602e4d55778 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 |
GPT 6.1 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
The CommentBox, PrActionsBar, PrRunActions, PrBulkBar and IssueDetail action buttons set native disabled while their own request ran, so a keyboard user who pressed one lost focus to the page body. Keep each focusable with aria-disabled + aria-busy and refuse the press until the action settles, matching the Investigate/Review button. A Btn gains an additive busy prop (default off, so every existing caller is unchanged) that carries this; native inline buttons use the same idiom inline. Buttons unavailable for another reason keep native disabled. The busy (aria-disabled) look is defined once as .busy-cue classes in focus-and-state-cues.css, mirroring each control's disabled surface, rather than repeating long aria-disabled:* utility strings per call site in the always-loaded JS chunk.
de1ddc7 to
b5b0a85
Compare
|
Both blocking findings addressed on new head
Net diff vs main is still the same 8 frontend files; no |
UX Review (Opus 5.5, fork) — ⏭️ skippedRevision |
Security Scope Review (fork) — 🔴 BLOCK (blocking)Which legitimate operations does no leg reported, and this was not the nothing-to-adjudicate short circuit No |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: fix (8 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: Issue Radar action buttons mark busy with aria-disabled and aria-busy instead of native disabled, so keyboard focus stays on the pressed button; the press is still refused while busy, and a test covers the Btn busy state.
…#33667) The CommentBox, PrActionsBar, PrRunActions, PrBulkBar and IssueDetail action buttons set native disabled while their own request ran, so a keyboard user who pressed one lost focus to the page body. Keep each focusable with aria-disabled + aria-busy and refuse the press until the action settles, matching the Investigate/Review button. A Btn gains an additive busy prop (default off, so every existing caller is unchanged) that carries this; native inline buttons use the same idiom inline. Buttons unavailable for another reason keep native disabled. The busy (aria-disabled) look is defined once as .busy-cue classes in focus-and-state-cues.css, mirroring each control's disabled surface, rather than repeating long aria-disabled:* utility strings per call site in the always-loaded JS chunk. Co-authored-by: kirocrew-agent <agent@kirocrew.local> Backport note: partial pick, carried as the prerequisite of #33729 and #33809. Only the Btn busy prop in components/ui.tsx, the .busy-cue rules in focus-and-state-cues.css and Btn.busyFocus.test.tsx are taken; the five website/src/apps/issue-radar component edits (app code, out of hotfix scope) are left out, so those buttons keep native disabled. (cherry picked from commit 94dfacd)
Problem / Motivation
Goal: A keyboard user who presses an Issue Radar action button keeps their focus on that button while its action runs, instead of being dropped to the page body.
Several Issue Radar buttons set the native
disabledattribute while their own request is in flight. A disabled button leaves the tab order, so the moment the press starts the work, the keyboard (or screen-reader) user who triggered it loses focus to<body>— they cannot see which control they were on, and any result or error that renders near the button opens with focus already lost.The affected buttons are the ones the issue lists:
CommentBox.tsx— Post / Add to batch (and the inline Cancel ✕), disabled whiledraft.busy.PrActionsBar.tsx— approve / request changes / comment / merge / auto-merge / reopen / close, disabled whileactions.busy.PrRunActions.tsx— per-run Cancel / Rerun, disabled whileactions.busy.PrBulkBar.tsx— bulk approve / comment / merge-ready / auto-merge / cancel / reopen / close / Apply, disabled whilebulk.busyorseq.busy.IssueDetail.tsx— the assignees self-assign control, disabled whileassigneesMutation.isPending.Why it matters
This is a keyboard and screen-reader accessibility regression on every action in the Issue Radar page: pressing any of these buttons silently steals focus. It is the same defect already fixed for the Investigate / Review header button (#33132) — this change finishes the remaining buttons on the page.
Not a goal
disabled.IssueDetail.tsxare not in this issue's list and are left as-is.What changed (motivation → approach → change)
Observed symptom: focus jumps to
<body>on press. Root cause: nativedisabledremoves the button from the tab order while the action runs. The fix mirrors #33132's approach — keep the button focusable witharia-disabled+aria-busyand refuse the press in the click handler until the work finishes.Because the CommentBox / PrActionsBar / PrBulkBar buttons all route through the shared
Btn(website/src/components/ui.tsx), the busy handling lives in exactly one place rather than being copy-pasted across ~14 call sites:Btngains an additive, optionalbusyprop (defaultfalse). When set it marks the buttonaria-disabled/aria-busy, swallows the click, and dims it witharia-disabled:*classes that mirror the existingdisabled:*opacities (so the busy appearance is unchanged). Each call site changes fromdisabled={block || busy}todisabled={block} busy={busy}, keeping nativedisabledfor the genuine-block part. The native inline buttons that do not useBtn(PrRunActions, the CommentBox ✕, the IssueDetail self-assign control) apply the same idiom inline, matching the established pattern inIssueList.tsx.Backwards compatibility
Removes nothing: the
busyprop onBtnis optional and defaults tofalse, so all 526 existingBtncall sites render byte-identically; no attribute is added whenbusyis unset.Tests
website/src/components/Btn.busyFocus.test.tsxlocks in the sharedBtnbusy contract that every converted call site relies on: a busy button stays focusable, isaria-disabled/aria-busybut not native-disabled, refuses clicks while busy, fires normally once the flag clears, and still accepts nativedisabledfor a non-busy block (including the both-blocked-and-busy case).Proof: PROVEN — reverting the
Btnbusyhunk makes the busy-contract assertions fail (aria-busyabsent;onClickfires while busy). prove.py not run (frontend test — prove.py runs Python only); verified by hand via stash-and-rerun.Manual verification
N/A — unit coverage sufficient. The focus behaviour is asserted directly (
toHaveFocus,not.toBeDisabled, click-refused) in the vitest test.Screenshots / video
Why no screenshot: the busy state dims with the same opacity as before (the
aria-disabled:*classes mirror the previousdisabled:*opacities), so there is no rendered difference — only the focus/tab-order behaviour changes.Related Issues
Closes #33120
Sibling sweep
Swept:
git grep -nE "disabled=\{[^}]*\b(busy|isPending)\b" -- website/src/apps/issue-radar/componentsdisabled={!canWrite || pending}— not affected — not listed in this issue; tracked separately if raisedPattern harvest
Rule candidate: review-prompt
Pattern: a focusable action button set to native
disabledwhile its own async action runs drops keyboard focus; usearia-disabled+aria-busy+press-guard and keep nativedisabledonly for genuine unavailability.CI notes
vite build --mode analyzewith this diff stashed in vs out produces a byte-identical raw App chunk, and origin/main fails the same budget by the same amount without this change. The busy-state styles were moved into a CSS class (.busy-cueinfocus-and-state-cues.css), a separate bundle off the App JS budget, so nothing is added to it here. The overage is pre-existing main drift; re-baselining the App budget is the budget owner's call on main, not this PR.test_pid_reader_ratchetbecause of a pre-existing main baseline mismatch (src/has 9 owner-marked pid readers vs_BASELINE_OWNER_MARKED = 8on origin/main). This is broken-main inherited by the merge-ref, not introduced here: the gate was SUCCESS on an earlier push of this branch and FAILURE on a later one with a frontend-only diff (8.ts/.tsx/.cssfiles, zero Python and zero pid-reader code). The baseline bump belongs to that file's owner on main.Await Fast GateandCoverage Gatecascade from this same failure.Checklist