From d555ac366f050aadd99345c3a6a7f6c764f51f21 Mon Sep 17 00:00:00 2001 From: HorizonCode Date: Tue, 3 Nov 2026 19:18:31 +0100 Subject: [PATCH] refactor(workshop): use the shared select component for theme filters The sort, announcement audience and report category controls were still native select elements. They now use the same shadcn-svelte Select as the moderation filters for consistent styling and keyboard behavior. --- .../theme/CommunityWorkshopView.svelte | 93 +++++++++++++------ 1 file changed, 67 insertions(+), 26 deletions(-) diff --git a/src/lib/components/theme/CommunityWorkshopView.svelte b/src/lib/components/theme/CommunityWorkshopView.svelte index b741a05..5a10870 100644 --- a/src/lib/components/theme/CommunityWorkshopView.svelte +++ b/src/lib/components/theme/CommunityWorkshopView.svelte @@ -202,6 +202,13 @@ { id: 'broken', label: 'Broken / unusable' }, { id: 'other', label: 'Other' }, ]; + const SORT_OPTIONS: Array<{ id: WorkshopSort; label: string }> = [ + { id: 'relevance', label: 'Best match' }, + { id: 'popular', label: 'Most Popular' }, + { id: 'recent', label: 'Most Recent' }, + { id: 'likes', label: 'Most Liked' }, + { id: 'downloads', label: 'Most Downloaded' }, + ]; const REPORT_STATUS_OPTIONS: Array<{ id: ThemeReportStatus | 'all'; label: string }> = [ { id: 'open', label: 'Open reports' }, { id: 'resolved', label: 'Resolved reports' }, @@ -1492,17 +1499,26 @@
- + + {SORT_OPTIONS.find((option) => option.id === selectedSort)?.label ?? 'Best match'} + + + {#each SORT_OPTIONS as option (option.id)} + + {/each} + +
-
-