You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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
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.
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.
@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.
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
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
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
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
window.electron.storeReloadnon-customizable because the application menu accelerator still owns itReloadrowVerification
npm run typechecknpx 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.tsxnpm run test -- src/renderer/store/features/shortcuts/index.test.ts src/renderer/components/ToolBar/Shortcuts/ShortcutsModal/index.test.tsxnpm run testView Shortcutsin the running Electron app and confirmed the modal exposes editable in-app shortcut rowsReloadrow staysFixedwith no edit controlCtrl+Shift+Ybinding forThemeand verifieduserPreferences.shortcuts.THEMEwas written to%APPDATA%\Electron\config.jsonCtrl+Shift+Yshortcut in the Electron app and verifiedui.darkModeflipped totrue, then reset the override and restoredui.darkModetofalseCloses #745