From 2e083df519cb3319908d573ceef397a1de10bc2a Mon Sep 17 00:00:00 2001 From: Darshan Date: Wed, 27 Aug 2025 17:44:52 +0530 Subject: [PATCH 1/2] update: icon alignment and add count. --- src/lib/components/filters/filters.svelte | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/lib/components/filters/filters.svelte b/src/lib/components/filters/filters.svelte index cf3b7ea48..13a41526c 100644 --- a/src/lib/components/filters/filters.svelte +++ b/src/lib/components/filters/filters.svelte @@ -14,7 +14,7 @@ ValidOperators } from './store'; import { createEventDispatcher } from 'svelte'; - import { Icon, Layout, Popover } from '@appwrite.io/pink-svelte'; + import { Badge, Icon, Layout, Popover } from '@appwrite.io/pink-svelte'; import { IconFilter, IconFilterLine } from '@appwrite.io/pink-icons-svelte'; import { Click, Submit, trackEvent } from '$lib/actions/analytics'; @@ -132,13 +132,20 @@ trackEvent(Click.FilterApplyClick, { source: analyticsSource }); }} {disabled}> - {#if !onlyIcon} + Filters {#if applied > 0} - - {applied} - + + {/if} + {:else} + + + {#if applied > 0} + {/if} {/if} From 19caeff69767cb0589c7f40a323bc9cc5acf514d Mon Sep 17 00:00:00 2001 From: Darshan Date: Wed, 27 Aug 2025 17:49:01 +0530 Subject: [PATCH 2/2] fix: count not updating! --- src/lib/components/filters/filters.svelte | 26 +++++++++++------------ 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/src/lib/components/filters/filters.svelte b/src/lib/components/filters/filters.svelte index 13a41526c..ec7ba4cdf 100644 --- a/src/lib/components/filters/filters.svelte +++ b/src/lib/components/filters/filters.svelte @@ -44,12 +44,12 @@ let showFiltersDesktop = false; let showFiltersMobile = false; - let applied = $tags.length; + $: filtersAppliedCount = $tags.length; beforeNavigate(() => { - applied = $tags.length; showFiltersDesktop = false; showFiltersMobile = false; + filtersAppliedCount = $tags.length; }); function clearAll() { @@ -87,7 +87,7 @@ applied: number; }> ) { - applied = e.detail.applied; + filtersAppliedCount = e.detail.applied; if (singleCondition) { showFiltersDesktop = false; showFiltersMobile = false; @@ -135,8 +135,8 @@ {#if !onlyIcon} Filters - {#if applied > 0} - + {#if filtersAppliedCount > 0} + {/if} {:else} - {#if applied > 0} - + {#if filtersAppliedCount > 0} + {/if} {/if} @@ -167,7 +167,7 @@ {columns} {singleCondition} on:apply={afterApply} - on:clear={() => (applied = 0)} /> + on:clear={() => (filtersAppliedCount = 0)} /> {/if}
Clear all @@ -209,10 +209,8 @@ @@ -230,7 +228,7 @@ bind:arrayValues {singleCondition} on:apply={afterApply} - on:clear={() => (applied = 0)} /> + on:clear={() => (filtersAppliedCount = 0)} /> {/if}