Skip to content

fix(site/src/components): show a visible indicator on highlighted dropdown options - #30472

Merged
chrifro merged 1 commit into
mainfrom
a11y-combobox-highlight-contrast
Oct 8, 2026
Merged

chrifro merged 1 commit into
mainfrom
a11y-combobox-highlight-contrast

Conversation

@chrifro

@chrifro chrifro commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

Note

This PR was generated by Coder Agents on behalf of @chrifro.

In dropdowns built on cmdk, such as the /workspaces search and filter, keyboard focus stays in the input while the arrow keys move a highlight through the options. That highlight was only a background change of about 1.1:1 against the menu, so keyboard users couldn't tell which option Enter would pick. This fails WCAG 2.2 SC 2.4.7 Focus Visible and 1.4.11 Non-text Contrast.

Changes:

  • Highlighted options in FilterCombobox and the shared CommandItem now get a 2px inset content-link ring, the same blue as the focus ring on buttons and links. It contrasts 7.0:1 in dark mode and 4.7:1 in light mode.
  • The chip remove buttons (×) and the flyout option buttons now get the same focus-visible ring instead of the browser's default outline.

Before / after (/workspaces, Owner flyout opened with ArrowRight, then ArrowDown):

Before After
Dark before dark after dark
Light before light after light

For review: cmdk also highlights the row under the mouse, so the ring shows on hover too. cmdk doesn't record whether the pointer or the keyboard moved the highlight, so a keyboard-only ring would need extra state. I kept the ring for both because the highlighted row is always the one Enter picks.

Verification
  • Playwright on the dev server: /workspaces, keyboard only. The highlighted row's computed style now includes the inset blue box-shadow, and the chip remove buttons show the blue ring when they have focus.
  • pnpm lint passes.
  • vitest unit (Filter, Command, Combobox, aiModels, management): 9 files, 399 tests pass.
  • vitest storybook (same paths): 8 files, 140 tests pass.
  • make pre-commit passes.

…pdown options

Keyboard focus stays in the combobox input while arrow keys move a
highlight through the options. The highlight was only a background
change with about 1.1:1 contrast, so keyboard users could not see which
option Enter would pick (WCAG 2.4.7, 1.4.11).

Add a 2px inset content-link ring to highlighted cmdk items in
FilterCombobox and the shared CommandItem, and focus-visible rings to
the filter chip remove buttons and pointer flyout option buttons, which
relied on the browser default outline.
@chrifro
chrifro requested a review from jakehwll October 8, 2026 09:08
@chrifro
chrifro marked this pull request as ready for review October 8, 2026 09:08
@linear-code

linear-code Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

DEQ-569

DEQ-607

@chrifro
chrifro merged commit 95f5c4a into main Oct 8, 2026
55 of 56 checks passed
@chrifro
chrifro deleted the a11y-combobox-highlight-contrast branch October 8, 2026 14:09
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants