From 313d86df2376a43be602aafe4ad0bd26a0095d03 Mon Sep 17 00:00:00 2001 From: blake Date: Thu, 25 Jun 2026 11:45:53 +0200 Subject: [PATCH] Show all existing tags when tag input is empty (#165) WIP: Previously suggestions only appeared after typing; now all unused tags can be shown immediately when the tag menu opens. Reviewed-on: https://codeberg.org/ArkHost/HelixNotes/pulls/165 --- src/lib/components/TagSuggestInput.svelte | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lib/components/TagSuggestInput.svelte b/src/lib/components/TagSuggestInput.svelte index 3467ee6..b69bda6 100644 --- a/src/lib/components/TagSuggestInput.svelte +++ b/src/lib/components/TagSuggestInput.svelte @@ -16,11 +16,10 @@ // Existing tags that match what's typed, prefix matches first, already-applied ones excluded. const suggestions = $derived.by(() => { const q = query.trim().toLowerCase(); - if (!q) return []; const taken = new Set(existing); const names = $tags .map(([name]) => name) - .filter((name) => !taken.has(name) && name.toLowerCase().includes(q)); + .filter((name) => !taken.has(name) && (!q || name.toLowerCase().includes(q))); names.sort((a, b) => { const ap = a.toLowerCase().startsWith(q) ? 0 : 1; const bp = b.toLowerCase().startsWith(q) ? 0 : 1;