From a0eac480b43baa5f58cca24e2b421d2a3caff2e1 Mon Sep 17 00:00:00 2001 From: Bohdan Triapitsyn Date: Sat, 3 Jan 2026 02:27:10 +0200 Subject: [PATCH] refactor: update keyboard shortcuts to prevent conflicts (#100) Change Keyboard Shortcuts dialog shortcut from Cmd+H to Cmd+. Update memory debug shortcut from Cmd+Shift+M to Cmd+Shift+D Modify model selector shortcut to use Cmd+Shift+M --- packages/desktop/src-tauri/src/main.rs | 4 ++-- packages/ui/src/App.tsx | 2 +- packages/ui/src/components/layout/Header.tsx | 2 +- packages/ui/src/components/ui/CommandPalette.tsx | 2 +- packages/ui/src/components/ui/HelpDialog.tsx | 4 ++-- packages/ui/src/hooks/useKeyboardShortcuts.ts | 6 +++--- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/desktop/src-tauri/src/main.rs b/packages/desktop/src-tauri/src/main.rs index 0ab780fa..f3e938f0 100644 --- a/packages/desktop/src-tauri/src/main.rs +++ b/packages/desktop/src-tauri/src/main.rs @@ -481,7 +481,7 @@ fn build_macos_menu( MENU_ITEM_TOGGLE_MEMORY_DEBUG_ID, "Toggle Memory Debug", true, - Some("Cmd+Shift+M"), + Some("Cmd+Shift+D"), )?; // Help menu items @@ -490,7 +490,7 @@ fn build_macos_menu( MENU_ITEM_HELP_DIALOG_ID, "Keyboard Shortcuts", true, - Some("Cmd+H"), + Some("Cmd+."), )?; let download_logs = MenuItem::with_id( diff --git a/packages/ui/src/App.tsx b/packages/ui/src/App.tsx index 12bccbdf..b1d0d965 100644 --- a/packages/ui/src/App.tsx +++ b/packages/ui/src/App.tsx @@ -157,7 +157,7 @@ function App({ apis }: AppProps) { React.useEffect(() => { const handleKeyDown = (e: KeyboardEvent) => { - if (hasModifier(e) && e.shiftKey && e.key === 'M') { + if (hasModifier(e) && e.shiftKey && e.key === 'D') { e.preventDefault(); setShowMemoryDebug(prev => !prev); } diff --git a/packages/ui/src/components/layout/Header.tsx b/packages/ui/src/components/layout/Header.tsx index b48fa2f9..ae30dc0e 100644 --- a/packages/ui/src/components/layout/Header.tsx +++ b/packages/ui/src/components/layout/Header.tsx @@ -425,7 +425,7 @@ export const Header: React.FC = () => { -

Keyboard Shortcuts ({getModifierLabel()}+H)

+

Keyboard Shortcuts ({getModifierLabel()}+.)

diff --git a/packages/ui/src/components/ui/CommandPalette.tsx b/packages/ui/src/components/ui/CommandPalette.tsx index b7a7bd93..c8349a5c 100644 --- a/packages/ui/src/components/ui/CommandPalette.tsx +++ b/packages/ui/src/components/ui/CommandPalette.tsx @@ -137,7 +137,7 @@ export const CommandPalette: React.FC = () => { Keyboard Shortcuts - {getModifierLabel()} + H + {getModifierLabel()} + . diff --git a/packages/ui/src/components/ui/HelpDialog.tsx b/packages/ui/src/components/ui/HelpDialog.tsx index f1a2f10a..06e9a29e 100644 --- a/packages/ui/src/components/ui/HelpDialog.tsx +++ b/packages/ui/src/components/ui/HelpDialog.tsx @@ -94,7 +94,7 @@ export const HelpDialog: React.FC = () => { icon: RiCommandLine, }, { - keys: [`${mod} + H`], + keys: [`${mod} + .`], description: "Show Keyboard Shortcuts (this dialog)", icon: RiQuestionLine, }, @@ -104,7 +104,7 @@ export const HelpDialog: React.FC = () => { icon: RiLayoutLeftLine, }, { - keys: [`${mod} + M`], + keys: [`Shift + ${mod} + M`], description: "Open Model Selector", icon: RiBrainAi3Line, }, diff --git a/packages/ui/src/hooks/useKeyboardShortcuts.ts b/packages/ui/src/hooks/useKeyboardShortcuts.ts index 96f59300..58a0bd26 100644 --- a/packages/ui/src/hooks/useKeyboardShortcuts.ts +++ b/packages/ui/src/hooks/useKeyboardShortcuts.ts @@ -74,7 +74,7 @@ export const useKeyboardShortcuts = () => { return; } - if (hasModifier(e) && e.key === 'h') { + if (hasModifier(e) && e.key === '.') { e.preventDefault(); toggleHelpDialog(); } @@ -145,8 +145,8 @@ export const useKeyboardShortcuts = () => { return; } - // Ctrl+M: Open model selector (same conditions as double-ESC: chat tab, no overlays) - if (hasModifier(e) && !e.shiftKey && e.key.toLowerCase() === 'm') { + // Cmd/Ctrl+Shift+M: Open model selector (same conditions as double-ESC: chat tab, no overlays) + if (hasModifier(e) && e.shiftKey && e.key.toLowerCase() === 'm') { const { isSettingsDialogOpen, isCommandPaletteOpen,