removed unwanted bar now with waveforms, major updates

This commit is contained in:
Mark Gregory
2026-11-06 13:09:24 +00:00
parent 7b45184dff
commit f6368e4ae7
7 changed files with 243 additions and 41 deletions
+9 -8
View File
@@ -672,9 +672,10 @@ struct ImportProgressPanel: View {
let cancel: () -> Void
let close: () -> Void
var background: (() -> Void)? = nil
var isMove = false
private var fraction: Double { progress.total > 0 ? min(1,max(0,Double(progress.completed)/Double(progress.total))) : 0 }
private var accent: Color { progress.failure != nil || progress.cancelled ? .orange : progress.finished ? .green : .cyan }
private var title: String { progress.finished ? (progress.cancelled ? "Import Cancelled" : progress.failure == nil ? "Import Complete" : "Import Needs Attention") : "Importing Music" }
private var title: String { if isMove { return progress.finished ? (progress.cancelled ? "Move Cancelled" : progress.failure == nil ? "Move Complete" : "Move Needs Attention") : "Moving Media and Waveforms" };return progress.finished ? (progress.cancelled ? "Import Cancelled" : progress.failure == nil ? "Import Complete" : "Import Needs Attention") : "Importing Music" }
var body: some View {
VStack(alignment:.leading,spacing:20) {
HStack(spacing:14) {
@@ -682,7 +683,7 @@ struct ImportProgressPanel: View {
.font(.system(size:26,weight:.medium)).foregroundStyle(accent).frame(width:52,height:52)
.background(accent.opacity(0.12),in:RoundedRectangle(cornerRadius:12))
VStack(alignment:.leading,spacing:4) {
Text(studio.uppercased()+" LIBRARY").font(.system(size:10,weight:.semibold)).tracking(1.4).foregroundStyle(.secondary)
Text(studio.uppercased()+(isMove ? "" : " LIBRARY")).font(.system(size:10,weight:.semibold)).tracking(1.4).foregroundStyle(.secondary)
Text(title).font(.system(size:22,weight:.semibold))
}
Spacer()
@@ -690,7 +691,7 @@ struct ImportProgressPanel: View {
}
VStack(alignment:.leading,spacing:9) {
HStack {
Text(progress.total > 0 ? "\(progress.completed.formatted()) of \(progress.total.formatted()) tracks checked" : "Scanning files and folders…").font(.callout)
Text(progress.total > 0 ? "\(progress.completed.formatted()) of \(progress.total.formatted()) \(isMove ? "files verified" : "tracks checked")" : "Scanning files and folders…").font(.callout)
Spacer()
Text(progress.total > 0 ? "\(Int(fraction*100))%" : "Preparing").font(.callout.weight(.semibold)).monospacedDigit().foregroundStyle(accent)
}
@@ -704,11 +705,11 @@ struct ImportProgressPanel: View {
Text(progress.failure ?? progress.current).font(.system(size:11)).foregroundStyle(.secondary).lineLimit(2).frame(height:30,alignment:.topLeading).frame(maxWidth:.infinity,alignment:.leading)
}
HStack(spacing:12) {
count("Imported",value:max(0,progress.completed-progress.skipped),color:.green)
count(isMove ? "Copied" : "Imported",value:max(0,progress.completed-progress.skipped),color:.green)
count("Skipped",value:progress.skipped,color:.orange)
count("Remaining",value:progress.total > 0 ? max(0,progress.total-progress.completed) : -1,color:.cyan)
}
ImportLogView(progress:progress).frame(height:260)
ImportLogView(progress:progress,title:isMove ? "Transfer Log" : "Import Log").frame(height:260)
Divider()
HStack {
Text(progress.finished ? "Review the log or copy it before closing." : "You can cancel safely; completed tracks stay in your library.").font(.caption).foregroundStyle(.secondary)
@@ -717,7 +718,7 @@ struct ImportProgressPanel: View {
Button("Done",action:close).buttonStyle(.borderedProminent).tint(accent).keyboardShortcut(.defaultAction)
} else {
if let background { Button("Run in Background",action:background) }
Button("Cancel Import",action:cancel).keyboardShortcut(.cancelAction)
Button(isMove ? "Cancel Move" : "Cancel Import",action:cancel).keyboardShortcut(.cancelAction)
}
}
}.padding(26).frame(width:660)
@@ -735,12 +736,13 @@ struct ImportProgressPanel: View {
}
struct ImportLogView: View {
let progress: ImportProgress
var title = "Import Log"
@State private var follow = true
var body: some View {
let lines = progress.reportLines
VStack(alignment:.leading,spacing:8) {
HStack {
Text("Import Log").font(.headline)
Text(title).font(.headline)
Spacer()
if !progress.finished { Toggle("Follow log",isOn:$follow).toggleStyle(.checkbox).controlSize(.small) }
Button("Copy Log") { NSPasteboard.general.clearContents();NSPasteboard.general.setString(progress.logText,forType:.string) }
@@ -1110,7 +1112,6 @@ struct LibraryView: View {
navigationRow("Library Locations",symbol:"externaldrive",count:model.mediaLocations.count)
navigationRow("ShowScreens",symbol:"rectangle.on.rectangle")
navigationRow("Music Stores",symbol:"bag")
Button { studioSettingsModal = true } label: { Label("Settings…",systemImage:"gearshape").frame(maxWidth:.infinity,alignment:.leading).padding(9) }.buttonStyle(.plain)
}.font(.body).listRowSeparator(.hidden).listRowInsets(EdgeInsets(top:1,leading:8,bottom:1,trailing:8))
}.listStyle(.sidebar)
Divider().padding(.horizontal,14)