fix(web): make SettingsPanel mode toggle keyboard/SR accessible (BEN-145) - #132
Merged
Conversation
…145)
The current polling mode was rendered as disabled=true, which meant
keyboard users could not tab onto it and screen readers announced the
current setting as "dimmed" instead of "pressed". Only the inactive
option was reachable — inverting user expectations vs. MetricsPanel /
Search filters, which use aria-pressed.
Switch the ModeToggle to the same pattern:
- disabled reflects only the parent save state, not the current mode
- add aria-pressed={mode === m} so SR announces the current option
- short-circuit onClick when clicking the already-active option so we
don't fire a redundant PATCH /settings
Refs BEN-145.
benSepanski
marked this pull request as ready for review
August 2, 2026 00:18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
SettingsPanel's auto/manual polling toggle rendered the current option asdisabled— so keyboard users could not tab onto the active setting and screen readers announced it as "dimmed" instead of "pressed". Breaks WCAG expectations and diverges fromMetricsPanel/Searchfilters.TL;DR
Switch
ModeToggleto thearia-pressedpattern used elsewhere so the current polling mode stays focusable and is announced as selected.Summary
disabledon each mode button now reflects only the parent save state (saveState.tag === "saving"), notmode === m.aria-pressed={mode === m}so screen readers announce the current selection consistent withMetricsPanelandSearchfilter chips.onClickwhen the clicked option is already active, so re-focusing the current mode does not fire a redundantPATCH /settings.Demo
n/a — non-visual accessibility fix; no layout change. Visible styling of active vs. inactive is unchanged (cyan chip on active).
Alternatives
role="radiogroup"refactor with arrow-key navigation (ticket's Option 2). Rejected for now: heavier change than the surrounding pattern justifies;aria-pressedmatchesMetricsPanel/Searchand closes the WCAG gap.disabledbut addaria-pressed. Rejected:disabledstill blocks focus and screen-reader announcement, so it doesn't solve the reported issue.Test Plan
pnpm all— typecheck + fmt:check + lint + test + eval (336 tests + 5 evals green)pnpm build:web— web bundle buildsRefs BEN-145.
Generated by Claude Code