From 75bf706d332c80ce63aceca99d45e67eabfb1191 Mon Sep 17 00:00:00 2001 From: James Xylight Date: Sat, 8 Feb 2025 15:30:47 -0800 Subject: [PATCH] fix: redesign and fix command palette --- .../ui/navbar/commands/Commands.svelte | 31 ++++++++++++------- .../ui/navbar/commands/CommandsWrapper.svelte | 22 ++----------- .../ui/navbar/commands/actions.svelte.ts | 22 ++++++------- src/lib/mono/modal/Modal.svelte | 23 ++++++++------ 4 files changed, 48 insertions(+), 50 deletions(-) diff --git a/src/lib/components/ui/navbar/commands/Commands.svelte b/src/lib/components/ui/navbar/commands/Commands.svelte index c353be6b..103e7a47 100644 --- a/src/lib/components/ui/navbar/commands/Commands.svelte +++ b/src/lib/components/ui/navbar/commands/Commands.svelte @@ -21,6 +21,16 @@ let { open = $bindable(false), groups = $bindable([]) }: Props = $props() + $effect(() => { + groups = getGroups( + $resumables, + profile.data, + profileData.profiles, + $themeData, + page.data.contextual?.actions, + ) + }) + let search = $state('') let container: HTMLElement | undefined = $state() const dispatch = createEventDispatcher() @@ -226,18 +236,11 @@ $effect(() => { if (open) search = '' }) - $effect(() => { - groups = getGroups( - $resumables, - profile.data, - profileData.profiles, - $themeData, - page.data.contextual?.actions, - ) - }) + let flattenedActions = $derived( filteredGroups.flatMap((group) => group.actions), ) + $effect(() => { debouncedSearch(search) }) @@ -245,8 +248,14 @@ - -
+ +
{#if breadcrumbs.length > 0}