feat(shortcuts): add useKeyboardShortcuts hook, time range keys (1-4)… - #3258
Open
Nareshkumawat-star wants to merge 1 commit into
Open
Conversation
…, Cmd+/, and ShortcutsModal updates
GSSoC Label Checklist 🏷️@Priyanshu-byte-coder — please apply the appropriate labels before merging: Difficulty (pick one):
Quality (optional):
Validation (required to score):
|
Author
|
Hi @Priyanshu-byte-coder kindly review and merge it |
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.
Summary
Adds developer-first keyboard shortcuts to DevTrack, including time-range switching (
1→ 7d,2→ 14d,3→ 30d,4→ 90d), data refresh (R), modal help toggle (?orCmd+/), and modal close (Escape). Introduces a reusableuseKeyboardShortcutshook insrc/lib/and updatesShortcutsModal.tsx.Closes #3247
Type of Change
What Changed
src/lib/useKeyboardShortcuts.ts: Custom hook managing keyboard listeners with focus checks (input,textarea,select,contenteditable).src/components/GlobalKeyboardShortcuts.tsx: Wired range keys1–4,Rrefresh,Cmd+//?help toggle, andEscape.src/components/ShortcutsModal.tsx: Updated shortcut key legend UI to display range keys andCmd+/.How to Test
1,2,3, or4to switch dashboard time ranges (7d,14d,30d,90d).?orCmd+/(Ctrl+/on Windows) to open the Keyboard Shortcuts modal.Escapeto close the modal.1orR— verify shortcuts do not trigger while typing.Checklist
console.logor debug code