diff --git a/src/lib/components/CommandPalette/CommandPalette.svelte b/src/lib/components/CommandPalette/CommandPalette.svelte index 9f8b0367c..6c4028ead 100644 --- a/src/lib/components/CommandPalette/CommandPalette.svelte +++ b/src/lib/components/CommandPalette/CommandPalette.svelte @@ -7,6 +7,7 @@ import Commit from './Commit.svelte'; import Replay from './Replay.svelte'; import Branch from './Branch.svelte'; + import { currentProject } from '$lib/current_project'; let dialog: ComponentType | undefined; @@ -49,13 +50,19 @@ window, { c: () => { - dialog === Commit ? (dialog = undefined) : (dialog = Commit); + if ($currentProject) { + dialog === Commit ? (dialog = undefined) : (dialog = Commit); + } }, r: () => { - dialog === Replay ? (dialog = undefined) : (dialog = Replay); + if ($currentProject) { + dialog === Replay ? (dialog = undefined) : (dialog = Replay); + } }, b: () => { - dialog === Branch ? (dialog = undefined) : (dialog = Branch); + if ($currentProject) { + dialog === Branch ? (dialog = undefined) : (dialog = Branch); + } } }, true // disabled when an input is focused diff --git a/src/lib/components/CommandPalette/Replay.svelte b/src/lib/components/CommandPalette/Replay.svelte index 59f12ef8c..7ca8279fa 100644 --- a/src/lib/components/CommandPalette/Replay.svelte +++ b/src/lib/components/CommandPalette/Replay.svelte @@ -1,7 +1,104 @@ - Replay Working History + + + Replay working history from... + + + + {#each listOptions as listItem, idx} + (selectionIdx = idx)} + on:focus={() => (selectionIdx = idx)} + on:click={gotoDestination} + class="{selectionIdx === idx + ? 'bg-zinc-700/70' + : ''} flex cursor-default items-center rounded-lg p-2 px-2 outline-none" + href="/" + > + {listItem.label} + {idx + 1} + + {/each} + +
+ Replay working history from... +