From aaade94ec04f19f206885e8563b20466f89f4dec Mon Sep 17 00:00:00 2001 From: yiling Date: Mon, 1 Jun 2026 16:57:35 +0800 Subject: [PATCH] feat(sidebar): make whole header row clickable and fix database sortIndex generation --- src/ui/components/folder-tree.tsx | 6 +++--- src/workflow/activities/db.ts | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/ui/components/folder-tree.tsx b/src/ui/components/folder-tree.tsx index bffa79f9..00852862 100644 --- a/src/ui/components/folder-tree.tsx +++ b/src/ui/components/folder-tree.tsx @@ -156,7 +156,7 @@ export function FolderTree({ >
setIsAssetsExpanded(!isAssetsExpanded)} >

Assets

@@ -224,7 +224,7 @@ export function FolderTree({ >
setIsCollectionsExpanded(!isCollectionsExpanded)} >

Collections

@@ -275,7 +275,7 @@ export function FolderTree({ >
setIsSharesExpanded(!isSharesExpanded)} >

Share Links

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)