From 89ac22e9d102a541ec561f68518eae0c78dcdcc6 Mon Sep 17 00:00:00 2001 From: Garret Patti <42485635+garretpatti@users.noreply.github.com> Date: Sun, 12 Apr 2026 20:58:12 -0400 Subject: [PATCH] show applied tags first in tag selector picker Applied tags are now pinned to the front of each category's tag list, with unapplied tags continuing in usage order behind them. Both partitions preserve the existing usage-sort from the API. Co-Authored-By: Claude Sonnet 4.6 --- src/components/tags/TagSelector.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/components/tags/TagSelector.tsx b/src/components/tags/TagSelector.tsx index c45a8ca..d46e00c 100644 --- a/src/components/tags/TagSelector.tsx +++ b/src/components/tags/TagSelector.tsx @@ -298,9 +298,13 @@ export default function TagSelector({ itemKey, onTagsChanged, refreshKey }: Prop {all.categories.map((category) => { const categoryTags = all.tags.filter((t) => t.categoryId === category.id) const search = categorySearches[category.id] ?? '' - const visibleTags = categoryTags - .filter((t) => !search || t.name.toLowerCase().includes(search.toLowerCase())) - .slice(0, 25) + const filtered = categoryTags.filter( + (t) => !search || t.name.toLowerCase().includes(search.toLowerCase()) + ) + const visibleTags = [ + ...filtered.filter((t) => isAssigned(t.id)), + ...filtered.filter((t) => !isAssigned(t.id)), + ].slice(0, 25) return (