feat: implement keyboard shortcuts for power users#392
Open
Ugasutun wants to merge 2 commits into
Open
Conversation
- Add KeyboardShortcutsProvider with global event handling - Focus search on / key press - Close modal/dialog on Escape key - Show help dialog on ? key - Navigate to Properties on G+P sequence - Navigate to Dashboard on G+D sequence - Add SequenceIndicator for visual feedback - Add useKeyboardShortcut hook for component integration - Add comprehensive test coverage
|
@Ugasutun Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Contributor
|
@Ugasutun please go through your code, these changes are too much for the task assigned to you. |
Author
|
I was just trying to improvise. I don't know if I can still change it. Sorry for the late reply |
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.
Closes #114
📝 Description
This PR introduces global keyboard shortcuts to improve navigation speed and productivity for frequent users, resolving #114. It establishes a centralized keyboard event listener system to capture single-key shortcuts, modal dismissals, and sequential chorded shortcuts (e.g.,
GthenP), while ensuring input fields are respected so typing naturally inside text fields isn't interrupted.🛠️ Key Changes
1. Global Keyboard Listener & Context Awareness
Implemented a custom React hook/global event listener to capture
keydownevents.Added boundary checks so shortcuts are automatically ignored when a user is actively typing inside an
input,textarea, or content-editable element.2. Implemented Shortcuts
/: Instantly focuses the main global search bar.Escape: Dismisses the active modal overlay or dialog window.?: Toggles an overlay displaying a helpful cheat sheet of all available shortcuts.G➔P: Sequence key chord that navigates the user directly to the Properties route.G➔D: Sequence key chord that navigates the user directly to the Dashboard route.3. UI Polish
Added minor accessibility indicators (e.g., a small visual
[/]badge in the search bar placeholder when not focused).Created the shortcuts help modal triggered by the
?key.📋 Acceptance Criteria Checklist
Shortcut | Action | Status | Notes -- | -- | -- | -- / | Focus search bar | [ ] | Instantly sets focus and highlights text if applicable. Escape | Close modal/dialog | [ ] | Closes top-most open modal smoothly. ? | Show keyboard shortcuts help | [ ] | Toggles the visual shortcut reference guide. G + P | Go to Properties | [ ] | Listens for sequence and triggers router navigation. G + D | Go to Dashboard | [ ] | Listens for sequence and triggers router navigation.🧪 Verification & Manual Testing Steps
1. General Interactions
Open the app and press
?to confirm the shortcuts instruction modal displays correctly.Press
Escapeto close that modal.Press
/and verify your cursor is placed instantly into the global search bar. Type some text to ensure shortcuts likeGorPdon't trigger while you are typing inside it.2. Chord Navigation Sequences
Click away from any inputs, then tap
Gfollowed quickly byP. Verify the app routes to the Properties view.Tap
Gfollowed quickly byD. Verify the app routes back to the main Dashboard.