Task: Keyboard Navigation and Shortcuts
Description
Implement comprehensive keyboard navigation using react-hotkeys-hook. Every UI action should be accessible via keyboard with visible focus indicators. Include a shortcut cheat sheet (Cmd/Ctrl + ?) for discoverability.
Acceptance Criteria
Technical Details
Implementation Approach
- Install
react-hotkeys-hook package
- Create
src/contexts/KeyboardShortcutContext.tsx:
- Define default shortcuts
- Provide hook to register/use shortcuts
- Handle shortcut conflicts
- Create
src/components/KeyboardShortcutModal.tsx:
- Display all available shortcuts
- Categorized by feature area
- Search/filter functionality
- Define keyboard shortcuts:
Cmd/Ctrl + K: Focus request URL
Cmd/Ctrl + Enter: Send request
Cmd/Ctrl + H: Toggle history panel
Cmd/Ctrl + S: Save request
Cmd/Ctrl + T: Toggle terminal mode
Cmd/Ctrl + ,: Open settings
Cmd/Ctrl + ?: Show shortcuts cheat sheet
Escape: Close modals
- Implement focus management utilities
- Add visible focus styles to
globals.css
Key Considerations
- Audit existing shortcuts to avoid conflicts
- Use modifier keys (Cmd/Ctrl) to avoid typing interference
- Test on both Mac (Cmd) and Windows/Linux (Ctrl)
- Focus indicators should be theme-aware
- Prevent shortcuts when typing in inputs
- Screen reader announcements for shortcut actions
Files Affected
package.json (add react-hotkeys-hook)
src/contexts/KeyboardShortcutContext.tsx (new)
src/components/KeyboardShortcutModal.tsx (new)
src/app/globals.css (add focus styles)
src/app/components/RequestPanel.tsx (add shortcuts)
src/app/components/ResponsePanel.tsx (add shortcuts)
src/app/[locale]/layout.tsx (wrap with KeyboardShortcutProvider)
messages/en.json (add shortcut labels)
messages/pt.json (add shortcut labels)
Dependencies
Effort Estimate
- Size: M (Medium)
- Hours: 10-14 hours
- Parallel: true (can run parallel with Task 002)
Definition of Done
Task: Keyboard Navigation and Shortcuts
Description
Implement comprehensive keyboard navigation using
react-hotkeys-hook. Every UI action should be accessible via keyboard with visible focus indicators. Include a shortcut cheat sheet (Cmd/Ctrl + ?) for discoverability.Acceptance Criteria
react-hotkeys-hooklibrary installedTechnical Details
Implementation Approach
react-hotkeys-hookpackagesrc/contexts/KeyboardShortcutContext.tsx:src/components/KeyboardShortcutModal.tsx:Cmd/Ctrl + K: Focus request URLCmd/Ctrl + Enter: Send requestCmd/Ctrl + H: Toggle history panelCmd/Ctrl + S: Save requestCmd/Ctrl + T: Toggle terminal modeCmd/Ctrl + ,: Open settingsCmd/Ctrl + ?: Show shortcuts cheat sheetEscape: Close modalsglobals.cssKey Considerations
Files Affected
package.json(add react-hotkeys-hook)src/contexts/KeyboardShortcutContext.tsx(new)src/components/KeyboardShortcutModal.tsx(new)src/app/globals.css(add focus styles)src/app/components/RequestPanel.tsx(add shortcuts)src/app/components/ResponsePanel.tsx(add shortcuts)src/app/[locale]/layout.tsx(wrap with KeyboardShortcutProvider)messages/en.json(add shortcut labels)messages/pt.json(add shortcut labels)Dependencies
react-hotkeys-hookpackage installationEffort Estimate
Definition of Done