diff --git a/src/lib/components/domains/cnameTable.svelte b/src/lib/components/domains/cnameTable.svelte
index 9569ce89f..eb1dcc693 100644
--- a/src/lib/components/domains/cnameTable.svelte
+++ b/src/lib/components/domains/cnameTable.svelte
@@ -36,6 +36,7 @@
- import { Icon, Layout, Tag, Tooltip } from '@appwrite.io/pink-svelte';
- import { queries, tagFormat, tags } from './store';
+ import {
+ Icon,
+ Layout,
+ Tooltip,
+ CompoundTagRoot,
+ CompoundTagChild,
+ Typography,
+ ActionMenu,
+ Selector
+ } from '@appwrite.io/pink-svelte';
+ import { capitalize } from '$lib/helpers/string';
+ import { queries, tags } from './store';
import { IconX } from '@appwrite.io/pink-icons-svelte';
- import { parsedTags } from './setFilters';
+ import { parsedTags, type ParsedTag } from './setFilters';
import { Button } from '$lib/elements/forms';
+ import type { Column } from '$lib/helpers/types';
+ import { writable, type Writable } from 'svelte/store';
+ import Menu from '$lib/components/menu/menu.svelte';
+ import { addFilterAndApply, buildFilterCol, type FilterData } from './quickFilters';
+ import QuickFilters from '$lib/components/filters/quickFilters.svelte';
+ import { isSmallViewport } from '$lib/stores/viewport';
+
+ let {
+ columns = writable([]),
+ analyticsSource = ''
+ }: { columns?: Writable; analyticsSource?: string } = $props();
+
+ function parseTagParts(tagString: string): { text: string; operator: boolean }[] {
+ return tagString
+ .split(/\*\*(.*?)\*\*/)
+ .map((part, index) => {
+ // Even indices are outside bold (operators), odd indices are inside bold (values)
+ if (index % 2 === 0) {
+ return part
+ .split(/\s+/)
+ .filter(Boolean)
+ .map((t) => ({ text: t, operator: true }));
+ } else {
+ return [{ text: part, operator: false }];
+ }
+ })
+ .flat()
+ .filter((p) => Boolean(p.text));
+ }
+
+ function getFilterFor(title: string): FilterData | null {
+ if (!columns) return null;
+ const col = ($columns as unknown as Column[]).find((c) => c.title === title);
+ if (!col) return null;
+ const filter = buildFilterCol(col);
+ return filter ?? null;
+ }
+
+ // Build available filter definitions from provided columns
+ let availableFilters = $derived(
+ ($columns as unknown as Column[] | undefined)?.length
+ ? (($columns as unknown as Column[])
+ .map((c) => (c.filter !== false ? buildFilterCol(c) : null))
+ .filter((f) => f && f.options) as FilterData[])
+ : []
+ );
+
+ // QuickFilters uses the same filters list
+ let filterCols = $derived(availableFilters);
+
+ // Always-show placeholders are derived from available filters (no hardcoding)
+ // Use reactive array so runes can track changes
+ let hiddenPlaceholders: string[] = $state([]);
+
+ let activeTitles = $derived(
+ ($parsedTags || []).map((t) => (t as ParsedTag).title).filter(Boolean) as string[]
+ );
+
+ // Compute current placeholders (major filters not already active or dismissed)
+ let placeholders = $derived(
+ availableFilters
+ .filter((f) => !activeTitles.includes(f.title))
+ .filter((f) => !hiddenPlaceholders.includes(f.title))
+ );
-{#if $parsedTags?.length}
-
+
+ {#if $parsedTags?.length}
{#each $parsedTags as tag (tag.tag)}
- {
- const t = $tags.filter((t) => t.tag.includes(tag.tag.split(' ')[0]));
- t.forEach((t) => (t ? queries.removeFilter(t) : null));
- queries.apply();
- parsedTags.update((tags) => tags.filter((t) => t.tag !== tag.tag));
- }}>
- {#key tag.tag}
- {tag.tag}
- {/key}
-
-
+
+ {@const parts = parseTagParts(tag.tag)}
+ {@const property = (tag as ParsedTag).title}
+
+ {#each parts as part}
+
+
+
+ {/each}
+ {
+ const t = $tags.filter((t) =>
+ t.tag.includes((tag as ParsedTag).title)
+ );
+ t.forEach((t) => (t ? queries.removeFilter(t) : null));
+ queries.apply();
+ parsedTags.update((tags) => tags.filter((t) => t.tag !== tag.tag));
+ }}>
+
+
+
{tag?.value?.toString()}
{/each}
+ {/if}
+
+
+ {#if placeholders?.length}
+ {#each placeholders as filter (filter.title + filter.id)}
+
+
+
+ {/each}
+ {/if}
+
+ {#if $parsedTags?.length}
-
-{/if}
+ {/if}
+
+ {#if filterCols?.length && !$isSmallViewport}
+
+ {/if}
+
diff --git a/src/lib/components/filters/quickFilters.svelte b/src/lib/components/filters/quickFilters.svelte
index 76bbf90c5..233fa7358 100644
--- a/src/lib/components/filters/quickFilters.svelte
+++ b/src/lib/components/filters/quickFilters.svelte
@@ -22,9 +22,12 @@