feat(sidebar): make whole header row clickable and fix database sortIndex generation

This commit is contained in:
yiling
2026-06-01 16:57:35 +08:00
parent 4302dad7c3
commit aaade94ec0
2 changed files with 7 additions and 4 deletions
+4 -1
View File
@@ -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)