From f33e796025b59e5dddf77228db3609f7747ddf1f Mon Sep 17 00:00:00 2001 From: Diego Imbert Date: Tue, 17 Mar 2026 11:53:41 +0100 Subject: [PATCH] feat: replace home page search bars with FilterSearchbar component Replace both Workspace and Hub tab search bars with the new FilterSearchbar component for structured filtering. Workspace tab filters: summary, path, description, kind, user, group, folder Hub tab filters: tag, summary, path, kind Existing filter shortcuts (ToggleButtonGroup, ListFilters badges, owner filter, archived/tree toggles) are preserved and bidirectionally synced with the new FilterSearchbar state. Co-Authored-By: Claude Opus 4.6 --- .../flows/pickers/PickHubApp.svelte | 36 ++- .../flows/pickers/PickHubFlow.svelte | 36 ++- .../flows/pickers/PickHubScript.svelte | 33 ++- .../src/lib/components/home/ItemsList.svelte | 229 +++++++++++++----- .../src/routes/(root)/(logged)/+page.svelte | 125 ++++++++-- 5 files changed, 357 insertions(+), 102 deletions(-) diff --git a/frontend/src/lib/components/flows/pickers/PickHubApp.svelte b/frontend/src/lib/components/flows/pickers/PickHubApp.svelte index 234f053f7b..6118c5dd9e 100644 --- a/frontend/src/lib/components/flows/pickers/PickHubApp.svelte +++ b/frontend/src/lib/components/flows/pickers/PickHubApp.svelte @@ -15,14 +15,26 @@ syncQuery?: boolean children?: import('svelte').Snippet size?: ButtonType.UnifiedSize + hideSearchbar?: boolean + appFilter?: string | undefined + summaryFilter?: string + pathFilter?: string } - let { filter = $bindable(''), syncQuery = false, children, size = 'md' }: Props = $props() + let { + filter = $bindable(''), + syncQuery = false, + children, + size = 'md', + hideSearchbar = false, + appFilter = $bindable(undefined), + summaryFilter, + pathFilter + }: Props = $props() type Item = { apps: string[]; summary: string; path: string } let hubApps: any[] | undefined = $state(undefined) let filteredItems: (Item & { marked?: string })[] = $state([]) - let appFilter: string | undefined = $state(undefined) const prefilteredItems = $derived( appFilter ? (hubApps ?? []).filter((i: Item) => i.apps.includes(appFilter!)) : (hubApps ?? []) @@ -30,6 +42,20 @@ const apps = $derived(Array.from(new Set(filteredItems?.flatMap((x) => x.apps) ?? [])).sort()) + // Apply summary/path post-filters + let displayItems = $derived.by(() => { + let result = filteredItems + if (summaryFilter) { + const s = summaryFilter.toLowerCase() + result = result.filter((x) => x.summary.toLowerCase().includes(s)) + } + if (pathFilter) { + const p = pathFilter.toLowerCase() + result = result.filter((x) => x.path.toLowerCase().includes(p)) + } + return result + }) + const dispatch = createEventDispatcher() let hubNotAvailable = $state(false) @@ -54,6 +80,7 @@ bind:filteredItems f={(x) => x.summary + ' (' + x.apps.join(', ') + ')'} /> +{#if !hideSearchbar}
{@render children?.()}
+{/if} {#if hubNotAvailable} @@ -72,11 +100,11 @@ Could not connect to the Windmill Hub. If you are in a closed environment, you can disable the Hub in the instance settings. {:else if hubApps} - {#if filteredItems.length == 0} + {#if displayItems.length == 0} {:else}
    - {#each filteredItems as item (item)} + {#each displayItems as item (item)}
  • - + - {/snippet} + {#if subtab == 'script'} - viewCode(e.detail)}> - {#snippet children()} - {@render toggleKinds?.()} - {/snippet} - + viewCode(e.detail)} + /> {:else if subtab == 'flow'} - viewFlow(e.detail)}> - {#snippet children()} - {@render toggleKinds?.()} - {/snippet} - + viewFlow(e.detail)} + /> {:else if subtab == 'app'} - viewApp(e.detail)}> - {#snippet children()} - {@render toggleKinds?.()} - {/snippet} - + viewApp(e.detail)} + /> {/if} @@ -369,7 +450,7 @@ {#if tab == 'workspace'} - + {/if}