From 637a4671cffeaa93b59df158a6266fd242f81771 Mon Sep 17 00:00:00 2001 From: "alexei.dolgolyov" Date: Sun, 22 Mar 2026 00:03:02 +0300 Subject: [PATCH] feat: add search button to sidebar with Ctrl+K shortcut hint MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Compact search bar button between sidebar header and nav. Shows magnifying glass icon + placeholder text + ⌘K kbd hint when expanded, just the icon when collapsed. Clicking opens the search palette. --- .../src/lib/components/SearchPalette.svelte | 5 +++++ frontend/src/routes/+layout.svelte | 19 ++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) 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 @@ + +
+ +
+