From 71fc2a3cac86256cf614e30ec8efdc509cf8657e Mon Sep 17 00:00:00 2001 From: 01zulfi <85733202+01zulfi@users.noreply.github.com> Date: Sat, 1 Mar 2025 09:31:23 +0500 Subject: [PATCH] web: add keyboard shortcut for opening settings (#7701) Signed-off-by: 01zulfi <85733202+01zulfi@users.noreply.github.com> --- apps/web/src/common/key-map.ts | 6 ++++++ apps/web/src/dialogs/settings/index.tsx | 1 + 2 files changed, 7 insertions(+) diff --git a/apps/web/src/common/key-map.ts b/apps/web/src/common/key-map.ts index 9801fe2bd..5fae830a1 100644 --- a/apps/web/src/common/key-map.ts +++ b/apps/web/src/common/key-map.ts @@ -22,6 +22,7 @@ import { useEditorStore } from "../stores/editor-store"; import { useStore as useSearchStore } from "../stores/search-store"; import { useEditorManager } from "../components/editor/manager"; import { CommandPaletteDialog } from "../dialogs/command-palette"; +import { hashNavigate } from "../navigation"; function isInEditor(e: KeyboardEvent) { return ( @@ -198,6 +199,11 @@ const KEYMAP = [ isCommandMode: e.key === "k" }).catch(() => {}); } + }, + { + keys: ["ctrl+,", "command+,"], + description: "Open settings", + action: () => hashNavigate("/settings", { replace: true }) } ]; diff --git a/apps/web/src/dialogs/settings/index.tsx b/apps/web/src/dialogs/settings/index.tsx index ef610c0d5..4deef6230 100644 --- a/apps/web/src/dialogs/settings/index.tsx +++ b/apps/web/src/dialogs/settings/index.tsx @@ -275,6 +275,7 @@ function SettingsSideBar(props: SettingsSideBarProps) {