From 96b70d0eaf9cc259d98fd2cab6c85460bfad8977 Mon Sep 17 00:00:00 2001 From: Kiril Videlov Date: Wed, 5 Apr 2023 10:39:55 +0200 Subject: [PATCH] add terminal navigation to command palette --- src/lib/components/CommandPalette/CmdK.svelte | 10 ++++++++++ .../components/CommandPalette/CommandPalette.svelte | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/src/lib/components/CommandPalette/CmdK.svelte b/src/lib/components/CommandPalette/CmdK.svelte index b29832468..4276aaa9a 100644 --- a/src/lib/components/CommandPalette/CmdK.svelte +++ b/src/lib/components/CommandPalette/CmdK.svelte @@ -116,6 +116,16 @@ }, icon: RewindIcon, visible: 'replay history'.includes(userInput?.toLowerCase()) + }, + { + title: 'Terminal', + description: 'Cmd C', + selected: false, + action: { + href: `/projects/${$project?.id}/terminal` + }, + icon: GitCommitIcon, + visible: 'commit'.includes(userInput?.toLowerCase()) } ] }, diff --git a/src/lib/components/CommandPalette/CommandPalette.svelte b/src/lib/components/CommandPalette/CommandPalette.svelte index 74b3cbffb..e8f8edc4c 100644 --- a/src/lib/components/CommandPalette/CommandPalette.svelte +++ b/src/lib/components/CommandPalette/CommandPalette.svelte @@ -46,6 +46,11 @@ dialog === CmdK ? (dialog = undefined) : ((dialog = CmdK), (props = { projects, project })); + }, + 'Meta+t': () => { + if ($project) { + goto(`/projects/${$project.id}/terminal`); + } } }, false // works even when an input is focused