Skip to content

fix(a11y): keep focus on ops mission control buttons while busy - #33673

Merged
bolichen97 merged 2 commits into
kirodotdev:mainfrom
chenmingwei23:fix/ops-mission-control-keep-focus-busy
Nov 9, 2026
Merged

bolichen97 merged 2 commits into
kirodotdev:mainfrom
chenmingwei23:fix/ops-mission-control-keep-focus-busy

Conversation

@chenmingwei23

@chenmingwei23 chenmingwei23 commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: A keyboard user who presses a busy button on the Ops Mission Control page keeps focus on that button while its request runs, instead of being dropped to the page body.

Across the Ops Mission Control page, a button set the native disabled attribute while its own request was in flight. A disabled element leaves the tab order, so a keyboard user who pressed one lost focus to the document body for the whole request and had to tab back from the top. The affected controls:

  • Incident actions on OpsMissionControlPage.tsx: Approve and Deny on a drafted action (deciding), and Mark resolved (transitionMutation.isPending).
  • Signal row Claim on SignalsPanel.tsx (claimMutation.isPending).
  • On SettingsPanel.tsx: Revoke stored credentials (revokeMutation.isPending), Revoke rule (saving), and the eight Save buttons (identity, each secret, Slack channel, repository, branch, on-call login, stale-after, needs-human-after) which are disabled both while the save runs and while the form is clean, so focus also dropped when a save landed and the field went clean.

Why it matters

