Bump studio library sort to match family activity.

Studio sidebar now uses the newest part timestamp the same way the full library does.
This commit is contained in:
2026-09-04 22:20:16 -05:00
parent 25e7864337
commit baa3f7699c
+5 -4
View File
@@ -2333,6 +2333,7 @@ import { emptyKeepPrompts, insertKeepSnippet, normalizeKeepPrompts, type KeepPro
import { import {
clipFamilyPartTitle, clipFamilyPartTitle,
clipPartLabel, clipPartLabel,
familyActivityAt,
familyBaseName, familyBaseName,
familyBranchSummary, familyBranchSummary,
familyDisplayNodes, familyDisplayNodes,
@@ -3436,7 +3437,7 @@ const stillGroups = computed(() => {
const sorted = [...parts].sort(sortStillParts) const sorted = [...parts].sort(sortStillParts)
return { key, head: sorted[0], parts: sorted } return { key, head: sorted[0], parts: sorted }
}) })
.sort((a, b) => b.head.createdAt - a.head.createdAt) .sort((a, b) => familyActivityAt(b.parts) - familyActivityAt(a.parts))
}) })
const libraryGroups = computed(() => { const libraryGroups = computed(() => {
const groups = new Map<string, LibraryClip[]>() const groups = new Map<string, LibraryClip[]>()
@@ -3451,7 +3452,7 @@ const libraryGroups = computed(() => {
const head = familyRootClip(parts) const head = familyRootClip(parts)
return { key, head, parts: [...parts] } return { key, head, parts: [...parts] }
}) })
.sort((a, b) => b.head.createdAt - a.head.createdAt) .sort((a, b) => familyActivityAt(b.parts) - familyActivityAt(a.parts))
}) })
const libraryEntries = computed(() => { const libraryEntries = computed(() => {
const videos = libraryFilter.value === 'images' const videos = libraryFilter.value === 'images'
@@ -3459,7 +3460,7 @@ const libraryEntries = computed(() => {
: libraryGroups.value.map(group => ({ : libraryGroups.value.map(group => ({
kind: 'clip' as const, kind: 'clip' as const,
key: group.key, key: group.key,
createdAt: group.head.createdAt, createdAt: familyActivityAt(group.parts),
group group
})) }))
const images = libraryFilter.value === 'videos' const images = libraryFilter.value === 'videos'
@@ -3467,7 +3468,7 @@ const libraryEntries = computed(() => {
: stillGroups.value.map(group => ({ : stillGroups.value.map(group => ({
kind: 'still' as const, kind: 'still' as const,
key: group.key, key: group.key,
createdAt: group.head.createdAt, createdAt: familyActivityAt(group.parts),
stillGroup: group stillGroup: group
})) }))
return [...videos, ...images].sort((a, b) => b.createdAt - a.createdAt) return [...videos, ...images].sort((a, b) => b.createdAt - a.createdAt)