diff --git a/frontend/src/components/library/AddToFolderMenu.tsx b/frontend/src/components/library/AddToFolderMenu.tsx index 78ffff6f..f9ced886 100644 --- a/frontend/src/components/library/AddToFolderMenu.tsx +++ b/frontend/src/components/library/AddToFolderMenu.tsx @@ -38,10 +38,7 @@ export function AddToFolderMenu({ treeId, onFolderCreated }: AddToFolderMenuProp const loadFoldersAndAssignments = async () => { setIsLoading(true) try { - const [foldersData, allFolders] = await Promise.all([ - foldersApi.list(), - Promise.resolve([]), // Will load tree's folder assignments below - ]) + const foldersData = await foldersApi.list() setFolders(foldersData) // Check which folders contain this tree diff --git a/frontend/src/components/library/FolderSidebar.tsx b/frontend/src/components/library/FolderSidebar.tsx index 92662146..8f99b2d3 100644 --- a/frontend/src/components/library/FolderSidebar.tsx +++ b/frontend/src/components/library/FolderSidebar.tsx @@ -46,18 +46,6 @@ function buildFolderTree(folders: FolderListItem[]): FolderTreeItem[] { return rootFolders } -// Calculate folder depth (for limiting nesting) -function getFolderDepth(folders: FolderListItem[], folderId: string): number { - const folder = folders.find((f) => f.id === folderId) - if (!folder || !folder.parent_id) return 1 - return 1 + getFolderDepth(folders, folder.parent_id) -} - -// Check if folder has children -function hasChildren(folders: FolderListItem[], folderId: string): boolean { - return folders.some((f) => f.parent_id === folderId) -} - // Get all descendant IDs (for cascade delete warning) function getDescendantIds(folders: FolderListItem[], folderId: string): string[] { const children = folders.filter((f) => f.parent_id === folderId) diff --git a/frontend/src/components/tree-editor/TreeMetadataForm.tsx b/frontend/src/components/tree-editor/TreeMetadataForm.tsx index 41fe0e3a..eb99831d 100644 --- a/frontend/src/components/tree-editor/TreeMetadataForm.tsx +++ b/frontend/src/components/tree-editor/TreeMetadataForm.tsx @@ -24,7 +24,6 @@ export function TreeMetadataForm() { } = useTreeEditorStore() const [categories, setCategories] = useState([]) - const [legacyCategories, setLegacyCategories] = useState([]) const [customCategory, setCustomCategory] = useState(false) // Load categories diff --git a/frontend/src/pages/TreeLibraryPage.tsx b/frontend/src/pages/TreeLibraryPage.tsx index b1a3e353..f6a7f53e 100644 --- a/frontend/src/pages/TreeLibraryPage.tsx +++ b/frontend/src/pages/TreeLibraryPage.tsx @@ -274,9 +274,13 @@ export function TreeLibraryPage() {

{tree.name}

{tree.is_public ? ( - + + + ) : ( - + + + )} {tree.category_info && (