Keyboard and screen-reader users operating the Ops Mission Control page lose their place every time they approve, deny, resolve, claim, revoke or save. For a page whose whole job is operators acting on live incidents, dropping focus mid-action is a real accessibility defect, not a cosmetic one. This is the same focus-drop class already fixed for the board Poll & claim button (#33131).

Not a goal

  • Redirecting focus to a sensible landing element AFTER a control unmounts or moves on success (e.g. the Claim row leaving the unclaimed list, an incident leaving /state). The swap here keeps focus on the button while the request runs, which is exactly what this issue asks for; a new post-unmount focus-management mechanism is a separate, larger concern and would risk changing the existing experience. If it is a real gap it belongs in a follow-up issue, not scope-crept here.
  • The add-rule (Grant) button is not in this issue's button list and is left unchanged.

What changed (motivation -> approach -> change)

Symptom: focus jumps to the page body when a busy button is pressed. Root cause: native disabled removes the element from the tab order while the request is pending. Change: each listed button now uses aria-disabled={pending || undefined} with aria-disabled: style variants that reproduce the prior dimmed look, and claims the press in the handler (a useRef for the mutation buttons, and an early-return on the clean/invalid condition for the Save buttons) so focus stays on the button and a second or clean press is refused. This mirrors the merged board Poll & claim fix (#33131) exactly.

The Save buttons were disabled on two conditions at once (clean OR saving). The full condition moves to aria-disabled, and the matching early-return guard is added to (or already present in) each handler so a clean press is a no-op rather than an unchanged re-save.

Backwards compatibility

Removes nothing: no API, type, field or key changes; this is a frontend-only attribute/handler swap on existing buttons. Behavior is preserved (dimmed look, press refused while busy/clean); only the mechanism changes from native disabled to aria-disabled + handler guard.

Tests

Updated OpsSignalsPanelCoverage.test.tsx, OpsMissionControlPageCoverage.test.tsx and OpsMissionControlSettings.coverage.test.tsx: added focus tests for an unmounting-on-success button during its request (signal-row Claim) and for a mounted button during its request (a Settings Save, plus Mark resolved), each asserting the button renders aria-disabled not native disabled, keeps focus while the request runs, and refuses a second/clean press. Existing coverage tests that asserted native disabled on the changed buttons were updated to assert aria-disabled and that a clean/invalid press fires no request.

Proof: not provable -- frontend test (prove.py runs Python only). Verified manually by reverting the three production files and running the three focus tests: all three fail (buttons render native disabled=""); with the fix they pass. Full ops-mission-control suite: 396 tests green.

Manual verification

N/A -- unit coverage sufficient. The focus behavior is asserted directly in jsdom (toHaveFocus, aria-disabled), and the change is a mechanical attribute/handler swap with no new rendered surface.

Screenshots / video

Why no screenshot: the dimmed busy/clean look is unchanged (the aria-disabled: style variants reproduce the prior disabled: styling); only the underlying attribute and tab-order behavior change, which a still image cannot show.

Related Issues

Closes #33115

Sibling sweep

Swept: git grep -nE "disabled={[^}]*(isPending|saving|deciding)" -- website/src/apps/ops-mission-control/
Sibling: website/src/apps/ops-mission-control/OpsMissionControlPage.tsx -- changed here (Approve, Deny, Mark resolved)
Sibling: website/src/apps/ops-mission-control/SignalsPanel.tsx -- changed here (Claim)
Sibling: website/src/apps/ops-mission-control/SettingsPanel.tsx -- changed here (2 Revoke + 8 Save)
Sibling: website/src/apps/ops-mission-control/SettingsPanel.tsx:add-rule Grant button -- not in this issue's list -- not affected (tracked by its own report if raised)
Sibling: board Poll & claim -- already fixed in #33131

Pattern harvest

Rule candidate: review-prompt
Pattern: a button that sets native disabled while its own mutation is pending drops keyboard focus to the page body; prefer aria-disabled + a handler guard so focus holds while the request runs.

CI note

The red Static Ratchet Gate (and the Fast Gate / Coverage Gate / readiness cascade behind it) is a pre-existing breakage on main, not from this change: test_pid_reader_ratchet counts 9 owner-marked pid readers in src against a recorded baseline of 8, so it fails on the merge ref of every open PR until the baseline is bumped to 9 in the same commit that added the ninth reader. This PR touches no Python, so it cannot affect that count, and the same red appears on unrelated open PRs built on current main. Once main records the new baseline, a re-run of Static Ratchet and its cascade clears these lanes.

@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: action required A blocking check or review needs attention labels Nov 9, 2026
@chenmingwei23
chenmingwei23 force-pushed the fix/ops-mission-control-keep-focus-busy branch from e7e5c42 to 15e1b1f Compare November 9, 2026 05:05
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (new head 15e1b1f). This pulls in #33665, which re-measured the App-chunk bundle-size ceiling, so the Bundle Size Gate now evaluates against the current budget. No change to the fix itself; net diff vs main is still just the three ops-mission-control source files plus their coverage tests.

@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
The incident Approve/Deny/Mark-resolved, signal-row Claim, the two Revoke
buttons and the eight Settings Save buttons all set native `disabled` while
their own request ran (and the Save buttons also while the form was clean), so
a keyboard user who pressed one lost focus to the page body for the whole
request. Each now uses `aria-disabled` (with the same dimmed look) and claims
the press in the handler, so focus stays on the button while the request runs
and a second press is refused, matching the board Poll & claim fix.
@chenmingwei23
chenmingwei23 force-pushed the fix/ops-mission-control-keep-focus-busy branch from 15e1b1f to 2204b23 Compare November 9, 2026 05:53
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (new head 2204b23). This pulls in #33695, which bumped the pid-reader ratchet baseline to 9, so the Static Ratchet Gate and the Fast Gate / Coverage cascade behind it now evaluate against a main that is itself green. No change to the fix; net diff vs main is still just the three ops-mission-control source files plus their coverage tests.

@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 2b829aa90692009c5f0d32d53c7379189868a555 via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 2b829aa

@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 2b829aa90692009c5f0d32d53c7379189868a555 via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

No design-level concerns: it applies the merged #33131 aria-disabled plus handler-guard pattern to this page's buttons, and the app is not adoption-pinned, so an in-place fix is allowed.

Notes

  • The description says "Behavior is preserved", but Approve/Deny now dim on the page-wide decideMutation.isPending instead of the per-incident deciding. That is a visible change, so state it in the PR description.

[DESIGN-REVIEWED] 2b829aa

Description read

[DESCRIPTION-READ] 7b9bf5941f6ee10ed4513ccc8e30e4315c0b56de8e2f9de805418c49a169b921

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

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

Premise-level review of 2b829aa90692009c5f0d32d53c7379189868a555 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

Nothing blocks. One undeclared change: a running decision now locks Approve/Deny on every incident, not just its own.

Notes

  • Item 2 — undeclared: the description says "Behavior is preserved", but the dim moves from the per-incident deciding to aria-disabled={decideMutation.isPending || undefined} behind one page-wide decideClaimed ref. So while incident A's decision runs, B's Approve/Deny are refused. On base they could be pressed. Subtraction: drop the page-wide lock. Keep deciding as the dim and refuse only a repeat press for the same inc.incident_id.

What this change ships

Inventory (6 items) — 5 justified

Intent: keyboard users keep focus on Ops Mission Control buttons while their request runs. This is a FIX.

  1. Approve/Deny, Mark resolved, Claim and both Revokes stay focusable while busy, and look dimmed the same as before — justified
  2. While any decision runs, Approve/Deny on every other incident are dimmed and refuse presses — undeclared
  3. The eight Save buttons stay focusable while their row is clean or saving — justified
  4. Pressing a clean or invalid Save sends nothing (the guard moved from disabled into the click handler, including heartbeat dirty and the identity check) — justified
  5. A second fast press on a busy button no longer sends a second request — justified
  6. The add-rule Grant button is left unchanged; this is declared, and the sweep finds 13 of 13 disabled={…isPending|saving|deciding} siblings changed — justified

[FIRST-PRINCIPLES-REVIEWED] 2b829aa

Description read

[DESCRIPTION-READ] 44c7b279aa5fbd3d6298470aae7dfc44ce31e1557fad3ee10ebb9fef56bc1fd8

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

GPT 6.1 Review (fork) — ✅ no blocking findings

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

Review details

No findings.
[GPT-REVIEWED] 2b829aa

@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

Copy link
Copy Markdown
Contributor Author

Fixed in 46769e6 (new head). The GPT 6.1 finding was correct: the two heartbeat Save buttons (stale-after, needs-human-after) route through a shared save helper that only checked secs === null || saving. Swapping them to aria-disabled made them focusable while clean, so on a derived install the untouched, seeded field could be persisted by one click and silently pin the derived window. The dirty check now lives inside save (it refuses the write unless the field actually changed), which also closes the Enter path the adjudication noted. Added a red-without-fix regression test: a seeded, untouched heartbeat Save press now sends no request.

@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

UX Review (Opus 5.5, fork) — ✅ PASS (a BLOCK with no Trigger and no Outcome does not block)

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

UX-Verdict: PASS

cannot evaluate: missing a screenshot of the dimmed (busy/clean) Save, Approve/Deny and Claim buttons. The no-visual-delta claim doesn't match the diff: Approve/Deny gain a new dimmed state, and the dimmed Save loses the rule that hid its hover shine.

Evidence gaps

  • Approve and run / Reject on a second incident while another decision runs. These buttons are now dimmed page-wide (aria-disabled={decideMutation.isPending || undefined}, which replaces the per-incident deciding). Before, incident B's buttons stayed fully lit; now they dim. This is a new visible state that the PR doesn't mention, and the image list is empty. To close it, attach a still of incident B's buttons dimmed while A's decision is pending.
  • Dimmed SendBtn Save/Replace in the eight Settings rows. The new aria-disabled: class string doesn't carry over disabled:after:hidden. The .btn-sweep:hover::after gradient shine was hidden on a disabled Save and now runs on a dimmed one, so the dimmed look has changed. To close it, attach a still of a clean (dimmed) Save while hovered, or add aria-disabled:after:hidden and attach the still.
  • Dimmed Btn rows (Mark resolved, Claim, Revoke stored credentials, Revoke rule). Their dimmed look now comes from new aria-disabled:opacity-30 classes, and no image shows it. To close it, attach one still of a dimmed Btn.

Notes

  • Btn keeps active:scale-[0.97], so a dimmed button still visibly "presses" while the click does nothing. Add aria-disabled:active:scale-100 to the shared class string so a refused press doesn't look like it was accepted.

[UX-REVIEWED] 2b829aa

Description read

[DESCRIPTION-READ] 119cd6e00325706fe89206e86fef909c570fc8601e753235936ffda82a32bf4b

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 .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 added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 9, 2026
…ires

Two follow-ups to the disabled -> aria-disabled swap, both found by review:

- Heartbeat Save (stale-after, needs-human-after): the shared `save` helper
  checked only secs===null||saving, so a focusable-while-clean Save could persist
  a seeded derived-install value on one click and silently pin the window. The
  dirty check now lives in `save`, closing the click and Enter paths.

- Approve/Deny: one page-wide `decideClaimed` ref guards both, but the dim used
  the per-incident `deciding`, so a second incident's buttons looked pressable
  while the shared lock silently dropped the press. The dim now tracks the
  page-wide `decideMutation.isPending`, matching the lock.
@chenmingwei23
chenmingwei23 force-pushed the fix/ops-mission-control-keep-focus-busy branch from 46769e6 to 2b829aa Compare November 9, 2026 07:11
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Fixed in 2b829aa (new head). The finding was correct: Approve/Deny share one page-wide decideClaimed ref, but their dim used the per-incident deciding, so while one incident's decision ran a second incident's buttons looked pressable even though the shared lock would drop the press. The dim now tracks the page-wide decideMutation.isPending for both buttons, so every pending proposal's Approve/Deny is visibly disabled while any decision is in flight. Added a red-without-fix regression test: with one decision running, a second incident's Approve/Deny render aria-disabled and send no request.

@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
@chenmingwei23
chenmingwei23 marked this pull request as ready for review November 9, 2026 07:51
@chenmingwei23
chenmingwei23 requested review from a team and KiroCrewCaptain as code owners November 9, 2026 07:51
@chenmingwei23
chenmingwei23 requested a review from Zedmor November 9, 2026 07:51
@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 Nov 9, 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 2b829aa. The busy buttons in Ops Mission Control (Mark resolved, Approve and run, Reject, Claim, Revoke and the revoke-rule button) and the Settings Save buttons now use aria-disabled instead of a native disabled, so a keyboard user keeps focus while the request runs or the row goes clean. The dim look stays through aria-disabled: classes.

Because an aria-disabled button still receives the click, I checked that each handler refuses the press itself: Mark resolved, Approve/Reject and Claim take a ref claim in the click (so two presses in one tick send one request), the Decide and Claim claims are page-wide and the dim follows the page-wide pending state, commitIdentity, the secret Save, the Slack Save, saveRemote, saveBranch, the on-call commit and the revoke buttons all return early when clean or in flight, and HeartbeatCard.save now takes the dirty flag so a click on a clean Save cannot pin a derived window. The tests cover focus held, the second press ignored, and the clean-press cases. No regex and no new restriction, and all 97 checks pass on this head.

@bolichen97
bolichen97 enabled auto-merge (squash) November 9, 2026 08:14
@bolichen97
bolichen97 merged commit 15220fb into kirodotdev:main Nov 9, 2026
98 checks passed
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 9, 2026
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.

Ops Mission Control busy buttons drop keyboard focus while their request runs

2 participants