Skip to content

Make overlay summon shortcuts configurable#23

Open
rapidrabbit76 wants to merge 3 commits intolcoutodemos:mainfrom
rapidrabbit76:codex/customizable-shortcuts
Open

Make overlay summon shortcuts configurable#23
rapidrabbit76 wants to merge 3 commits intolcoutodemos:mainfrom
rapidrabbit76:codex/customizable-shortcuts

Conversation

@rapidrabbit76
Copy link
Copy Markdown

@rapidrabbit76 rapidrabbit76 commented Mar 19, 2026

Summary

image

Make the overlay summon shortcuts configurable from the existing settings popover.

This PR adds:

  • persisted primary / secondary overlay shortcut settings
  • runtime re-registration of shortcuts without source edits
  • direct text entry for bindings
  • key recording controls for capturing accelerators
  • clear actions so either binding can be removed entirely

Why

The summon shortcuts were hard-coded to Alt+Space and Cmd+Shift+K, which makes Clui harder to use alongside launchers, input-source shortcuts, and existing editor / terminal keymaps.

Closes #22.

Testing

  • npm run build
  • packaged and reinstalled /Applications/Clui CC.app
  • verified the settings popover can edit, record, clear, save, and persist shortcut bindings

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.
Copilot AI review requested due to automatic review settings March 19, 2026 10:18
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
@rapidrabbit76 rapidrabbit76 force-pushed the codex/customizable-shortcuts branch from 23947bb to c9552e9 Compare March 19, 2026 10:21
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ShortcutSettings types/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 thread src/main/shortcut-settings.ts Outdated
Comment on lines +136 to +137
primaryShortcut: raw.primaryShortcut ?? DEFAULT_SHORTCUT_SETTINGS.primaryShortcut,
secondaryShortcut: raw.secondaryShortcut ?? DEFAULT_SHORTCUT_SETTINGS.secondaryShortcut,
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/renderer/components/SettingsPopover.tsx
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: make overlay summon shortcuts configurable

2 participants