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
This commit is contained in:
committed by
GitHub
parent
ff825c7651
commit
a0eac480b4
@@ -481,7 +481,7 @@ fn build_macos_menu<R: tauri::Runtime>(
|
|||||||
MENU_ITEM_TOGGLE_MEMORY_DEBUG_ID,
|
MENU_ITEM_TOGGLE_MEMORY_DEBUG_ID,
|
||||||
"Toggle Memory Debug",
|
"Toggle Memory Debug",
|
||||||
true,
|
true,
|
||||||
Some("Cmd+Shift+M"),
|
Some("Cmd+Shift+D"),
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
// Help menu items
|
// Help menu items
|
||||||
@@ -490,7 +490,7 @@ fn build_macos_menu<R: tauri::Runtime>(
|
|||||||
MENU_ITEM_HELP_DIALOG_ID,
|
MENU_ITEM_HELP_DIALOG_ID,
|
||||||
"Keyboard Shortcuts",
|
"Keyboard Shortcuts",
|
||||||
true,
|
true,
|
||||||
Some("Cmd+H"),
|
Some("Cmd+."),
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
let download_logs = MenuItem::with_id(
|
let download_logs = MenuItem::with_id(
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ function App({ apis }: AppProps) {
|
|||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
const handleKeyDown = (e: KeyboardEvent) => {
|
const handleKeyDown = (e: KeyboardEvent) => {
|
||||||
if (hasModifier(e) && e.shiftKey && e.key === 'M') {
|
if (hasModifier(e) && e.shiftKey && e.key === 'D') {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
setShowMemoryDebug(prev => !prev);
|
setShowMemoryDebug(prev => !prev);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -425,7 +425,7 @@ export const Header: React.FC = () => {
|
|||||||
</button>
|
</button>
|
||||||
</TooltipTrigger>
|
</TooltipTrigger>
|
||||||
<TooltipContent>
|
<TooltipContent>
|
||||||
<p>Keyboard Shortcuts ({getModifierLabel()}+H)</p>
|
<p>Keyboard Shortcuts ({getModifierLabel()}+.)</p>
|
||||||
</TooltipContent>
|
</TooltipContent>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ export const CommandPalette: React.FC = () => {
|
|||||||
<CommandItem onSelect={handleShowHelp}>
|
<CommandItem onSelect={handleShowHelp}>
|
||||||
<RiQuestionLine className="mr-2 h-4 w-4" />
|
<RiQuestionLine className="mr-2 h-4 w-4" />
|
||||||
<span>Keyboard Shortcuts</span>
|
<span>Keyboard Shortcuts</span>
|
||||||
<CommandShortcut>{getModifierLabel()} + H</CommandShortcut>
|
<CommandShortcut>{getModifierLabel()} + .</CommandShortcut>
|
||||||
</CommandItem>
|
</CommandItem>
|
||||||
<CommandItem onSelect={handleOpenDiffPanel}>
|
<CommandItem onSelect={handleOpenDiffPanel}>
|
||||||
<RiCodeLine className="mr-2 h-4 w-4" />
|
<RiCodeLine className="mr-2 h-4 w-4" />
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ export const HelpDialog: React.FC = () => {
|
|||||||
icon: RiCommandLine,
|
icon: RiCommandLine,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
keys: [`${mod} + H`],
|
keys: [`${mod} + .`],
|
||||||
description: "Show Keyboard Shortcuts (this dialog)",
|
description: "Show Keyboard Shortcuts (this dialog)",
|
||||||
icon: RiQuestionLine,
|
icon: RiQuestionLine,
|
||||||
},
|
},
|
||||||
@@ -104,7 +104,7 @@ export const HelpDialog: React.FC = () => {
|
|||||||
icon: RiLayoutLeftLine,
|
icon: RiLayoutLeftLine,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
keys: [`${mod} + M`],
|
keys: [`Shift + ${mod} + M`],
|
||||||
description: "Open Model Selector",
|
description: "Open Model Selector",
|
||||||
icon: RiBrainAi3Line,
|
icon: RiBrainAi3Line,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ export const useKeyboardShortcuts = () => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasModifier(e) && e.key === 'h') {
|
if (hasModifier(e) && e.key === '.') {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
toggleHelpDialog();
|
toggleHelpDialog();
|
||||||
}
|
}
|
||||||
@@ -145,8 +145,8 @@ export const useKeyboardShortcuts = () => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ctrl+M: Open model selector (same conditions as double-ESC: chat tab, no overlays)
|
// 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') {
|
if (hasModifier(e) && e.shiftKey && e.key.toLowerCase() === 'm') {
|
||||||
const {
|
const {
|
||||||
isSettingsDialogOpen,
|
isSettingsDialogOpen,
|
||||||
isCommandPaletteOpen,
|
isCommandPaletteOpen,
|
||||||
|
|||||||
Reference in New Issue
Block a user