Make overlay summon shortcuts configurable#23
Open
rapidrabbit76 wants to merge 3 commits intolcoutodemos:mainfrom
Open
Make overlay summon shortcuts configurable#23rapidrabbit76 wants to merge 3 commits intolcoutodemos:mainfrom
rapidrabbit76 wants to merge 3 commits intolcoutodemos:mainfrom
Conversation
The overlay shortcuts were hard-coded to Alt+Space and Cmd+Shift+K. This adds a small settings layer for loading, saving, validating, and re-registering primary/secondary shortcuts at runtime. Changes included here: - add shortcut settings types and IPC channels - persist shortcut settings under the app userData directory - normalize/validate accelerators before registration - support nullable primary/secondary bindings so shortcuts can be removed - expose load/save actions to the renderer store This keeps shortcut behavior configurable without changing the default UX for users who never touch settings.
The new shortcut persistence layer needed a minimal in-app surface so users can actually change bindings without editing source. Add a shortcuts section to the existing settings popover with: - direct text entry for primary and secondary bindings - key-recording controls for capturing accelerators - clear actions to remove either binding entirely - small icon-only action buttons to avoid layout breakage in the compact UI This keeps the feature lightweight and aligned with the existing overlay UX instead of introducing a separate preferences window. Refs lcoutodemos#22
23947bb to
c9552e9
Compare
There was a problem hiding this comment.
Pull request overview
Adds configurable, persisted global shortcut bindings for summoning the overlay, wired through the existing settings popover and IPC so shortcuts can be edited and re-registered at runtime.
Changes:
- Introduces
ShortcutSettingstypes/defaults and IPC channels for getting/setting shortcut settings. - Adds renderer store + settings UI to load, edit, record, clear, reset, and save shortcut bindings.
- Implements main-process persistence + normalization/validation + globalShortcut (re)registration.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/shared/types.ts | Adds shortcut settings types, defaults, and IPC channel names. |
| src/renderer/stores/sessionStore.ts | Adds Zustand state/actions for loading and saving shortcut settings via preload API. |
| src/renderer/components/SettingsPopover.tsx | Adds the shortcuts configuration UI, including direct entry and recording controls. |
| src/preload/index.ts | Exposes shortcut settings IPC methods on window.clui. |
| src/main/shortcut-settings.ts | New module for persisting, normalizing, and registering global shortcuts. |
| src/main/index.ts | Wires shortcut settings into app startup and adds IPC handlers to update shortcuts at runtime. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+136
to
+137
| primaryShortcut: raw.primaryShortcut ?? DEFAULT_SHORTCUT_SETTINGS.primaryShortcut, | ||
| secondaryShortcut: raw.secondaryShortcut ?? DEFAULT_SHORTCUT_SETTINGS.secondaryShortcut, |
Author
There was a problem hiding this comment.
Fixed in b23cc2a. loadShortcutSettings() now falls back only when the field is undefined, so persisted null values round-trip correctly and cleared bindings survive restart.
Shortcut settings used null to represent an intentionally cleared binding, but loadShortcutSettings() applied defaults with nullish coalescing. That collapsed persisted null values back to the default shortcuts on the next launch, so cleared bindings could not round-trip. Default only when the field is actually undefined. Persisted null values are now preserved, so removing a binding survives restart as intended. Refs lcoutodemos#22
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
Make the overlay summon shortcuts configurable from the existing settings popover.
This PR adds:
Why
The summon shortcuts were hard-coded to
Alt+SpaceandCmd+Shift+K, which makes Clui harder to use alongside launchers, input-source shortcuts, and existing editor / terminal keymaps.Closes #22.
Testing
npm run build/Applications/Clui CC.app