From cef1fed93563988437b272784224006b825a9443 Mon Sep 17 00:00:00 2001 From: Michael Chihlas Date: Fri, 20 Feb 2026 21:24:41 -0500 Subject: [PATCH] =?UTF-8?q?feat:=20Phase=202=20=E2=80=94=20pin/favorite=20?= =?UTF-8?q?buttons=20on=20all=20library=20view=20components?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - TreeGridView: star in top-right corner of cards - TreeListView: star at end of each row - TreeTableView: dedicated leftmost Favorite column - All with proper a11y (aria-label), event isolation, loading states Co-Authored-By: Claude Opus 4.6 --- .../src/components/library/TreeGridView.tsx | 30 ++++++++++++++-- .../src/components/library/TreeListView.tsx | 28 ++++++++++++++- .../src/components/library/TreeTableView.tsx | 35 ++++++++++++++++++- 3 files changed, 89 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/library/TreeGridView.tsx b/frontend/src/components/library/TreeGridView.tsx index 9ad45398..f867c249 100644 --- a/frontend/src/components/library/TreeGridView.tsx +++ b/frontend/src/components/library/TreeGridView.tsx @@ -1,5 +1,5 @@ import { Link } from 'react-router-dom' -import { Pencil, Globe, Lock, Trash2, GitBranch, FileText, Wrench } from 'lucide-react' +import { Pencil, Globe, Lock, Trash2, GitBranch, FileText, Wrench, Star } from 'lucide-react' import type { TreeListItem } from '@/types' import { TagBadges } from '@/components/common/TagBadges' import { cn } from '@/lib/utils' @@ -13,6 +13,9 @@ interface TreeGridViewProps { onFolderCreated: (parentId?: string | null) => void onDeleteTree: (tree: TreeListItem) => void onForkTree?: (treeId: string) => void + pinnedTreeIds?: Set + onTogglePin?: (treeId: string) => void + pinLoadingTreeIds?: Set } export function TreeGridView({ @@ -21,6 +24,9 @@ export function TreeGridView({ onTagClick, onDeleteTree, onForkTree, + pinnedTreeIds, + onTogglePin, + pinLoadingTreeIds, }: TreeGridViewProps) { const { canEditTree, canDeleteTree } = usePermissions() @@ -29,8 +35,28 @@ export function TreeGridView({ {trees.map((tree) => (
+ {onTogglePin && ( + + )}

{tree.name}

diff --git a/frontend/src/components/library/TreeListView.tsx b/frontend/src/components/library/TreeListView.tsx index ff2bd94a..6f94eb7f 100644 --- a/frontend/src/components/library/TreeListView.tsx +++ b/frontend/src/components/library/TreeListView.tsx @@ -1,5 +1,5 @@ import { Link } from 'react-router-dom' -import { Pencil, Globe, Lock, GitBranch, FileText, Trash2, Wrench } from 'lucide-react' +import { Pencil, Globe, Lock, GitBranch, FileText, Trash2, Wrench, Star } from 'lucide-react' import type { TreeListItem } from '@/types' import { TagBadges } from '@/components/common/TagBadges' import { cn } from '@/lib/utils' @@ -13,6 +13,9 @@ interface TreeListViewProps { onFolderCreated: (parentId?: string | null) => void onDeleteTree: (tree: TreeListItem) => void onForkTree?: (treeId: string) => void + pinnedTreeIds?: Set + onTogglePin?: (treeId: string) => void + pinLoadingTreeIds?: Set } export function TreeListView({ @@ -21,6 +24,9 @@ export function TreeListView({ onTagClick, onDeleteTree, onForkTree, + pinnedTreeIds, + onTogglePin, + pinLoadingTreeIds, }: TreeListViewProps) { const { canEditTree } = usePermissions() @@ -84,6 +90,26 @@ export function TreeListView({
+ {onTogglePin && ( + + )} {onForkTree && (