From b35ba645f7a428df591163e03c7226628df9c662 Mon Sep 17 00:00:00 2001 From: yiling Date: Mon, 1 Jun 2026 16:47:24 +0800 Subject: [PATCH 1/6] feat(sidebar): support collapsible sections with dynamic flexbox heights --- src/ui/components/chat/message-input.tsx | 2 +- src/ui/components/folder-tree.tsx | 217 ++++++++++++++--------- 2 files changed, 135 insertions(+), 84 deletions(-) diff --git a/src/ui/components/chat/message-input.tsx b/src/ui/components/chat/message-input.tsx index ce0f099b..c7079b44 100644 --- a/src/ui/components/chat/message-input.tsx +++ b/src/ui/components/chat/message-input.tsx @@ -746,7 +746,7 @@ export const ChatInput = React.forwardRef( className={`p-2 rounded-full transition-all duration-200 flex items-center justify-center shrink-0 ${ canSend && !isUploading ? 'bg-blue-600 text-white shadow-md hover:bg-blue-700 hover:shadow-lg transform hover:-translate-y-0.5' - : 'bg-primary text-gray-400 cursor-not-allowed' + : 'bg-gray-400 cursor-not-allowed' }`} > diff --git a/src/ui/components/folder-tree.tsx b/src/ui/components/folder-tree.tsx index a663de01..a3a4206a 100644 --- a/src/ui/components/folder-tree.tsx +++ b/src/ui/components/folder-tree.tsx @@ -5,6 +5,7 @@ import { useInfiniteQuery, useMutation, useQuery, useQueryClient } from '@tansta import { useMatch, useNavigate, useParams } from '@tanstack/react-router' import { ChevronDown, + ChevronUp, ChevronRight, Clapperboard, Folder, @@ -53,6 +54,10 @@ export function FolderTree({ shouldThrow: false, }) + const [isAssetsExpanded, setIsAssetsExpanded] = useState(true) + const [isCollectionsExpanded, setIsCollectionsExpanded] = useState(true) + const [isSharesExpanded, setIsSharesExpanded] = useState(true) + const { data: shareLinksData } = useQuery({ queryKey: ['shares', projectId], queryFn: async () => { @@ -141,72 +146,103 @@ export function FolderTree({ const shareLinks = shareLinksData?.data ?? [] return ( -
-
-
-
-

- Assets -

- +
+ + {isAssetsExpanded && ( +
+ +
+ navigate({ + to: '/projects/$projectId/recently-deleted', + params: { projectId }, + }) + } + > +
+ +
+ Recently Deleted +
+
+ )} +
+ + {!hideCollections && ( +
+
+
setIsCollectionsExpanded(!isCollectionsExpanded)} + > +

Collections

+ {isCollectionsExpanded ? ( + + ) : ( + + )} +
+
- -
- navigate({ - to: '/projects/$projectId/recently-deleted', - params: { projectId }, - }) - } - > -
- -
- Recently Deleted -
-
- {!hideCollections && ( -
-
-

- Collections -

- -
- -
+ {isCollectionsExpanded && ( +
{collectionsData?.data.map((collection) => (
))}
-
- )} + )} +
+ )} - {!hideShares && ( -
-
-

- Share Links -

-
- -
-
+ {!hideShares && ( +
+
+
setIsSharesExpanded(!isSharesExpanded)} + > +

Share Links

+ {isSharesExpanded ? ( + + ) : ( + + )} +
+
+ +
+
-
+ {isSharesExpanded && ( +
@@ -263,9 +314,9 @@ export function FolderTree({ /> ))}
-
- )} -
+ )} +
+ )}
) } From 143c59c8995a35f1e97431dab90314e37eb5b279 Mon Sep 17 00:00:00 2001 From: yiling Date: Mon, 1 Jun 2026 16:50:13 +0800 Subject: [PATCH 2/6] feat(sidebar): use ChevronsDownUp/ChevronsUpDown and set Assets expanded height to 1/2 --- src/ui/components/folder-tree.tsx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/ui/components/folder-tree.tsx b/src/ui/components/folder-tree.tsx index a3a4206a..03bcc6c9 100644 --- a/src/ui/components/folder-tree.tsx +++ b/src/ui/components/folder-tree.tsx @@ -5,7 +5,8 @@ import { useInfiniteQuery, useMutation, useQuery, useQueryClient } from '@tansta import { useMatch, useNavigate, useParams } from '@tanstack/react-router' import { ChevronDown, - ChevronUp, + ChevronsDownUp, + ChevronsUpDown, ChevronRight, Clapperboard, Folder, @@ -150,7 +151,7 @@ export function FolderTree({
@@ -160,9 +161,9 @@ export function FolderTree({ >

Assets

{isAssetsExpanded ? ( - + ) : ( - + )}
From 4302dad7c3455a543b547d738d552dc9c7feb475 Mon Sep 17 00:00:00 2001 From: yiling Date: Mon, 1 Jun 2026 16:54:49 +0800 Subject: [PATCH 3/6] feat(sidebar): only show chevrons on header hover and allow Assets to take at least 1/2 height --- src/ui/components/folder-tree.tsx | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/ui/components/folder-tree.tsx b/src/ui/components/folder-tree.tsx index 03bcc6c9..bffa79f9 100644 --- a/src/ui/components/folder-tree.tsx +++ b/src/ui/components/folder-tree.tsx @@ -151,19 +151,19 @@ export function FolderTree({
-
+
setIsAssetsExpanded(!isAssetsExpanded)} >

Assets

{isAssetsExpanded ? ( - + ) : ( - + )}
- {isAssetsExpanded && ( -
- -
- navigate({ - to: '/projects/$projectId/recently-deleted', - params: { projectId }, - }) - } - > -
- -
- Recently Deleted +
+ +
+ navigate({ + to: '/projects/$projectId/recently-deleted', + params: { projectId }, + }) + } + > +
+
+ Recently Deleted
- )} +
{!hideCollections && (
@@ -236,41 +241,46 @@ export function FolderTree({
- {isCollectionsExpanded && ( -
- {collectionsData?.data.map((collection) => ( -
- navigate({ - to: '/projects/$projectId/collections/$collectionId', - params: { projectId, collectionId: collection.id }, - }) - } - > -
- -
- {collection.name} +
+ {collectionsData?.data.map((collection) => ( +
+ navigate({ + to: '/projects/$projectId/collections/$collectionId', + params: { projectId, collectionId: collection.id }, + }) + } + > +
+
- ))} -
- )} + {collection.name} +
+ ))} +
)} {!hideShares && (
@@ -285,7 +295,7 @@ export function FolderTree({ )}
-
+
- {isSharesExpanded && ( -
-
-
- -
- - All Share Links ({shareLinks.length}) - +
+
+
+
- - {shareLinks.map((link) => ( - - ))} + + All Share Links ({shareLinks.length}) +
- )} + + {shareLinks.map((link) => ( + + ))} +
)}
From 1a164bf9a06c53361a7f9d187430658e8e48345e Mon Sep 17 00:00:00 2001 From: yiling Date: Mon, 1 Jun 2026 17:03:17 +0800 Subject: [PATCH 6/6] feat(sidebar): add bottom borders to all collapsible sections --- src/ui/components/folder-tree.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ui/components/folder-tree.tsx b/src/ui/components/folder-tree.tsx index ef1dfa60..e3d5d970 100644 --- a/src/ui/components/folder-tree.tsx +++ b/src/ui/components/folder-tree.tsx @@ -150,8 +150,8 @@ export function FolderTree({
@@ -223,8 +223,8 @@ export function FolderTree({ {!hideCollections && (
@@ -279,8 +279,8 @@ export function FolderTree({ {!hideShares && (