From 5e93ae6e4b6dccb6fa69821d9e7ae63747ca93fa Mon Sep 17 00:00:00 2001 From: SethBurkart123 Date: Tue, 1 Apr 2025 17:45:30 +1100 Subject: [PATCH] feat: add bottom bar --- .../built-in/globalSearch/SearchBar.svelte | 35 +++++++++++++++++++ src/plugins/built-in/globalSearch/commands.ts | 25 ++++++------- 2 files changed, 48 insertions(+), 12 deletions(-) diff --git a/src/plugins/built-in/globalSearch/SearchBar.svelte b/src/plugins/built-in/globalSearch/SearchBar.svelte index 55e2d383..bd2a31bf 100644 --- a/src/plugins/built-in/globalSearch/SearchBar.svelte +++ b/src/plugins/built-in/globalSearch/SearchBar.svelte @@ -266,11 +266,46 @@ {/if} {/if} +
+ {#if combinedResults.length > 0 || calculatorResult} +
+
+ {#if !calculatorResult} + {#if selectedIndex >= 0 && selectedIndex < combinedResults.length} + {@const item = combinedResults[selectedIndex].item} + {#if 'keybind' in item && item.keybind} + {@render Shortcut({ text: 'Shortcut', keybind: item.keybindLabel })} + {/if} + {/if} + {/if} +
+
+ {@render Shortcut({ text: 'Navigate', keybind: ['↑', '↓']})} + {#if calculatorResult && selectedIndex === 0} + {@render Shortcut({ text: 'Copy result', keybind: ['↵']})} + {:else} + {@render Shortcut({ text: 'Select', keybind: ['↵']})} + {/if} +
+
+ {/if} +
{/if} +{#snippet Shortcut({ text, keybind }: { text: string, keybind: string[] }) } +
+
+ {#each keybind as key} + {key} + {/each} +
+ {text} +
+{/snippet} +