Skip to content

feat(settings): search shortcuts by action or key combination - #1493

Merged
debba merged 1 commit into
TabularisDB:mainfrom
Xnadir:feat/shortcuts-search
Nov 13, 2026
Merged

debba merged 1 commit into
TabularisDB:mainfrom
Xnadir:feat/shortcuts-search

Conversation

@Xnadir

@Xnadir Xnadir commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

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

  • An empty or whitespace-only query shows the full list. Matching is case-insensitive.
  • Labels match by substring of the translated text.
  • Key combinations match the effective shortcut (formatShortcut, so user overrides are included) after normalising both sides:
    • ⌘ / Cmd / Command / Meta → cmd; ⌥ / Opt / Option / Alt → alt; ⇧ → shift; ⌃ / Control → ctrl.
    • Esc/Escape, Enter/Return and Del/Delete are treated as the same key.
    • Spacing around + is ignored, and a space works as a separator (ctrl enter).
  • Platform handling: on macOS, Cmd and Ctrl stay distinct because both exist (Ctrl+Tab is a real binding). On other platforms there is no Cmd key, so a Cmd+P query finds Ctrl+P.
  • Categories without matches are omitted. When nothing matches, a localized empty state (role="status") is shown.
  • The search state is session-only. Typing never saves or resets an assignment, and edit, reset and conflict validation work unchanged on the filtered rows.

Changes

  • utils/shortcutSearch.ts: pure helpers normalizeShortcutText and matchesShortcutSearch.
  • ShortcutsTab.tsx: the search input (labelled, keyboard-focusable, visible focus ring, theme tokens), the filtered rows and the empty state.
  • New keys settings.shortcuts.searchPlaceholder and settings.shortcuts.noMatches in 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.

vitest on both files (50 passed), prettier, eslint and pnpm --filter @tabularis/web-ui typecheck are clean. I didn't run GitNexus impact analysis; the change only adds a new util and touches ShortcutsTab rendering, with no changes to shortcut registration, the command palette or assignment logic.

🤖 Generated with Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…risDB#1482)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 12, 2026 17:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@kilo-code-bot

kilo-code-bot Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Verified against current HEAD (eddca1d): the normalisation in shortcutSearch.ts handles every default binding in config/shortcuts.json (including the A / B multi-binding rows and arrow/en-dash keys), the filter reuses formatShortcut so overrides are respected, and the search state is local-only with no impact on save/reset/conflict logic. All 13 locales received both new keys. Tests were not executed in this read-only review.

Files Reviewed (17 files)
  • packages/web-ui/src/components/settings/ShortcutsTab.tsx
  • packages/web-ui/src/utils/shortcutSearch.ts
  • packages/web-ui/src/i18n/locales/de.json
  • packages/web-ui/src/i18n/locales/en.json
  • packages/web-ui/src/i18n/locales/es.json
  • packages/web-ui/src/i18n/locales/fr.json
  • packages/web-ui/src/i18n/locales/it.json
  • packages/web-ui/src/i18n/locales/ja.json
  • packages/web-ui/src/i18n/locales/ko.json
  • packages/web-ui/src/i18n/locales/pt-BR.json
  • packages/web-ui/src/i18n/locales/ru.json
  • packages/web-ui/src/i18n/locales/tl.json
  • packages/web-ui/src/i18n/locales/vi.json
  • packages/web-ui/src/i18n/locales/zh-TW.json
  • packages/web-ui/src/i18n/locales/zh.json
  • packages/web-ui/tests/components/settings/ShortcutsTab.test.tsx
  • packages/web-ui/tests/utils/shortcutSearch.test.ts

Reviewed by claude-sonnet-5.5 · Input: 262 · Output: 3.5K · Cached: 469.6K

Review guidance: REVIEW.md from base branch main

@debba debba left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. Word aliases only kick in once the whole word is typed. Against ⌘+⇧+Enter on 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.
  2. Arrow keys only exist as symbols in config/shortcuts.json (⌘+←, ⌘+↑↓←→), so "cmd+left" or "up" finds nothing. Adding left/right/up/down aliases would help. Range rows like ⌘+Shift+1–9 also don't match "cmd+shift+3", which is fine for now.
  3. meta is aliased to cmd, which then becomes ctrl off macOS. On Windows and Linux Meta is the Windows/Super key, so "meta+p" finding Ctrl+P is a bit surprising. Applying the meta alias only on macOS would be more accurate.
  4. 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.

@debba
debba merged commit fe5bdbb into TabularisDB:main Nov 13, 2026
11 checks passed
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.

[Feat]: Keyboard shortcuts: search actions and assigned key combinations

3 participants