diff --git a/frontend/src/lib/components/SearchPalette.svelte b/frontend/src/lib/components/SearchPalette.svelte index 8a8d2df..8a446a6 100644 --- a/frontend/src/lib/components/SearchPalette.svelte +++ b/frontend/src/lib/components/SearchPalette.svelte @@ -17,12 +17,17 @@ commandTrackersCache, } from '$lib/stores/caches.svelte'; + let { onopen = undefined }: { onopen?: (opener: () => void) => void } = $props(); + let open = $state(false); let query = $state(''); let activeIndex = $state(0); let loading = $state(false); let inputEl: HTMLInputElement; + // Expose openPalette to parent via callback + $effect(() => { onopen?.(openPalette); }); + interface SearchResult { id: number; name: string; diff --git a/frontend/src/routes/+layout.svelte b/frontend/src/routes/+layout.svelte index d99f877..f9e6c91 100644 --- a/frontend/src/routes/+layout.svelte +++ b/frontend/src/routes/+layout.svelte @@ -19,6 +19,7 @@ const theme = getTheme(); let showPasswordForm = $state(false); + let openSearch: (() => void) | undefined; let pwdCurrent = $state(''); let pwdNew = $state(''); let pwdMsg = $state(''); @@ -240,6 +241,22 @@ + +
+ +
+