Skip to content

refactor: share keyboard shortcuts and generated feature documentation - #803

Open
jabrailkhalil wants to merge 1 commit into
libredb:mainfrom
jabrailkhalil:refactor/shared-keyboard-shortcuts
Open

refactor: share keyboard shortcuts and generated feature documentation#803
jabrailkhalil wants to merge 1 commit into
libredb:mainfrom
jabrailkhalil:refactor/shared-keyboard-shortcuts

Conversation

@jabrailkhalil

@jabrailkhalil jabrailkhalil commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Closes #802.

The tab bar, command palette and sidebar each matched keys differently, while Monaco bindings, UI hints and the FEATURES list repeated the same chords. This adds one internal registry for matching, display labels, Monaco keybindings and generated documentation, following the suggestion in the review of #782.

All three DOM handlers now match physical event.code with explicit modifiers. Caps Lock and non-Latin layouts work consistently; undocumented extra Alt/Shift combinations are rejected. Listener ownership, the new-tab rename guard and textarea support stay in the components. Monaco keeps its native command registration. UI hints show Cmd/Ctrl, and shortcuts:sync updates FEATURES from the registry; the unit suite fails if the list drifts. The sidebar entry explicitly describes the optional SidebarProvider context.

Testing

  • bun run test:shortcuts: 173 passing tests (5 unit, 168 component), including shifted/non-Latin keys, Ctrl/Meta, incorrect modifiers, listener cleanup, rename/textarea behavior and documentation regeneration/drift.
  • Targeted LCOV: new keyboard-shortcuts.ts 58/58 lines, CommandPalette 140/140 and StudioTabBar 125/125. Temporarily replacing the physical-key comparison with event.key makes two unit tests fail; source restored afterward.
  • Passed: bun run format, bun run lint, bun run typecheck, bun run knip, bun run shortcuts:check, bun run readme:check, bun run chart:check, bun run channels:showcase:check, bun run security:check, bun run build, bun run build:lib, bun run attw and git diff --check.
  • bun run test:components: 33/35 groups pass. The same two groups fail on clean main (ce157a1): SQLite fixture cleanup gets Windows EBUSY, and OperationsTab expects a different number separator. The new sidebar test is registered in the component runner and passes.
  • Full bun run test also fails locally, including missing Helm, Windows path expectations and shared-process mock interference; the clean-main run fails too. The complete merged coverage gate requires CI; the targeted report above is not a claim of full-project coverage.

Local toolchain: Windows, Bun 1.4.0 and Node 22.21.1.

CI on 45508e9 has now passed Lint, Typecheck and Build and Unit & Integration Tests, including the full merged coverage gate, in the repository-pinned environment. Security, Helm, Node 24/26 engine smoke, channel E2E, PostgreSQL functional smoke and browser E2E checks also passed.

Refs libredb#802. Use physical keys and one registry for DOM matching, Monaco bindings, UI labels and the FEATURES shortcut list.
@codecov

codecov Bot commented Sep 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@cevheri cevheri added the enhancement New feature or request label Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Share keyboard shortcut matching and the FEATURES shortcut list

2 participants