Repository navigation
fix(settings): one keyboard stop per settings switch, with on/off - #37953
Conversation
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. The fix removes the cause, which is the row being drawn as a What this change shipsInventory (7 items) — 7 justifiedIntent: let a keyboard or screen-reader user reach each Settings switch in one Tab stop that announces its name, its on/off state and what it does. FIX.
[FIRST-PRINCIPLES-REVIEWED] ec2dc60 Description read[DESCRIPTION-READ] e4b6fe53d40908ddf960fe3ce9b77bd370a88683459195b0e78236df7442b295 That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS No design concerns. The row is no longer a button wrapped around the switch: the switch is the one control and its label is stretched over the row, so a click anywhere on the row still flips it. Screenshots and a recording are attached. Notes
[DESIGN-REVIEWED] ec2dc60 Description read[DESCRIPTION-READ] 1214b4659f013be7d98a5b50bc934d5f80e96d972aa17293e8f4734e51d93cf1 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 |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing blocks: the row looks the same, and the blind reader read the switch and its keyboard focus ring correctly ("clicking one flips it on or off -> sure -> yes"). Notes
[UX-REVIEWED] ec2dc60 Description read[DESCRIPTION-READ] 49e2883d9941f3f09f5292445e1bcd67070ed6287c748e0793fad700464094e0 That sha256 names everything this verdict read: the PR description, plus the 5 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 |
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: |
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: |
4aec1eb to
40663b6
Compare
40663b6 to
9d69921
Compare
|
Rebased onto d2f22f2. The one red check on the previous head, Backend Tests (Windows) (6), was |
9d69921 to
4daf175
Compare
|
self-added: yes
|
4daf175 to
5d26657
Compare
|
self-added: yes
|
|
One red check on the previous head, Backend Tests (3.12, 5), was |
A settings switch row was a button with the switch inside it. Every row took two Tab presses, and the first stop read out as "label, description, button" with no on or off. The switch is now the only control. It is a real button, the name beside it is its label, and the label is stretched over the row so a click anywhere on the row still presses the switch. The row has no role, no tab stop and no click handler. The switch carries the name, the on/off state and the row's description (the row's own text first, then the caller's note). "Include recent logs" in Report a problem had no name; it is now named after its visible label and described by its hint. Closes #37951
5d26657 to
ec2dc60
Compare
|
Rebased: main moved in The commit is unchanged ( |
Code change approver recommendation: ApproveWhy: the decider estimates a 10% chance that this change introduces a defect, within the 12% limit for approving on its own, and every check passes. The PR replaces the Clickable row around each settings switch with a plain div. The row's name becomes a stretched over the row, and the shared Toggle becomes a . I verified the following in the code. Key handling cancels the button's own press, so Enter and Space flip the switch once. The inert guard stays in onClick, so a disabled or busy switch ignores clicks that arrive through the label. The tip, the switch, and links and buttons in descriptions are positioned above the label's click layer. No in-tree caller wraps Toggle in a label, button or clickable row, and every SettingsToggle description I traced is text or a badge. Readers of data-setting-* anchors, [role=switch] lookups, and handlers that skip clicks on buttons still work. The new test file covers the behaviour, the updated tests match the new describedby order, and CI is fully green. Minor notes: print-preview CSS hides buttons, the SDK docs should mention the element change, and only Chromium was checked by hand. An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Approving. Checks on ec2dc60:
- The settings row is no longer a button wrapped around a switch. A
<label htmlFor>stretched over the row keeps the whole row clickable, with one tab stop and one handler. inertstill blocks a label click on a busy row.- All 33 Toggle callers sit in flex or grid parents, and none is nested in a label or button.
type="button"keeps the switch from submitting a form.- Six of the nine new tests fail on main.
- PR Readiness is green.
Done well: the fromHint and stopPropagation workaround is deleted, not added to.
- Optional: drop Toggle's
onKeyDown(ui.tsx:507) and let the native button turn Space and Enter into a click. As written, each press flips once only where cancelling the Space keydown also cancels the click on keyup. That holds in Chromium, but Firefox and Safari were not checked. - Optional: pin
type="button"with a test that clicks a switch inside a<form onSubmit>and expects no submit. - Optional: say in the app-kit docs that Toggle is now a
<button>and must not sit inside another button or a label. Also correct the body: the unit test does not prove that a link inside a description stays clickable in a browser.
Ports every change the built-in got after the af94fac51f sync, so an adopted record keeps what a built-in user has: - the ledger's episode import into Crew's memory is skipped while a memory provider replaces it (kirodotdev/KiroCrew#37218), through a new memory_provider row of the host table; a gateway without the resolver indexes nothing - the Japanese strings without the stray source line breaks (kirodotdev/KiroCrew#38368) - two comment-only changes (kirodotdev/KiroCrew#37469, kirodotdev/KiroCrew#37953) The test pin and docs/spec.md move to KiroCrew main 2e2503671f, and the fixtures follow the host's scrubber (kirodotdev/KiroCrew#37408) and the gh PATH probe pin (kirodotdev/KiroCrew#37597). PORTING.md has a row per core change and records that the pin needs App Kit level 10, where the agent's file-tool gate fences the credentialMasks directory (kirodotdev/KiroCrew#37459). Part of kirodotdev/KiroCrew#26967. Co-authored-by: KiroCrewCaptain <312312717+KiroCrewCaptain@users.noreply.github.com>
Problem / Motivation
Goal: Each switch in Settings is one keyboard stop, and that stop tells a screen reader its name, whether it is on, and what it does.
Today every switch row is a button with the switch inside it. Tab stops on the row first. A screen reader reads "label, description, button" there, with no on or off, and Enter flips the setting anyway. Tab then stops a second time on the switch itself, which says on or off but not what the setting does.
One more switch has no name at all: "Include recent logs" in Report a problem reads as "switch, on".
Why it matters
A keyboard user presses Tab twice for every switch in Settings. A screen-reader user cannot tell from the first stop whether a setting is on, and can flip it from there without hearing the result.
SettingsToggleis used 166 times inwebsite/src, and apps get the same row through@kirocrew/app-sdk/ui.Not a goal
labelrequired on the sharedToggletype.Toggleis exported to apps through@kirocrew/app-sdk/ui, so that is a type change for every app and a separate decision.What changed (motivation → approach → change)
The row was drawn with
Clickable, which makes itrole="button"with a tab stop. The switch inside already had its own role, state and keys, so the row's button was a second control around the first.The switch is now the only control, and the name beside it is its
<label>. A label needs something it can be tied to, so the shared switch becomes a real<button role="switch">. The label is stretched over the row in CSS, so a click anywhere on the row still presses the switch. The row itself has no role, no tab stop and no click handler.website/src/components/settings.tsx)<label>, covering the rowToggleinwebsite/src/components/ui.tsx)div role="switch"button role="switch"; same size, same keysaria-busywhile savingwebsite/src/components/ReportProblemModal.tsx)The "?" tip, the switch, and any link or button inside a description sit above the label's click layer, so each is pressed itself. The row's text comes first in the description because that is the order on screen.
A comment in
website/src/apps/ops-mission-control/SettingsPanel.tsxsaid the switch was adivthat a label could not be tied to; it now says only what still holds.Backwards compatibility
Compatible:
SettingsToggleandTogglekeep their props (Togglegains an optionalid), the row keeps itsdata-setting-*anchors, and every press that flipped a switch before flips it once now. Two things change shape: the switch element is a<button>where it was a<div>(same role, name and state), and the row can no longer be focused or pressed with Enter; the switch, one Tab press later, already took the same keys.Reader: website/src/hooks/useSettingHighlight.ts:settingAnchorSelector -- dashboard -- finds rows by
data-setting-id/-key/-label, which stay on the row;settings.anchors.test.tsxReader: website/src/guide/findByName.ts:OPERABLE_ROLES -- dashboard -- matches
[role="switch"], so a guide still finds the control by its name;src/guidetests passReader: website/src/components/modelPickerKeyRouting.ts -- dashboard -- finds switches by
[role="switch"], not by tag; the 17 model-picker test files passReader: website/src/kirocrew-ui/index.ts:Toggle,SettingsToggle -- app -- same props; an app's switch is a button with the same role, and its row is one stop
Reader: website/src/test/AboutPanel.autoDownloadToggle.test.tsx -- dashboard -- found the row with
closest('[role="button"]'); it now uses[data-setting-label]Reader: website/src/test/previewSurfaces.test.tsx -- dashboard -- counts
<button>elements as ways into a page; a switch is now a button, so it is left out by its roleTests
Proof: not provable -- frontend test (prove.py runs Python only)
By hand instead:
SettingsToggle.oneTabStop.test.tsxrun onmain(529da1e) fails 6 of its 9 tests; on this branch all 9 pass.website/src/test/SettingsToggle.oneTabStop.test.tsx(new): two rows between two buttons take exactly one Tab press each; no button wraps the switch; the switch reports its state and "row text, then caller's note" as its description; a row with no text has no description; Space, Enter, a press on the label and a press on the switch each flip exactly once; the name is a<label>tied to the switch; a disabled row ignores a press on its label; a link in a description is pressed itself and does not flip the switch; Enter on the "?" tip opens the tip and does not flip; the Report a problem switch has a name and a description.website/src/components/settings.anchors.test.tsx: the two tests that asserted "the row is a button" now assert the row has no role, no tab stop and noaria-busy, and that a press on the label reaches the switch.InfoTip.settingsRow.test.tsx: presses the row's label where it pressed the row container.NotificationsPanel.test.tsx,PrivacyPanel.recordMetrics.test.tsx,SessionEnvironmentsCard.test.tsx: these readaria-describedbyas one id; they now expect the row's text first.AboutPanel.autoDownloadToggle.test.tsx: finds the row by its anchor.previewSurfaces.test.tsx: its count of buttons that lead into a page leaves switches out.Determinism: seven of the eight changed test files, 20 runs with
--sequence.shuffleand seeds 5053 to 6060 in steps of 53: 20 of 20 pass, 187 tests each. The eighth,previewSurfaces.test.tsx, passes 20 of 20 in its own order. Shuffled, a test this PR does not touch in that file ("lists Crew Members in the advertised surfaces on a default install") fails with seeds 5053 and 5106, and fails the same way onmainat 529da1e with those seeds.Related sets run locally: the repository's scoped runner (23 files, 477 tests) passes. Every test that imports a module drawing a
Toggleor aSettingsToggle(337 files, 7045 tests): all pass. Tests that look up raw<button>elements or tag names outside that set (265 files): 260 pass; the other 5 files (SchedulePage.secrets,ChatInput.approval,DiffBlock.headerOwnership,PierreImpl.workerPool,CrewChatWindow) fail on this machine, the first four with the same counts onmainwithout this change and the fifth on and off on both trees.tsc -p tsconfig.app.jsonand eslint on the changed files pass. The whole suite, the production build and Playwright were not run locally.Manual verification
Chromium, driven by real key presses and mouse clicks, against a Vite dev server on loopback. The API is the repository's fixture stub (
website/scripts/lib/stub-dashboard-api.mjs): no gateway, no model. Before ismainat 529da1e, after is this branch.nested-interactivenodes, before → after/settings/chat/settings/display/settings/privacy/settings/aboutEvery way to press a row, on Settings > Chat. Each press flips the switch exactly once, before and after:
aria-required-attr1,landmark-unique1,heading-order1) are the same before and after.Toggle, other than the Report a problem dialog.Screenshots / video
Nothing changes at rest. Seven states,
mainon the left and this branch on the right, each pair compared pixel by pixel: rows at rest (two on, two off), a switch focused by Tab, a row hovered, rows with a description, a dimmed row, and the standalone switch in the Report a problem dialog, on and off. Six pairs are identical; the focused pair differs in one pixel on the ring's corner.Full pages (1280×2200, nothing focused): Chat is pixel-identical before and after. Privacy and About differ only in a 2×24 px strip of the settings sidebar that also differs between two runs of the same build. Display differs in 45 pixels by at most 3 of 255 levels, on the edges of two controls this change does not touch (a side-rail item and the Interface picker); it repeats in every run and is not visible.
What does change is where keyboard focus lands. One frame per Tab press, both builds side by side:
Recorded from 529da1e (before) and this branch's tree (after) · Chromium, real key presses and clicks · Vite dev server on loopback · fixture API stub, no gateway. Four switch rows take 12 presses before and 8 after.
Related Issues
Closes #37951
Sibling sweep
Swept: every
<Clickable>…</Clickable>block inwebsite/src(81 files) for<Toggle,<SettingsToggleorrole="switch"inside it, and every literalrole="button"with a switch in the next 40 linesSwept: every
<Togglefromcomponents/ui(45) for a missinglabel, and every literalrole="switch"(23) for a missing nameSibling: website/src/components/ReportProblemModal.tsx:138 -- changed here
Sibling: website/src/components/Clickable.tsx -- not affected -- after this change no other
Clickableblock orrole="button"inwebsite/srcwraps a switchPattern harvest
Rule candidate: lint
Pattern: a control with its own role (switch, button, link) rendered inside
Clickableorrole="button"Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)