feat(ui): add shortcuts help dialog#1148
Merged
Merged
Conversation
Add a shortcuts overview dialog to the user menu using the existing dialog registry so the first UI entry point lands without touching hotkey infrastructure. Include viewer translations and a focused component test that verifies the dialog opens from the user menu.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a keyboard-shortcuts overview dialog to the UI, wired through the existing dialog registry and exposed from the user menu, with accompanying viewer-namespace translations and a component test to ensure the dialog opens correctly.
Changes:
- Added
ShortcutsDialogand registered it in the app-wide dialog registry. - Added a new “Keyboard Shortcuts” entry to the user menu to open the dialog.
- Added
vieweri18n strings for the dialog and a focusedUserToolbartest covering the open flow.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| ui/leafwiki-ui/src/locales/en/viewer.json | Adds shortcutsHelp translation strings used by the new dialog/menu entry. |
| ui/leafwiki-ui/src/lib/registries/index.tsx | Registers a new dialog type and render function for the shortcuts help dialog. |
| ui/leafwiki-ui/src/features/shortcuts/ShortcutsDialog.tsx | Implements the shortcuts overview dialog UI using BaseDialog. |
| ui/leafwiki-ui/src/components/UserToolbar.tsx | Adds a user-menu item that opens the shortcuts dialog via the dialogs store. |
| ui/leafwiki-ui/src/components/UserToolbar.test.tsx | Adds a component test verifying the dialog opens from the user menu. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add a central shortcut catalog with mode-aware metadata, i18n labels, and shared display formatting so the shortcuts dialog and runtime registrations use the same source of truth. Migrate the existing explicit UI hotkeys to the catalog while keeping the current hotkey runtime intact and preserving current behavior through tests, lint, and build validation.
Unstub __APP_VERSION__ after the UserToolbar test so the suite does not leak global state into later tests and stays order-independent.
Apply the formatting changes required by format:check for the shortcut migration files so CI passes without changing behavior.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a shortcuts overview dialog to the user menu using the existing dialog registry so the first UI entry point lands without touching hotkey infrastructure.
Include viewer translations and a focused component test that verifies the dialog opens from the user menu.