Skip to content

Accessibility drill, round 2: focus, keyboard and announcements - #213

Merged
lorant-one merged 3 commits into
previewfrom
fix/a11y-keyboard-round-2
Oct 18, 2026
Merged

lorant-one merged 3 commits into
previewfrom
fix/a11y-keyboard-round-2

Conversation

@lorant-one

Copy link
Copy Markdown
Member

Before: Tab could escape or skip inside dialogs, and opening a dialog left focus behind it. Select options had no visible keyboard focus, and hover tooltips could not be opened from the keyboard. Every Feedback callout was read out as an alert. Gauges were silent to screen readers, and animations ignored the reduced-motion setting.

After: Tab cycles through a dialog in page order, and focus moves into the dialog when it opens. Keyboard focus is visible on options, and InfoTip opens with Enter or Space. Only danger and warning Feedback interrupt. Gauges are named meters. With reduced motion turned on, transitions end at once, but the loading spinner keeps turning.

How: Dialog and FocusTrap share one nextInTrap helper that skips tabindex="-1". ToggleButton now defaults to type="button" and sets aria-pressed. Button and IconButton set aria-busy while loading. DropdownWrapper puts the button role on the element that takes focus. ContextMenu closes on Escape. A global prefers-reduced-motion block in foundations covers the motion, and data-motion="essential" lets an element opt out. The new cases are pinned in a11y-drill.test.tsx.

Left alone on purpose: Chip without onClick stays a toggle button. Existing tests pin that, so changing it waits for 3.0.


Generated by Claude Code

- Dialog and FocusTrap: Tab walks tabbables in document order and wraps;
  focus moves into a dialog when it opens.
- Select keeps an uncontrolled value and focuses its search field reliably;
  options show a visible keyboard focus.
- InfoTip and other hover triggers open with Enter and Space.
- ToggleButton defaults to type="button" with aria-pressed; Button and
  IconButton set aria-busy while loading.
- DropdownWrapper puts the button role on the element that takes focus.
- ContextMenu closes on Escape and marks disabled state.
- Feedback: danger/warning are alerts, info/success polite status.
- LinearGauge and RadialGauge are named meters with unique gradient ids.
- Reduced motion: transitions and animations end at once under
  prefers-reduced-motion; Spinner opts out as essential motion.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_0183UV8SQBGYKctRTFAv64N8
@lorant-one lorant-one added the no-demo label Oct 18, 2026 — with Claude
@lorant-one lorant-one self-assigned this Oct 18, 2026
@vercel

vercel Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
core-docs Ignored Ignored Preview Oct 18, 2026 8:13am UTC

The docs example checker types a snippet with no Once UI import against
core, where ThemeProvider has no insets and Column no safeArea, so the
docs build on preview went red once both #204 and #206 were in.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_0183UV8SQBGYKctRTFAv64N8

Copy link
Copy Markdown
Member Author

Docs build was red for a reason outside this PR. Preview has it red too, ever since #204 (native safe areas) and #206 (example checker) both landed. The checker types the safe-area snippet in native/overview.mdx against core, because the snippet imports nothing from Once UI. That fails with TS2322 on insets and safeArea.

The fix is ported here in 2e43146: the snippet now imports Column and ThemeProvider from @once-ui-system/native. With that, check:docs reports 0 problems locally. The same commit also merges preview.


Generated by Claude Code

@lorant-one
lorant-one merged commit c8355b6 into preview Oct 18, 2026
7 checks passed
@github-actions github-actions Bot mentioned this pull request Oct 18, 2026
30 tasks done
@lorant-one
lorant-one deleted the fix/a11y-keyboard-round-2 branch October 29, 2026 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants