Keyboard shortcut support #3890
Merged
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.
Pull Request Type
Relevant Issues
resolves #3880
What is in this change?
This pull request introduces a new feature for managing and displaying keyboard shortcuts across the application. It includes the addition of a keyboard shortcuts help modal, integration of keyboard shortcuts into the app, and localization support for shortcut descriptions.
New Keyboard Shortcuts Feature:
Keyboard Shortcuts Help Modal: Added a new
KeyboardShortcutsHelp
component to display a modal with a list of keyboard shortcuts and their descriptions. The modal is styled and responsive, and it supports closing via a button. (frontend/src/components/KeyboardShortcutsHelp/index.jsx
)Keyboard Shortcuts Hook and Initialization: Introduced
useKeyboardShortcuts
to manage the state of the help modal and handle keyboard shortcuts. Added theinitKeyboardShortcuts
function to globally register shortcuts for navigation and actions. (frontend/src/utils/keyboardShortcuts.js
)Integration into the Application:
App Component: Integrated the keyboard shortcuts hook into the
App
component to manage the display of the help modal. The modal is conditionally rendered based on the state. (frontend/src/App.jsx
)Quick Links Section: Added a new button in the "Quick Links" section of the home page to open the keyboard shortcuts help modal. Updated the grid layout to accommodate the new button. (
frontend/src/pages/Main/Home/QuickLinks/index.jsx
)Localization:
frontend/src/locales/en/common.js
)Developer Validations
yarn lint
from the root of the repo & committed changes