Summary
Implement a configurable keyboard shortcuts system that allows users to customize key bindings for various application functions, starting with permission mode cycling and expandable to other shortcuts.
Background
Currently, the application has limited keyboard shortcuts:
Enter: Submit message (configurable via enter behavior setting)
Shift+Enter: Alternative behavior (newline/submit)
Escape: Abort current request
Users have requested more keyboard shortcuts, particularly for permission mode cycling. A configurable system would provide flexibility and accommodate different user preferences and platform conflicts.
Proposed Implementation
Keyboard Shortcuts Management
Initial Shortcuts to Implement
- Permission Mode Toggle:
Ctrl+Shift+M (Windows/Linux) / Cmd+Shift+M (macOS)
- Abort Request:
Escape (existing, but now configurable)
- Submit Message: Configurable alternative to Enter behavior
- Extensible for future shortcuts
Technical Architecture
- Keyboard event handling system with IME awareness
- Shortcut registration and dispatch system
- Platform detection for appropriate default shortcuts
- Settings integration with localStorage persistence
UI Components
- Keyboard shortcut input fields with live capture
- Conflict detection with visual warnings
- Shortcut display with platform-appropriate key symbols
- Help/reference panel for all available shortcuts
Technical Details
Settings Structure
interface AppSettings {
// existing settings...
keyboardShortcuts: {
permissionModeToggle: string; // "Ctrl+Shift+M"
abortRequest: string; // "Escape"
submitMessage: string; // "Enter"
// Future shortcuts...
};
}
Shortcut Format
- Use standard format:
"Ctrl+Shift+M", "Alt+Tab", etc.
- Platform normalization:
"Cmd+Shift+M" on macOS
- Single key support:
"Escape", "F1", etc.
Event Handling
- Global keyboard event listener with proper cleanup
- Respect IME composition state (
isComposing)
- Context-aware shortcuts (different behavior in different UI areas)
- Prevent conflicts with browser/system shortcuts
User Experience
Shortcut Configuration
- Settings panel with shortcut input fields
- Click field → press desired key combination → automatically captures
- Visual feedback for conflicts or invalid combinations
- Reset to defaults option
Help System
- Tooltip on permission mode indicator showing current shortcut
- Keyboard shortcuts help panel/modal
- Context-sensitive help (show relevant shortcuts based on current UI state)
Implementation Priority
Phase 1: Core Infrastructure
- Keyboard event handling system
- Settings integration
- Basic shortcut registration/dispatch
Phase 2: Permission Mode Toggle
- Implement permission mode cycling shortcut
- Update permission mode UI with shortcut indication
- Handle IME and focus state properly
Phase 3: Configurability
- Shortcut configuration UI in settings
- Conflict detection system
- Help/reference system
Acceptance Criteria
Dependencies
Future Enhancements
- Project-specific shortcut overrides
- Shortcut profiles/presets
- Import/export shortcut configurations
- More application shortcuts (focus chat input, clear messages, etc.)
🤖 Generated with Claude Code
Summary
Implement a configurable keyboard shortcuts system that allows users to customize key bindings for various application functions, starting with permission mode cycling and expandable to other shortcuts.
Background
Currently, the application has limited keyboard shortcuts:
Enter: Submit message (configurable via enter behavior setting)Shift+Enter: Alternative behavior (newline/submit)Escape: Abort current requestUsers have requested more keyboard shortcuts, particularly for permission mode cycling. A configurable system would provide flexibility and accommodate different user preferences and platform conflicts.
Proposed Implementation
Keyboard Shortcuts Management
Initial Shortcuts to Implement
Ctrl+Shift+M(Windows/Linux) /Cmd+Shift+M(macOS)Escape(existing, but now configurable)Technical Architecture
UI Components
Technical Details
Settings Structure
Shortcut Format
"Ctrl+Shift+M","Alt+Tab", etc."Cmd+Shift+M"on macOS"Escape","F1", etc.Event Handling
isComposing)User Experience
Shortcut Configuration
Help System
Implementation Priority
Phase 1: Core Infrastructure
Phase 2: Permission Mode Toggle
Phase 3: Configurability
Acceptance Criteria
Dependencies
Future Enhancements
🤖 Generated with Claude Code