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..e3d5d970 100644 --- a/src/ui/components/folder-tree.tsx +++ b/src/ui/components/folder-tree.tsx @@ -5,6 +5,8 @@ import { useInfiniteQuery, useMutation, useQuery, useQueryClient } from '@tansta import { useMatch, useNavigate, useParams } from '@tanstack/react-router' import { ChevronDown, + ChevronsDownUp, + ChevronsUpDown, ChevronRight, Clapperboard, Folder, @@ -53,6 +55,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,17 +147,38 @@ export function FolderTree({ const shareLinks = shareLinksData?.data ?? [] return ( -
-
-
-
-

- Assets -

- -
+
+
+
+
setIsAssetsExpanded(!isAssetsExpanded)} + > +

Assets

+ {isAssetsExpanded ? ( + + ) : ( + + )} +
+ +
+ +
Recently Deleted
+
- {!hideCollections && ( -
-
-

- Collections -

+ {!hideCollections && ( +
+
+
setIsCollectionsExpanded(!isCollectionsExpanded)} + > +

Collections

+ {isCollectionsExpanded ? ( + + ) : ( + + )} +
+ +
+ +
+ {collectionsData?.data.map((collection) => ( +
+ navigate({ + to: '/projects/$projectId/collections/$collectionId', + params: { projectId, collectionId: collection.id }, + }) + } + > +
+ +
+ {collection.name} +
+ ))} +
+
+ )} + + {!hideShares && ( +
+
+
setIsSharesExpanded(!isSharesExpanded)} + > +

Share Links

+ {isSharesExpanded ? ( + + ) : ( + + )} +
+
-
- -
- {collectionsData?.data.map((collection) => ( -
- navigate({ - to: '/projects/$projectId/collections/$collectionId', - params: { projectId, collectionId: collection.id }, - }) - } - > -
- -
- {collection.name} -
- ))}
-
- )} +
- {!hideShares && ( -
-
-

- Share Links -

-
- +
+
+
+
-
- -
-
-
- -
- - All Share Links ({shareLinks.length}) - -
- - {shareLinks.map((link) => ( - - ))} + + All Share Links ({shareLinks.length}) +
+ + {shareLinks.map((link) => ( + + ))}
- )} -
+
+ )}
) } diff --git a/src/workflow/activities/db.ts b/src/workflow/activities/db.ts index 47d9b623..fc660d29 100644 --- a/src/workflow/activities/db.ts +++ b/src/workflow/activities/db.ts @@ -921,7 +921,10 @@ export async function executeAgentToolActivity(params: ExecuteAgentToolParams): // Generate sort index for new version inside the stack (newest gets the lowest sortIndex) const firstChild = await prisma.asset.findFirst({ - where: { parentId: stackId }, + where: { + parentId: stackId, + NOT: { id: newFile.id }, + }, orderBy: { sortIndex: 'asc' }, }) const newSortIndex = generateKeyBetween(null, firstChild?.sortIndex || null)