fix: allow clearing global hotkeys from UI and keyboard#308
Conversation
Adds a mechanism to set a global hotkey to 'None' (disabled) from the settings panel: - Added 'Clear' buttons next to each hotkey row in settings.html. - Pressing Backspace or Delete during edit mode now clears the hotkey to 'None' and saves immediately. - Pressing Escape now correctly discards the edit and reverts to the previous hotkey value instead of clearing it. - UI buttons are correctly disabled/enabled during edit mode to prevent conflicting clicks.
|
@Kirtan-pc is attempting to deploy a commit to the Dot_NotSam's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAdds a Clear button for each configurable hotkey in the settings UI, updates the instructional paragraph to describe Backspace/Delete and Escape behavior, and reworks the keydown handler so Backspace/Delete clears a hotkey while Escape cancels edit mode without changes. Clear buttons are disabled alongside Edit buttons during active recording. ChangesHotkey Clear Button and Keyboard Shortcut Rework
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Description
This PR adds a mechanism to clear/disable global hotkeys directly from the settings panel.
Previously, there was no way to clear a configured hotkey back to "None" via UI controls or intuitive keyboard shortcuts. Furthermore, pressing
Escapeduring key recording erroneously cleared the hotkey rather than cancelling/discarding the edit.fixes Issue #283
Changes
settings.html.BackspaceorDeleteduring hotkey edit mode clears the hotkey to"None"and saves immediately.Escapeduring edit mode cancels the edit and restores the previous shortcut value (without saving).Testing
Escape→ verification that it reverts to the original configuration.BackspaceorDelete→ verification that the hotkey is set to"None", the UI displays"None", and the status message says✓ [Hotkey Name] hotkey cleared."None", saves it, and displays the success toast.Summary by CodeRabbit
New Features
UI Improvements