diff --git a/Sources/GrowthLapse/ContentView.swift b/Sources/GrowthLapse/ContentView.swift index 1092560..bc172e1 100644 --- a/Sources/GrowthLapse/ContentView.swift +++ b/Sources/GrowthLapse/ContentView.swift @@ -250,8 +250,13 @@ struct ContentView: View { SettingsStore.save(newSettings) } .onChange(of: processor.project) { project in - if selectedClipID == nil { - selectedClipID = project?.clips.first?.id + guard let project else { + selectedClipID = nil + return + } + let orderedClips = orderedProjectClips(project.clips) + if selectedClipID == nil || !orderedClips.contains(where: { $0.id == selectedClipID }) { + selectedClipID = orderedClips.first?.id } } .onChange(of: settings.sortMode) { sortMode in @@ -409,6 +414,7 @@ struct ContentView: View { return VStack(alignment: .leading, spacing: 8) { ClipPreviewView(clip: liveClip) + .id(liveClip.sourcePath) .frame(height: 180) .clipShape(RoundedRectangle(cornerRadius: 6))