From 3be1d841aa0713230c29c2edb2ab69ef724a27af Mon Sep 17 00:00:00 2001 From: Willem Jiang Date: Mon, 23 Mar 2026 18:53:06 +0800 Subject: [PATCH] fix(hotkey):support to open settings with hotkey (#1259) --- frontend/src/components/workspace/command-palette.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/workspace/command-palette.tsx b/frontend/src/components/workspace/command-palette.tsx index 3c6f0aa..f1ec2e7 100644 --- a/frontend/src/components/workspace/command-palette.tsx +++ b/frontend/src/components/workspace/command-palette.tsx @@ -26,12 +26,14 @@ import { } from "@/components/ui/dialog"; import { useI18n } from "@/core/i18n/hooks"; import { useGlobalShortcuts } from "@/hooks/use-global-shortcuts"; +import { SettingsDialog } from "./settings"; export function CommandPalette() { const { t } = useI18n(); const router = useRouter(); const [open, setOpen] = useState(false); const [shortcutsOpen, setShortcutsOpen] = useState(false); + const [settingsOpen, setSettingsOpen] = useState(false); const handleNewChat = useCallback(() => { router.push("/workspace/chats/new"); @@ -39,9 +41,9 @@ export function CommandPalette() { }, [router]); const handleOpenSettings = useCallback(() => { - router.push("/workspace/settings"); setOpen(false); - }, [router]); + setSettingsOpen(true); + }, []); const handleShowShortcuts = useCallback(() => { setOpen(false); @@ -60,6 +62,7 @@ export function CommandPalette() { useGlobalShortcuts(shortcuts); + const isMac = typeof navigator !== "undefined" && navigator.userAgent.includes("Mac"); const metaKey = isMac ? "⌘" : "Ctrl+"; @@ -67,6 +70,7 @@ export function CommandPalette() { return ( <> +