Repository navigation
fix(ui): check segmented options on keyboard navigation - #4163
Conversation
|
Independent review of With real keyboard input, navigation can leave focus on one option while another remains checked. A deterministic reproduction preserves this legal callback order: ArrowRight; execute its deferred focus (Failed is selected); ArrowLeft; execute the prior ArrowRight reset; execute ArrowLeft's deferred focus. Focus ends on All while Failed remains checked. The older zero-delay reset clears the newer key's intent before Radix handles focus. Unmodified timing also reproduced the mismatch twice. A bounded local fix and Chromium regression are in progress in an isolated review checkout. Please hold merge and avoid duplicate repair until that exact-head evidence is posted. No production worker or deployment was started; the current maintenance hold remains in effect. |
What changed
SegmentedControl now checks the option Radix focuses on ArrowRight/Left/Up/Down, Home or End. It preserves ordinary focus and Tab entry, one roving Tab stop, click/Space/Enter behavior, always-selected state and visual classes. Optional per-option disabling delegates to Radix so navigation skips disabled options.
Radix defers focus to a timer. Navigation intent remains active through that focus task, and each key gets an identity so an older reset cannot clear a newer key’s intent. Independent Chromium review reproduced that race in the initial implementation: Right focused and checked Failed, then Left focused All while Failed remained checked. The added browser regression deterministically exercises the legal timer ordering that caused it.
The website regression verifies that ArrowRight from All checks Failed, requests failed pages from offset 0 and replaces the displayed indexed page. Both website consumers’ callbacks remain unchanged. KNOW-F36’s automation register records the component and browser proof.
Verification
aria-checkedstayed false. The new real-Chromium race regression also failed on the initial PR head and passes after the guarded reset.@tale/uitypecheck, changed-file type-aware lint, formatting and manual register.The new focused checks reused retained dependencies without installs or a platform stack. The local unit run used a notes-only Vite allowlist for that isolated checkout’s shared dependency path. Retained Vitest 4.1.11 / browser 4.1.10 emit a version warning; the race also reproduced independently of Vitest in standalone Chromium. The browser fixture is component-level with a synthetic consumer; it does not claim a full live WebsiteViewDialog or visual/screen-reader review. Full final CI remains required before merge.
No UI strings, locale catalogs, migrations, security boundaries or visual classes changed.
Closes #4069