From 98a76e913b2da09f25c7dc853714a5c86dc88724 Mon Sep 17 00:00:00 2001 From: yiling Date: Mon, 22 Jun 2026 10:44:07 +0800 Subject: [PATCH] style(folders): use Shadcn ScrollArea in left sidebar containers --- packages/webui/components/folder-tree.tsx | 396 +++++++++++----------- 1 file changed, 202 insertions(+), 194 deletions(-) diff --git a/packages/webui/components/folder-tree.tsx b/packages/webui/components/folder-tree.tsx index cf79fd20..a95bea9e 100644 --- a/packages/webui/components/folder-tree.tsx +++ b/packages/webui/components/folder-tree.tsx @@ -26,6 +26,7 @@ import { DropdownMenuSeparator, } from '@/ui/components/ui/dropdown-menu' import { Input } from '@/ui/components/ui/input' +import { ScrollArea } from '@/ui/components/ui/scroll-area' import { usePermissions } from '@/ui/hooks/use-permissions' import { cn } from '@/ui/lib/utils' import { useDraggable, useDroppable } from '@dnd-kit/react' @@ -466,72 +467,75 @@ export function FolderTree({ -
- { - setRenameId(id) - setRenameType('folder') - setRenameName(currentName) - setIsRenameOpen(true) - }} - onDeleteTrigger={(id) => { - setDeleteId(id) - setDeleteType('folder') - setIsDeleteOpen(true) - }} - onDownloadTrigger={(id) => { - handleDownloadFolder(id) - }} - ancestorFolders={ancestorFolders} - /> +
+ { + setRenameId(id) + setRenameType('folder') + setRenameName(currentName) + setIsRenameOpen(true) + }} + onDeleteTrigger={(id) => { + setDeleteId(id) + setDeleteType('folder') + setIsDeleteOpen(true) + }} + onDownloadTrigger={(id) => { + handleDownloadFolder(id) + }} + ancestorFolders={ancestorFolders} + /> - {canEdit && ( -
- navigate({ - to: '/projects/$projectId/recently-deleted', - params: { projectId }, - }) - } - > -
- + {canEdit && ( +
+ navigate({ + to: '/projects/$projectId/recently-deleted', + params: { projectId }, + }) + } + > +
+ +
+ Recently Deleted
- Recently Deleted -
- )} -
+ )} +
+
{!hideCollections && ( @@ -563,106 +567,108 @@ export function FolderTree({ )} -
-
- navigate({ - to: '/projects/$projectId/collections', - params: { projectId }, - }) - } - > -
- -
- - All Collections ({collectionsData?.pages[0]?.pageInfo?.total || 0}) - -
- - {collections.map((collection) => { - const isColActive = params?.collectionId === collection.id - return ( -
- navigate({ - to: '/projects/$projectId/collections/$collectionId', - params: { projectId, collectionId: collection.id }, - }) - } - > -
-
- -
- - {collection.name} - -
- - {canEdit && ( -
e.stopPropagation()} - > - - - - - - { - setRenameId(collection.id) - setRenameType('collection') - setRenameName(collection.name) - setIsRenameOpen(true) - }} - > - Rename - - { - setDeleteId(collection.id) - setDeleteType('collection') - setIsDeleteOpen(true) - }} - > - Delete - - - -
- )} +
+
+ navigate({ + to: '/projects/$projectId/collections', + params: { projectId }, + }) + } + > +
+
- ) - })} -
- {isFetchingNextCollections && ( -
- + + All Collections ({collectionsData?.pages[0]?.pageInfo?.total || 0}) +
- )} -
+ + {collections.map((collection) => { + const isColActive = params?.collectionId === collection.id + return ( +
+ navigate({ + to: '/projects/$projectId/collections/$collectionId', + params: { projectId, collectionId: collection.id }, + }) + } + > +
+
+ +
+ + {collection.name} + +
+ + {canEdit && ( +
e.stopPropagation()} + > + + + + + + { + setRenameId(collection.id) + setRenameType('collection') + setRenameName(collection.name) + setIsRenameOpen(true) + }} + > + Rename + + { + setDeleteId(collection.id) + setDeleteType('collection') + setIsDeleteOpen(true) + }} + > + Delete + + + +
+ )} +
+ ) + })} +
+ {isFetchingNextCollections && ( +
+ +
+ )} +
+
)} @@ -697,58 +703,60 @@ export function FolderTree({ )} -
-
- navigate({ - to: '/projects/$projectId/shares', - params: { projectId }, - }) - } - > -
- +
+
+ navigate({ + to: '/projects/$projectId/shares', + params: { projectId }, + }) + } + > +
+ +
+ + All Share Links ({shareLinksData?.pages[0]?.pageInfo?.total || 0}) +
- - All Share Links ({shareLinksData?.pages[0]?.pageInfo?.total || 0}) - -
- {shareLinks.map((link) => ( - { - setRenameId(id) - setRenameType('share') - setRenameName(currentName) - setIsRenameOpen(true) - }} - onDeleteTrigger={(id) => { - setDeleteId(id) - setDeleteType('share') - setIsDeleteOpen(true) - }} - /> - ))} -
- {isFetchingNextShareLinks && ( -
- -
- )} -
+ {shareLinks.map((link) => ( + { + setRenameId(id) + setRenameType('share') + setRenameName(currentName) + setIsRenameOpen(true) + }} + onDeleteTrigger={(id) => { + setDeleteId(id) + setDeleteType('share') + setIsDeleteOpen(true) + }} + /> + ))} +
+ {isFetchingNextShareLinks && ( +
+ +
+ )} +
+
)}