Skip to content

feat: allow customizing in-app keyboard shortcuts - #1488

Open
Dailin521 wants to merge 2 commits into
responsively-org:mainfrom
Dailin521:codex/responsively-745-custom-shortcuts
Open

Dailin521 wants to merge 2 commits into
responsively-org:mainfrom
Dailin521:codex/responsively-745-custom-shortcuts

Conversation

@Dailin521

Copy link
Copy Markdown
Contributor

Summary

Add renderer-side shortcut customization for the existing in-app shortcuts manager.

Root cause

Keyboard bindings were hard-coded in the renderer, so users could not override the in-app shortcuts without changing source. The shortcuts modal was also read-only, which meant there was no narrow UI path for storing per-action overrides while keeping Electron menu accelerators untouched.

Changes

  • add a renderer shortcuts slice that loads and persists shortcut overrides through window.electron.store
  • resolve keyboard bindings from defaults plus overrides before registering Mousetrap handlers and rendering the shortcuts modal
  • turn the shortcuts modal into an editor with capture, reset, and fixed-state handling, while keeping Reload non-customizable because the application menu accelerator still owns it
  • add targeted tests for persistence, memoized binding resolution, modal editing, reset behavior, and the fixed Reload row

Verification

  • npm run typecheck
  • npx eslint src/renderer/components/KeyboardShortcutsManager/constants.ts src/renderer/components/KeyboardShortcutsManager/index.tsx src/renderer/components/ToolBar/Shortcuts/ShortcutsModal/ShortcutButton.tsx src/renderer/components/ToolBar/Shortcuts/ShortcutsModal/ShortcutName.tsx src/renderer/components/ToolBar/Shortcuts/ShortcutsModal/index.tsx src/renderer/store/index.ts src/renderer/store/features/shortcuts/index.ts src/renderer/store/features/shortcuts/index.test.ts src/renderer/components/ToolBar/Shortcuts/ShortcutsModal/index.test.tsx
  • npm run test -- src/renderer/store/features/shortcuts/index.test.ts src/renderer/components/ToolBar/Shortcuts/ShortcutsModal/index.test.tsx
  • npm run test
  • Electron verification:
    • opened View Shortcuts in the running Electron app and confirmed the modal exposes editable in-app shortcut rows
    • confirmed the Reload row stays Fixed with no edit control
    • captured a custom Ctrl+Shift+Y binding for Theme and verified userPreferences.shortcuts.THEME was written to %APPDATA%\Electron\config.json
    • triggered the new Ctrl+Shift+Y shortcut in the Electron app and verified ui.darkMode flipped to true, then reset the override and restored ui.darkMode to false

Closes #745

@Dailin521

Dailin521 commented Apr 14, 2026 •

Copy link
Copy Markdown
Contributor Author

Added the local runtime verification screenshots here for reviewer convenience.

These images are hosted in the dedicated public artifacts repository:

Shortcut modal with fixed Reload row:
This shows the renderer-only v1 scope after the change. Existing in-app shortcuts are editable from the current modal, while Reload stays fixed and non-customizable because the Electron menu accelerator still owns that action.

Shortcut modal with fixed Reload row

Custom Theme shortcut toggling dark mode:
In the real Electron app, I captured Ctrl+Shift+Y for Theme, closed the modal, triggered the new shortcut, and verified that it toggled dark mode. I then reset the override so no local verification residue remained.

Custom Theme shortcut toggling dark mode

@manojVivek

Copy link
Copy Markdown
Collaborator

@Dailin521 The screenshot links are broken, can you please update them?
Also, in case you missed it, the e2e tests related to keyboard shortcuts are failing.

@Dailin521
Dailin521 force-pushed the codex/responsively-745-custom-shortcuts branch from 0fefffe to 8caf9ac Compare April 17, 2026 03:42
@Dailin521

Copy link
Copy Markdown
Contributor Author

Updated both items on this PR:

  • fixed the screenshot links in the existing verification comment
  • pushed a follow-up commit for the keyboard shortcuts e2e failure after rebasing the branch onto the latest main

GitHub has already queued a fresh Analyze run and test (macos-latest) run on the updated head.

This branch has not been deployed

No deployments
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.

Allow customizing shortcuts

2 participants