Skip to content

fix(a11y): add ARIA combobox pattern to command palette and quick open#21

Open
Alexi5000 wants to merge 1 commit into
OpenKnots:mainfrom
Alexi5000:pr/aria-command-palette
Open

fix(a11y): add ARIA combobox pattern to command palette and quick open#21
Alexi5000 wants to merge 1 commit into
OpenKnots:mainfrom
Alexi5000:pr/aria-command-palette

Conversation

@Alexi5000
Copy link
Copy Markdown

Summary

Adds WAI-ARIA combobox/dialog pattern to the Command Palette and Quick Open overlays for screen reader accessibility.

Problem

Both command-palette.tsx and quick-open.tsx implement keyboard-navigable picker UIs (Up/Down/Enter/Esc) with zero ARIA attributes. Screen readers cannot identify these as dialogs, cannot associate the search input with results, and cannot announce the currently selected item.

Changes

Component Attributes Added
Command Palette container role="dialog", aria-modal="true", aria-label="Command palette"
Command Palette input aria-label, aria-autocomplete="list", aria-controls, aria-activedescendant
Command Palette list id, role="listbox", aria-label
Command Palette items id, role="option", aria-selected
Quick Open container role="dialog", aria-modal="true", aria-label="Go to file"
Quick Open input aria-label, aria-autocomplete="list", aria-controls, aria-activedescendant
Quick Open list id, role="listbox", aria-label
Quick Open items id, role="option", aria-selected

No visual or behavioral changes. Purely assistive technology support following WAI-ARIA Authoring Practices for combobox with listbox.

Test Plan

  • pnpm check passes (no type errors)
  • Command palette opens with Cmd+K, navigates with arrows, selects with Enter
  • Quick open opens with Cmd+P, navigates with arrows, selects with Enter
  • VoiceOver/NVDA announces selected items when arrowing through

Both picker overlays lacked ARIA attributes, making them invisible to
screen readers. This adds:

- role=dialog + aria-modal + aria-label on the overlay container
- aria-autocomplete=list + aria-controls on the search input
- aria-activedescendant pointing to the currently highlighted item
- role=listbox on the results container
- role=option + aria-selected on each result item

No visual or behavioral changes — purely assistive technology support.
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.

1 participant