Skip to content

fix(a11y): keep focus on the remaining issue radar buttons while busy - #33667

Merged
KiroCrewCaptain merged 1 commit into
kirodotdev:mainfrom
chenmingwei23:fix/issue-radar-keep-focus-busy
Nov 9, 2026
Merged

KiroCrewCaptain merged 1 commit into
kirodotdev:mainfrom
chenmingwei23:fix/issue-radar-keep-focus-busy

Conversation

@chenmingwei23

@chenmingwei23 chenmingwei23 commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

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 disabled attribute 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 while draft.busy.
  • PrActionsBar.tsx — approve / request changes / comment / merge / auto-merge / reopen / close, disabled while actions.busy.
  • PrRunActions.tsx — per-run Cancel / Rerun, disabled while actions.busy.
  • PrBulkBar.tsx — bulk approve / comment / merge-ready / auto-merge / cancel / reopen / close / Apply, disabled while bulk.busy or seq.busy.
  • IssueDetail.tsx — the assignees self-assign control, disabled while assigneesMutation.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

  • No change to any button that is disabled for a reason OTHER than being busy (e.g. an empty body, a row with no head commit, "no one can be armed"): those genuinely cannot be pressed and correctly stay native-disabled.
  • No visual or behavioural change beyond keeping the busy button focusable and refusing its press until the action settles.
  • The label-suggestion accept button and the overflow menu items in IssueDetail.tsx are 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: native disabled removes the button from the tab order while the action runs. The fix mirrors #33132's approach — keep the button focusable with aria-disabled + aria-busy and 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: Btn gains an additive, optional busy prop (default false). When set it marks the button aria-disabled/aria-busy, swallows the click, and dims it with aria-disabled:* classes that mirror the existing disabled:* opacities (so the busy appearance is unchanged). Each call site changes from disabled={block || busy} to disabled={block} busy={busy}, keeping native disabled for the genuine-block part. The native inline buttons that do not use Btn (PrRunActions, the CommentBox ✕, the IssueDetail self-assign control) apply the same idiom inline, matching the established pattern in IssueList.tsx.

Backwards compatibility

Removes nothing: the busy prop on Btn is optional and defaults to false, so all 526 existing Btn call sites render byte-identically; no attribute is added when busy is unset.

Tests

website/src/components/Btn.busyFocus.test.tsx locks in the shared Btn busy contract that every converted call site relies on: a busy button stays focusable, is aria-disabled/aria-busy but not native-disabled, refuses clicks while busy, fires normally once the flag clears, and still accepts native disabled for a non-busy block (including the both-blocked-and-busy case).

Proof: PROVEN — reverting the Btn busy hunk makes the busy-contract assertions fail (aria-busy absent; onClick fires 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 previous disabled:* 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/components

  • Sibling: website/src/apps/issue-radar/components/CommentBox.tsx — changed here
  • Sibling: website/src/apps/issue-radar/components/PrActionsBar.tsx — changed here
  • Sibling: website/src/apps/issue-radar/components/PrRunActions.tsx — changed here
  • Sibling: website/src/apps/issue-radar/components/PrBulkBar.tsx — changed here
  • Sibling: website/src/apps/issue-radar/components/IssueDetail.tsx — changed here (self-assign control)
  • Sibling: website/src/apps/issue-radar/components/IssueDetail.tsx:193 — label-suggestion accept, disabled={!canWrite || pending} — not affected — not listed in this issue; tracked separately if raised
  • Sibling: website/src/apps/issue-radar/components/AgentSessionButton.tsx — not affected — already fixed by fix(a11y): keep focus on the Investigate and Review buttons while busy #33132

Pattern harvest

Rule candidate: review-prompt
Pattern: a focusable action button set to native disabled while its own async action runs drops keyboard focus; use aria-disabled+aria-busy+press-guard and keep native disabled only for genuine unavailability.

CI notes

  • Bundle Size Gate (App chunk): the App chunk is ~3.2 KB over its budget on origin/main itself. This PR's App-chunk delta is zero: a vite build --mode analyze with 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-cue in focus-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.
  • Static Ratchet Gate: fails on test_pid_reader_ratchet because of a pre-existing main baseline mismatch (src/ has 9 owner-marked pid readers vs _BASELINE_OWNER_MARKED = 8 on 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/.css files, zero Python and zero pid-reader code). The baseline bump belongs to that file's owner on main. Await Fast Gate and Coverage Gate cascade from this same failure.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable) — N/A
  • No secrets, credentials, or internal references in the diff

@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: checking Automated validation is still running labels Nov 9, 2026
@chenmingwei23
chenmingwei23 force-pushed the fix/issue-radar-keep-focus-busy branch from 1d9f612 to 1ae570b Compare November 9, 2026 04:22
@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 Nov 9, 2026
@chenmingwei23
chenmingwei23 force-pushed the fix/issue-radar-keep-focus-busy branch from 1ae570b to 59d1004 Compare November 9, 2026 04:58
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (new head 59d10048aebdeea6ac744ed0a322a796f4ca8901), which pulls in the App-chunk budget re-measure from #33665, so the Bundle Size Gate now fits. Net diff vs main is unchanged (the 8 frontend files), no budget or baseline edits.

Static Ratchet Gate remains red on a pre-existing main baseline mismatch (test_pid_reader_ratchet, documented in the description) and will stay so until that baseline is bumped on main; it is not from this PR.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 9, 2026
@chenmingwei23
chenmingwei23 force-pushed the fix/issue-radar-keep-focus-busy branch from 59d1004 to de1ddc7 Compare November 9, 2026 05:53
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (new head de1ddc7e012f8ea93584c8dc465cb918123b3548), which now carries the test_pid_reader_ratchet baseline bump, so the Static Ratchet Gate break is resolved upstream. The Bundle Size Gate budget re-measure is also in. Net diff vs main is unchanged (the same 8 frontend files), no .py, baseline, or budget edits.

@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 Nov 9, 2026
@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review (fork) — ✅ no blocking findings

Reviewed b5b0a85d6dc8e8792fa7e4041bab21a0a538f2b9 via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] b5b0a85

@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5, fork) — ✅ PASS

Premise-level review of b5b0a85d6dc8e8792fa7e4041bab21a0a538f2b9 via the fork AI-review pipeline — 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

This fixes a real defect (Closes #33120) at the place it comes from. The new Btn busy prop has about 20 converted call sites, and no default or product shape changes.

Notes

  • Item 2 — symptom-level: Btn now has busy, but 7 Btn call sites still write the same behaviour out by hand with aria-disabled={x} aria-busy={x} and their own click guards: pages/ChannelPage.tsx:541,689, pages/knowledge/DetailView.tsx:342-344, pages/HooksPage.tsx:736,833. That leaves two ways of saying "busy" on the same component. Subtraction: remove those inline aria-disabled/aria-busy/guard/aria-disabled:* class strings and pass busy instead. Doing that sweep later is fine.

What this change ships

Inventory (6 items) — 5 justified

Intent: a keyboard or screen-reader user who presses an Issue Radar action button keeps focus on it while the action runs. FIX.

  1. Issue Radar comment Post / Add to batch / ✕ stay focusable while posting — justified
  2. Shared Btn gains a busy prop that keeps the button focusable, sets aria-busy and refuses clicks — symptom-level: 7 hand-written sites elsewhere left unconverted
  3. PR action-bar buttons (approve/comment/merge/auto-merge/reopen/close) stay focusable while busy — justified
  4. Bulk-bar buttons and Apply stay focusable while busy — justified
  5. Per-run Cancel / Rerun and the self-assign control stay focusable while busy — justified
  6. New .busy-cue[data-busy] CSS keeps the busy look the same as the old disabled look — justified

[FIRST-PRINCIPLES-REVIEWED] b5b0a85

Description read

[DESCRIPTION-READ] d35d30d676148b6a3634aafdcb2ee887a73f9eacedbb129303ee20c90918db92

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 Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5, fork) — ✅ PASS

Design-level review of b5b0a85d6dc8e8792fa7e4041bab21a0a538f2b9 via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: the change fixes the stated focus loss at its root (native disabled on a busy button) through one optional Btn prop, and existing callers keep their behaviour.

Notes

  • focus-and-state-cues.css copies by hand the disabled:* look of each Btn variant into .busy-cue* rules, so the two can drift apart silently. The description says there is "no rendered difference", but the new rule sets cursor:default where disabled:cursor-not-allowed applied before. Either match it or note the change.
  • Issue Radar is a built-in app being moved out under Move every built-in app out to KiroCrewApps and forbid built-in apps #26967. It is not pinned in apps/adoption-pins.json today, so fixing it in place is allowed. Once it is pinned, the per-app call-site edits land in its app repo first, and only the generic Btn busy prop stays in core.

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

Copy link
Copy Markdown
Contributor

GPT 6.1 Review (fork) — ✅ no blocking findings

Reviewed b5b0a85d6dc8e8792fa7e4041bab21a0a538f2b9 via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] b5b0a85

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.
@chenmingwei23
chenmingwei23 force-pushed the fix/issue-radar-keep-focus-busy branch from de1ddc7 to b5b0a85 Compare November 9, 2026 06:06
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Both blocking findings addressed on new head b5b0a85d6dc8e8792fa7e4041bab21a0a538f2b9:

  • Design Review (busy look reached buttons that were never given busy): the .busy-cue* CSS now keys on a data-busy attribute that is set ONLY while the busy prop is on, instead of [aria-disabled="true"]. Btn still carries the busy-cue class on every render, but the styles no longer match a caller that sets its own aria-disabled for a non-busy reason. Added a test asserting a plain <Btn aria-disabled> carries no data-busy and no busy styling hook.

  • GPT 6.1 (busy hover reset erased keyboard focus): the box-shadow resets are now gated :hover:not(:focus-visible) (and the primary variant's box-shadow:none is split out under :not(:focus-visible)), the same pattern this file already uses for .swatch-cue. A keyboard-focused busy button keeps its .focus-ring box-shadow, so the focus indicator is no longer lost.

Net diff vs main is still the same 8 frontend files; no .py, baseline, or budget edits.

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5, fork) — ⏭️ skipped

Revision b5b0a85d6dc8e8792fa7e4041bab21a0a538f2b9 touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Does not block merge.

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Security Scope Review (fork) — 🔴 BLOCK (blocking)

Which legitimate operations does b5b0a85d6dc8e8792fa7e4041bab21a0a538f2b9 newly refuse? Model proposes, scripts/deny_diff.py decides — updated in place on each push. A script-confirmed regression blocks PR readiness.

no leg reported, and this was not the nothing-to-adjudicate short circuit

No [SCOPE-REVIEWED] marker for this head was produced, so the model's text is withheld: it cannot be shown to describe this revision. See the job logs.

@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 Nov 9, 2026
@chenmingwei23
chenmingwei23 marked this pull request as ready for review November 9, 2026 07:11
@chenmingwei23
chenmingwei23 requested review from a team and KiroCrewCaptain as code owners November 9, 2026 07:11
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 9, 2026
@KiroCrewCaptain
KiroCrewCaptain enabled auto-merge (squash) November 9, 2026 09:03

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

@KiroCrewCaptain
KiroCrewCaptain merged commit 94dfacd into kirodotdev:main Nov 9, 2026
104 of 107 checks passed
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 9, 2026
bolichen97 pushed a commit that referenced this pull request Nov 10, 2026
…#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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issue Radar: more action buttons drop keyboard focus while their action runs

2 participants