From 2263c0fcd677d9deb68369c463b312a8b6ff4906 Mon Sep 17 00:00:00 2001 From: haappi <74637670+haappi@users.noreply.github.com> Date: Wed, 20 Aug 2025 03:46:21 -0500 Subject: feat: Render human tags before AI tags (#1740) --- .../web/components/dashboard/bookmarks/TagList.tsx | 32 ++++++++++++---------- .../components/dashboard/bookmarks/TagsEditor.tsx | 13 +++++---- 2 files changed, 26 insertions(+), 19 deletions(-) (limited to 'apps/web/components/dashboard/bookmarks') diff --git a/apps/web/components/dashboard/bookmarks/TagList.tsx b/apps/web/components/dashboard/bookmarks/TagList.tsx index 593a269b..e8bed9eb 100644 --- a/apps/web/components/dashboard/bookmarks/TagList.tsx +++ b/apps/web/components/dashboard/bookmarks/TagList.tsx @@ -24,20 +24,24 @@ export default function TagList({ } return ( <> - {bookmark.tags.map((t) => ( -
- - {t.name} - -
- ))} + {bookmark.tags + .sort((a, b) => + a.attachedBy === "ai" ? 1 : b.attachedBy === "ai" ? -1 : 0, + ) + .map((t) => ( +
+ + {t.name} + +
+ ))} ); } diff --git a/apps/web/components/dashboard/bookmarks/TagsEditor.tsx b/apps/web/components/dashboard/bookmarks/TagsEditor.tsx index 5efdd0dd..1893c2a6 100644 --- a/apps/web/components/dashboard/bookmarks/TagsEditor.tsx +++ b/apps/web/components/dashboard/bookmarks/TagsEditor.tsx @@ -96,11 +96,14 @@ export function TagsEditor({ attachedBy: "human" as const, })) ?? [] } - value={optimisticTags.map((t) => ({ - label: t.name, - value: t.id, - attachedBy: t.attachedBy, - }))} + value={optimisticTags + .slice() + .sort((a) => (a.attachedBy === "human" ? -1 : 1)) + .map((t) => ({ + label: t.name, + value: t.id, + attachedBy: t.attachedBy, + }))} isMulti closeMenuOnSelect={false} isClearable={false} -- cgit v1.2.3-70-g09d2