Skip to content

feat(shortcuts): add useKeyboardShortcuts hook, time range keys (1-4)… - #3258

Open
Nareshkumawat-star wants to merge 1 commit into
Priyanshu-byte-coder:mainfrom
Nareshkumawat-star:feature/keyboard-shortcuts-modal
Open

feat(shortcuts): add useKeyboardShortcuts hook, time range keys (1-4)…#3258
Nareshkumawat-star wants to merge 1 commit into
Priyanshu-byte-coder:mainfrom
Nareshkumawat-star:feature/keyboard-shortcuts-modal

Conversation

@Nareshkumawat-star

Copy link
Copy Markdown

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 (? or Cmd+/), and modal close (Escape). Introduces a reusable useKeyboardShortcuts hook in src/lib/ and updates ShortcutsModal.tsx.

Closes #3247


Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that changes existing behavior)
  • 📝 Documentation update
  • ♻️ Refactor / code cleanup (no functional change)
  • ⚡ Performance improvement
  • 🔒 Security fix
  • 🧪 Tests only

What Changed

  • src/lib/useKeyboardShortcuts.ts: Custom hook managing keyboard listeners with focus checks (input, textarea, select, contenteditable).
  • src/components/GlobalKeyboardShortcuts.tsx: Wired range keys 14, R refresh, Cmd+/ / ? help toggle, and Escape.
  • src/components/ShortcutsModal.tsx: Updated shortcut key legend UI to display range keys and Cmd+/.

How to Test

  1. Open the DevTrack dashboard.
  2. Press 1, 2, 3, or 4 to switch dashboard time ranges (7d, 14d, 30d, 90d).
  3. Press ? or Cmd+/ (Ctrl+/ on Windows) to open the Keyboard Shortcuts modal.
  4. Press Escape to close the modal.
  5. Click into an input box (e.g. search) and press 1 or R — verify shortcuts do not trigger while typing.

Checklist

  • Self-reviewed my own diff
  • No unnecessary console.log or debug code
  • Keyboard focus isolation in form inputs verified
  • ARIA modal & focus trap standards maintained

@github-actions github-actions Bot added type:bug GSSoC type bonus: bug fix type:feature GSSoC type bonus: new feature type:design GSSoC type bonus: UI/design (+10 pts) type:performance GSSoC type bonus: performance (+15 pts) gssoc26 GSSoC 2026 contribution labels Jul 28, 2026
@github-actions

Copy link
Copy Markdown

GSSoC Label Checklist 🏷️

@Priyanshu-byte-coder — please apply the appropriate labels before merging:

Difficulty (pick one):

  • level:beginner — 20 pts
  • level:intermediate — 35 pts
  • level:advanced — 55 pts
  • level:critical — 80 pts

Quality (optional):

  • quality:clean — ×1.2 multiplier
  • quality:exceptional — ×1.5 multiplier

Validation (required to score):

  • gssoc:approved — counts for points
  • gssoc:invalid / gssoc:spam / gssoc:ai-slop — does not score

Type labels (type:*) are auto-detected from files and title. Review and adjust if needed.
Points formula: (difficulty × quality_multiplier) + type_bonus

@Nareshkumawat-star

Copy link
Copy Markdown
Author

Hi @Priyanshu-byte-coder kindly review and merge it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc26 GSSoC 2026 contribution type:bug GSSoC type bonus: bug fix type:design GSSoC type bonus: UI/design (+10 pts) type:feature GSSoC type bonus: new feature type:performance GSSoC type bonus: performance (+15 pts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] Add keyboard shortcuts for common dashboard actions (time range, refresh, sign out)

1 participant