From 49075dc246f3331bc8d28d803aea941d690a3050 Mon Sep 17 00:00:00 2001 From: Raunak Burrows Date: Wed, 18 Nov 2026 17:10:15 +0000 Subject: [PATCH] fix: keep every owner chip on the trigger lists while one is selected (#12485) Selecting an owner chip on a trigger list page (HTTP routes, WebSocket, Kafka, Postgres and the other kinds) filtered the rows the chips are built from, so every other chip disappeared and switching owners took two clicks. Apply the owner filter after the chips are computed, as the home page does. --- .../components/triggers/TriggerList.svelte | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/frontend/src/lib/components/triggers/TriggerList.svelte b/frontend/src/lib/components/triggers/TriggerList.svelte index fd66f89050..73e4c300fb 100644 --- a/frontend/src/lib/components/triggers/TriggerList.svelte +++ b/frontend/src/lib/components/triggers/TriggerList.svelte @@ -434,16 +434,13 @@ return !path.startsWith('u/') || path.startsWith('u/' + operatingUser.current?.username + '/') } - const preFilteredItems = $derived( - triggers.filter( - (x) => - (ownerFilter == undefined || - (selectedFilterKind === 'trigger' ? x.path : x.script_path).startsWith( - ownerFilter + '/' - )) && - filterItemsPathsBaseOnUserFilters(x) - ) - ) + function ownerPath(item: TriggerRow) { + return selectedFilterKind === 'trigger' ? item.path : item.script_path + } + + // The owner filter applies last: the chips are how you switch owners, so the rows they are + // built from must not be narrowed to the selected one. + const preFilteredItems = $derived(triggers.filter((x) => filterItemsPathsBaseOnUserFilters(x))) let lastWorkspace = untrack(() => $operatingWorkspace) $effect.pre(() => { @@ -457,14 +454,18 @@ Array.from( new Set( (filteredItems ?? []) - .map((x) => (selectedFilterKind === 'trigger' ? x.path : x.script_path)) + .map(ownerPath) .filter(Boolean) .map((p) => p.split('/').slice(0, 2).join('/')) ) ).sort() ) - const items = $derived(filter !== '' ? filteredItems : preFilteredItems) + const items = $derived( + (filter !== '' ? filteredItems : preFilteredItems)?.filter( + (x) => ownerFilter == undefined || ownerPath(x).startsWith(ownerFilter + '/') + ) + ) // A push delivery has no connection to report and no consumer to suspend: it is an endpoint. function isLive(row: TriggerRow): boolean {