[PR #3890] [MERGED] Keyboard shortcut support #4448

Closed
opened 2026-02-22 18:35:51 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Mintplex-Labs/anything-llm/pull/3890
Author: @AshAnand34
Created: 5/27/2025
Status: Merged
Merged: 5/27/2025
Merged by: @timothycarambat

Base: masterHead: keyboard-shortcut-support


📝 Commits (10+)

  • acae61c Add keyboard shortcuts help feature
  • 78fbc8f Minor lint fixes
  • 0c9c41c Enhance keyboard shortcuts feature by updating help shortcut and adding keyboard shortcuts button in Quick Links. Include new translation for keyboard shortcuts in locale.
  • 3032ca4 Added documentation of keyboard shortcuts
  • 42cbf6d Merge branch 'Mintplex-Labs:master' into keyboard-shortcut-support
  • 56c0f86 refactor keyboard shortcuts to not render on every page (like login)
  • 95d5e7e Merge branch 'master' into keyboard-shortcut-support
  • 254ba34 Merge branch 'master' into keyboard-shortcut-support
  • 516f241 move translation key
  • e5bd340 Merge branch 'keyboard-shortcut-support' of github.com:AshAnand34/anything-llm into pr-3890-branch

📊 Changes

6 files changed (+249 additions, -10 deletions)

View changed files

📝 frontend/src/App.jsx (+2 -0)
frontend/src/components/KeyboardShortcutsHelp/index.jsx (+60 -0)
📝 frontend/src/components/PrivateRoute/index.jsx (+19 -10)
📝 frontend/src/locales/en/common.js (+15 -0)
📝 frontend/src/pages/Main/Home/Resources/index.jsx (+14 -0)
frontend/src/utils/keyboardShortcuts.js (+139 -0)

📄 Description

Pull Request Type

  • feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 🔨 chore
  • 📝 docs

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 the initKeyboardShortcuts 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:

  • Translation Keys: Added translation keys for the keyboard shortcuts modal title and descriptions of all shortcuts. These translations are included in the English locale file. (frontend/src/locales/en/common.js)

Developer Validations

  • I ran yarn lint from the root of the repo & committed changes
  • Relevant documentation has been updated
  • I have tested my code functionality
  • Docker build succeeds locally

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Mintplex-Labs/anything-llm/pull/3890 **Author:** [@AshAnand34](https://github.com/AshAnand34) **Created:** 5/27/2025 **Status:** ✅ Merged **Merged:** 5/27/2025 **Merged by:** [@timothycarambat](https://github.com/timothycarambat) **Base:** `master` ← **Head:** `keyboard-shortcut-support` --- ### 📝 Commits (10+) - [`acae61c`](https://github.com/Mintplex-Labs/anything-llm/commit/acae61c76ae94a5c99e55c5eb4286939b4182534) Add keyboard shortcuts help feature - [`78fbc8f`](https://github.com/Mintplex-Labs/anything-llm/commit/78fbc8f129e09213b103364e831db2be13d70d12) Minor lint fixes - [`0c9c41c`](https://github.com/Mintplex-Labs/anything-llm/commit/0c9c41c0b01896b8d9c258bc2999ca2c307c8cc4) Enhance keyboard shortcuts feature by updating help shortcut and adding keyboard shortcuts button in Quick Links. Include new translation for keyboard shortcuts in locale. - [`3032ca4`](https://github.com/Mintplex-Labs/anything-llm/commit/3032ca471a2b1c2ba4803a94eec93f55a720899c) Added documentation of keyboard shortcuts - [`42cbf6d`](https://github.com/Mintplex-Labs/anything-llm/commit/42cbf6d105991145250d80962333bb02c00dd863) Merge branch 'Mintplex-Labs:master' into keyboard-shortcut-support - [`56c0f86`](https://github.com/Mintplex-Labs/anything-llm/commit/56c0f8609abc80755ea36596d3133959c61e33e8) refactor keyboard shortcuts to not render on every page (like login) - [`95d5e7e`](https://github.com/Mintplex-Labs/anything-llm/commit/95d5e7e45399494f4bf309bf797e8c52ccde4bbe) Merge branch 'master' into keyboard-shortcut-support - [`254ba34`](https://github.com/Mintplex-Labs/anything-llm/commit/254ba345bc1a4a1306a767a3d48a8cb28b9ebac7) Merge branch 'master' into keyboard-shortcut-support - [`516f241`](https://github.com/Mintplex-Labs/anything-llm/commit/516f2410a2e35fe610a4102b83ba57bea493e0b7) move translation key - [`e5bd340`](https://github.com/Mintplex-Labs/anything-llm/commit/e5bd3400c24b3477fe320e94ba00abf511898069) Merge branch 'keyboard-shortcut-support' of github.com:AshAnand34/anything-llm into pr-3890-branch ### 📊 Changes **6 files changed** (+249 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/App.jsx` (+2 -0) ➕ `frontend/src/components/KeyboardShortcutsHelp/index.jsx` (+60 -0) 📝 `frontend/src/components/PrivateRoute/index.jsx` (+19 -10) 📝 `frontend/src/locales/en/common.js` (+15 -0) 📝 `frontend/src/pages/Main/Home/Resources/index.jsx` (+14 -0) ➕ `frontend/src/utils/keyboardShortcuts.js` (+139 -0) </details> ### 📄 Description ### Pull Request Type <!-- For change type, change [ ] to [x]. --> - [x] ✨ feat - [ ] 🐛 fix - [ ] ♻️ refactor - [ ] 💄 style - [ ] 🔨 chore - [ ] 📝 docs ### 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 the `initKeyboardShortcuts` 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: * **Translation Keys**: Added translation keys for the keyboard shortcuts modal title and descriptions of all shortcuts. These translations are included in the English locale file. (`frontend/src/locales/en/common.js`) ### Developer Validations <!-- All of the applicable items should be checked. --> - [x] I ran `yarn lint` from the root of the repo & committed changes - [x] Relevant documentation has been updated - [x] I have tested my code functionality - [x] Docker build succeeds locally --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-22 18:35:51 -05:00
yindo closed this issue 2026-02-22 18:35:51 -05:00
yindo changed title from [PR #3890] Keyboard shortcut support to [PR #3890] [MERGED] Keyboard shortcut support 2026-06-05 15:18:36 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#4448