Repository navigation
fix(a11y): keep focus on ops mission control buttons while busy - #33673
bolichen97 merged 2 commits into
Conversation
e7e5c42 to
15e1b1f
Compare
|
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. |
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.
15e1b1f to
2204b23
Compare
|
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. |
Opus 5.5 Review (fork) — ✅ no blocking findingsReviewed |
Design Review (Opus 5.5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS No design-level concerns: it applies the merged #33131 Notes
[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 |
First Principles Review (Opus 5.5, fork) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. One undeclared change: a running decision now locks Approve/Deny on every incident, not just its own. Notes
What this change shipsInventory (6 items) — 5 justifiedIntent: keyboard users keep focus on Ops Mission Control buttons while their request runs. This is a FIX.
[FIRST-PRINCIPLES-REVIEWED] 2b829aa Description read[DESCRIPTION-READ] 44c7b279aa5fbd3d6298470aae7dfc44ce31e1557fad3ee10ebb9fef56bc1fd8 That sha256 names the PR description this verdict read. Recompute it with |
GPT 6.1 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
|
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 |
UX Review (Opus 5.5, fork) — ✅ 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 dimmed (busy/clean) Save, Approve/Deny and Claim buttons. The Evidence gaps
Notes
[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 |
…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.
46769e6 to
2b829aa
Compare
|
Fixed in 2b829aa (new head). The finding was correct: Approve/Deny share one page-wide |
bolichen97
left a comment
There was a problem hiding this comment.
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.
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
disabledattribute 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:OpsMissionControlPage.tsx: Approve and Deny on a drafted action (deciding), and Mark resolved (transitionMutation.isPending).SignalsPanel.tsx(claimMutation.isPending).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
/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.What changed (motivation -> approach -> change)
Symptom: focus jumps to the page body when a busy button is pressed. Root cause: native
disabledremoves the element from the tab order while the request is pending. Change: each listed button now usesaria-disabled={pending || undefined}witharia-disabled:style variants that reproduce the prior dimmed look, and claims the press in the handler (auseReffor 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
disabledtoaria-disabled+ handler guard.Tests
Updated
OpsSignalsPanelCoverage.test.tsx,OpsMissionControlPageCoverage.test.tsxandOpsMissionControlSettings.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 rendersaria-disablednot nativedisabled, keeps focus while the request runs, and refuses a second/clean press. Existing coverage tests that asserted nativedisabledon the changed buttons were updated to assertaria-disabledand 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 priordisabled: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
disabledwhile its own mutation is pending drops keyboard focus to the page body; preferaria-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_ratchetcounts 9 owner-marked pid readers insrcagainst 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.