Skip to content

ux: keyboard-navigable SelectMenu + replace native selects - #245

Merged
omercelikdev merged 1 commit into
mainfrom
ux/selectmenu-keyboard-and-conversion
Jul 12, 2026
Merged

ux: keyboard-navigable SelectMenu + replace native selects#245
omercelikdev merged 1 commit into
mainfrom
ux/selectmenu-keyboard-and-conversion

Conversation

@omercelikdev

Copy link
Copy Markdown
Owner

The accent-colored SelectMenu had no keyboard support, so native <select>s (which open a macOS-blue system popup that clashes with the orange accent) couldn't be replaced without regressing accessibility. This adds keyboard nav first, then does the swap.

SelectMenu keyboard support

  • Arrow Up/Down, Home/End move a highlighted option (distinct from the selected one); Enter/Space commits; Escape closes.
  • Type-ahead — printable keys jump to the next label starting with the buffer (600ms window), wrapping. Extracted as pure typeaheadIndex.
  • Trigger opens on ArrowDown/Enter/Space; highlight follows the mouse; active option scrolls into view; aria-activedescendant wired up.

Conversions (native → SelectMenu)

  • Settings: history limit · vault auto-lock · clip expiration.
  • Snippet editor: syntax + folder pickers.
  • History-limit labels are now i18n'd (settings.historyLimit.items, locale-formatted number) instead of a hardcoded "N items".

Left the Vault date/year pickers native — 50+ option lists where the platform picker is genuinely fine.

Tests

11 for SelectMenu — typeaheadIndex unit cases + RTL arrow / Home / End / type-ahead / clamp. i18n across all 15 locales.

tsc clean · 557 tests green.

🤖 Generated with Claude Code

…s/snippets

SelectMenu (the accent-colored dropdown) had no keyboard support, so the
native <select>s couldn't be replaced without regressing accessibility.
Added full keyboard nav first, then swapped the selects that clashed with
the app accent by opening a macOS-blue system popup.

SelectMenu:
- ArrowUp/Down, Home/End move a highlighted option (distinct from the
  selected one); Enter/Space commits it; Escape closes.
- Type-ahead: printable keys jump to the next label starting with the
  buffer (600ms window), wrapping. Extracted as pure `typeaheadIndex`.
- Trigger opens on ArrowDown/Enter/Space; highlight follows the mouse;
  active option scrolls into view; aria-activedescendant wired up.

Conversions (native <select> → SelectMenu):
- Settings: history limit, vault auto-lock, clip expiration.
- Snippet editor: syntax + folder pickers.
- History-limit labels are now i18n'd (settings.historyLimit.items,
  locale-formatted number) instead of a hardcoded "N items".

Tests: 11 for SelectMenu (typeaheadIndex unit + RTL arrow/Home/End/
type-ahead/clamp). i18n across 15 locales.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@omercelikdev
omercelikdev merged commit 8515cfd into main Jul 12, 2026
6 checks passed
@omercelikdev
omercelikdev deleted the ux/selectmenu-keyboard-and-conversion branch July 12, 2026 18:11
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