From 7ebf7d491be0576db1f5cc4efdc79b7637d66ba6 Mon Sep 17 00:00:00 2001 From: Julien Froidefond Date: Wed, 1 Oct 2025 13:40:51 +0200 Subject: [PATCH] feat: add filtering options for tags management - Introduced `showOnlyWithoutIcons` state in `TagsManagement` to filter tags without icons. - Updated `TagsFilters` component to include a button for toggling the new filter, displaying the count of tags without icons. - Enhanced filtering logic to accommodate the new option, improving tag management functionality. --- src/components/settings/tags/TagsFilters.tsx | 17 ++++++++++++++++- src/components/settings/tags/TagsManagement.tsx | 13 +++++++++++-- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/src/components/settings/tags/TagsFilters.tsx b/src/components/settings/tags/TagsFilters.tsx index d358189..c40c6a5 100644 --- a/src/components/settings/tags/TagsFilters.tsx +++ b/src/components/settings/tags/TagsFilters.tsx @@ -9,6 +9,8 @@ interface TagsFiltersProps { onSearchChange: (query: string) => void; showOnlyUnused: boolean; onToggleUnused: () => void; + showOnlyWithoutIcons: boolean; + onToggleWithoutIcons: () => void; tags: (Tag & { usage?: number })[]; onReset: () => void; } @@ -18,11 +20,14 @@ export function TagsFilters({ onSearchChange, showOnlyUnused, onToggleUnused, + showOnlyWithoutIcons, + onToggleWithoutIcons, tags, onReset }: TagsFiltersProps) { const unusedCount = tags.filter(tag => (tag.usage || 0) === 0).length; - const hasFilters = searchQuery || showOnlyUnused; + const withoutIconsCount = tags.filter(tag => !tag.name.match(/^[\p{Emoji}\p{Symbol}]/u)).length; + const hasFilters = searchQuery || showOnlyUnused || showOnlyWithoutIcons; return (
@@ -45,6 +50,16 @@ export function TagsFilters({ Tags non utilisés ({unusedCount}) + + {hasFilters && (