From af2e03244f86c71c4d1b6ce3c501bc9d9096586f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Thu, 12 Mar 2026 10:55:29 +0100 Subject: [PATCH] feat: replace filter dropdowns with FilterPills component Co-Authored-By: Claude Sonnet 4.6 --- .../ui/filter-pills/filter-pills.svelte | 39 ++++++++++ .../lib/components/ui/filter-pills/index.ts | 1 + .../frontend/src/routes/magazine/+page.svelte | 77 +++++++------------ .../frontend/src/routes/models/+page.svelte | 23 +++--- .../frontend/src/routes/videos/+page.svelte | 68 ++++++---------- 5 files changed, 99 insertions(+), 109 deletions(-) create mode 100644 packages/frontend/src/lib/components/ui/filter-pills/filter-pills.svelte create mode 100644 packages/frontend/src/lib/components/ui/filter-pills/index.ts diff --git a/packages/frontend/src/lib/components/ui/filter-pills/filter-pills.svelte b/packages/frontend/src/lib/components/ui/filter-pills/filter-pills.svelte new file mode 100644 index 0000000..efc3622 --- /dev/null +++ b/packages/frontend/src/lib/components/ui/filter-pills/filter-pills.svelte @@ -0,0 +1,39 @@ + + +
+ {#each options as option (option.value)} + + {/each} +
diff --git a/packages/frontend/src/lib/components/ui/filter-pills/index.ts b/packages/frontend/src/lib/components/ui/filter-pills/index.ts new file mode 100644 index 0000000..71b92a3 --- /dev/null +++ b/packages/frontend/src/lib/components/ui/filter-pills/index.ts @@ -0,0 +1 @@ +export { default as FilterPills } from "./filter-pills.svelte"; diff --git a/packages/frontend/src/routes/magazine/+page.svelte b/packages/frontend/src/routes/magazine/+page.svelte index c8cd2c6..427340a 100644 --- a/packages/frontend/src/routes/magazine/+page.svelte +++ b/packages/frontend/src/routes/magazine/+page.svelte @@ -6,7 +6,7 @@ import { Button } from "$lib/components/ui/button"; import { Card, CardContent } from "$lib/components/ui/card"; import { Input } from "$lib/components/ui/input"; - import { Select, SelectContent, SelectItem, SelectTrigger } from "$lib/components/ui/select"; + import { FilterPills } from "$lib/components/ui/filter-pills"; import TimeAgo from "javascript-time-ago"; import { getAssetUrl } from "$lib/api"; import { calcReadingTime } from "$lib/utils.js"; @@ -77,57 +77,32 @@ /> - -
- - + + setParam("category", v)} + /> - - -
+ + setParam("sort", v)} + /> diff --git a/packages/frontend/src/routes/models/+page.svelte b/packages/frontend/src/routes/models/+page.svelte index f4e0d69..aa15b30 100644 --- a/packages/frontend/src/routes/models/+page.svelte +++ b/packages/frontend/src/routes/models/+page.svelte @@ -6,7 +6,7 @@ import { Button } from "$lib/components/ui/button"; import { Card, CardContent } from "$lib/components/ui/card"; import { Input } from "$lib/components/ui/input"; - import { Select, SelectContent, SelectItem, SelectTrigger } from "$lib/components/ui/select"; + import { FilterPills } from "$lib/components/ui/filter-pills"; import { getAssetUrl } from "$lib/api"; import Meta from "$lib/components/meta/meta.svelte"; import SexyBackground from "$lib/components/background/background.svelte"; @@ -70,18 +70,15 @@ /> - -
- -
+ + setParam("sort", v)} + /> diff --git a/packages/frontend/src/routes/videos/+page.svelte b/packages/frontend/src/routes/videos/+page.svelte index 3293bee..8d451c7 100644 --- a/packages/frontend/src/routes/videos/+page.svelte +++ b/packages/frontend/src/routes/videos/+page.svelte @@ -6,7 +6,7 @@ import { Button } from "$lib/components/ui/button"; import { Card, CardContent } from "$lib/components/ui/card"; import { Input } from "$lib/components/ui/input"; - import { Select, SelectContent, SelectItem, SelectTrigger } from "$lib/components/ui/select"; + import { FilterPills } from "$lib/components/ui/filter-pills"; import { getAssetUrl } from "$lib/api"; import Meta from "$lib/components/meta/meta.svelte"; import SexyBackground from "$lib/components/background/background.svelte"; @@ -73,51 +73,29 @@ /> - -
- - + + setParam("duration", v)} + /> - - -
+ + setParam("sort", v)} + />