Repository navigation
feat(settings): search shortcuts by action or key combination - #1493
Conversation
…risDB#1482) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Verified against current HEAD ( Files Reviewed (17 files)
Reviewed by claude-sonnet-5.5 · Input: 262 · Output: 3.5K · Cached: 469.6K Review guidance: REVIEW.md from base branch |
debba
left a comment
There was a problem hiding this comment.
Thanks @Xnadir, nice work on this one. Keeping the matching in a pure utils/shortcutSearch.ts with its own tests makes it easy to reason about, and searching the output of formatShortcut(...) means overrides and resets show up in the results right away (the override then reset test covers that well). I also appreciate the care around platforms: keeping Ctrl and Cmd separate on macOS and mapping a Cmd query to Ctrl elsewhere is the right call.
Approving. Some follow-ups worth considering, nothing blocking:
- Word aliases only kick in once the whole word is typed. Against
⌘+⇧+Enteron mac, "command" matches but "co", "comm", "comma" don't, so while typing the list flickers to the empty state and back. Same with "opti", "contr", "retur", "escap", "delet". Also matching the raw lowercased query against the raw shortcut text, or treating a partial alias as a prefix, would smooth that out. - Arrow keys only exist as symbols in
config/shortcuts.json(⌘+←,⌘+↑↓←→), so "cmd+left" or "up" finds nothing. Addingleft/right/up/downaliases would help. Range rows like⌘+Shift+1–9also don't match "cmd+shift+3", which is fine for now. metais aliased tocmd, which then becomesctrloff macOS. On Windows and Linux Meta is the Windows/Super key, so "meta+p" finding Ctrl+P is a bit surprising. Applying themetaalias only on macOS would be more accurate.- The empty state
role="status"element is mounted with its text already in it, and some screen readers don't announce live regions inserted that way. Keeping a persistent status element that's empty when there are results is more reliable.
I'll give it a manual run before merging.
Closes #1482
Adds a search field to Settings → Shortcuts that filters the existing rows by their translated action label or their effective key combination.
Behaviour
formatShortcut, so user overrides are included) after normalising both sides:⌘/Cmd/Command/Meta→ cmd;⌥/Opt/Option/Alt→ alt;⇧→ shift;⌃/Control→ ctrl.Esc/Escape,Enter/ReturnandDel/Deleteare treated as the same key.+is ignored, and a space works as a separator (ctrl enter).Ctrl+Tabis a real binding). On other platforms there is no Cmd key, so aCmd+Pquery findsCtrl+P.role="status") is shown.Changes
utils/shortcutSearch.ts: pure helpersnormalizeShortcutTextandmatchesShortcutSearch.ShortcutsTab.tsx: the search input (labelled, keyboard-focusable, visible focus ring, theme tokens), the filtered rows and the empty state.settings.shortcuts.searchPlaceholderandsettings.shortcuts.noMatchesin all 13 locales.Tests
tests/utils/shortcutSearch.test.ts: normalisation, alias matching, platform differences, empty queries.tests/components/settings/ShortcutsTab.test.tsx: label filtering with category omission, macOS aliases, Windows with a Cmd alias, Ctrl vs Cmd on macOS, an override and its reset, the empty state, keyboard focus, no saves while typing, and editing from a filtered list.viteston both files (50 passed),prettier,eslintandpnpm --filter @tabularis/web-ui typecheckare clean. I didn't run GitNexus impact analysis; the change only adds a new util and touchesShortcutsTabrendering, with no changes to shortcut registration, the command palette or assignment logic.🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.