Skip to content

fix(web): make SettingsPanel mode toggle keyboard/SR accessible (BEN-145) - #132

Merged
benSepanski merged 1 commit into
mainfrom
agent/ben-145
Aug 2, 2026
Merged

fix(web): make SettingsPanel mode toggle keyboard/SR accessible (BEN-145)#132
benSepanski merged 1 commit into
mainfrom
agent/ben-145

Conversation

@benSepanski

Copy link
Copy Markdown
Owner

Context

SettingsPanel's auto/manual polling toggle rendered the current option as disabled — 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 from MetricsPanel / Search filters.

TL;DR

Switch ModeToggle to the aria-pressed pattern used elsewhere so the current polling mode stays focusable and is announced as selected.

Summary

  • disabled on each mode button now reflects only the parent save state (saveState.tag === "saving"), not mode === m.
  • Add aria-pressed={mode === m} so screen readers announce the current selection consistent with MetricsPanel and Search filter chips.
  • Short-circuit the onClick when the clicked option is already active, so re-focusing the current mode does not fire a redundant PATCH /settings.

Demo

n/a — non-visual accessibility fix; no layout change. Visible styling of active vs. inactive is unchanged (cyan chip on active).

Alternatives

  • Full role="radiogroup" refactor with arrow-key navigation (ticket's Option 2). Rejected for now: heavier change than the surrounding pattern justifies; aria-pressed matches MetricsPanel / Search and closes the WCAG gap.
  • Keep disabled but add aria-pressed. Rejected: disabled still 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 builds
  • Manual SR check: tab through SettingsPanel, verify VoiceOver/NVDA announces the active option as "pressed"

Refs BEN-145.


Generated by Claude Code

…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
benSepanski marked this pull request as ready for review August 2, 2026 00:18
@benSepanski
benSepanski merged commit 05a05a7 into main Aug 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants