importer chnges

This commit is contained in:
Mark Gregory
2026-11-05 11:16:29 +00:00
parent 87cdb42af9
commit 97662bf4bf
8 changed files with 117 additions and 13 deletions
+13 -1
View File
@@ -438,7 +438,7 @@ struct ReinterpretNamesSheet: View {
private var previewTable: some View {
Table(Array(previews.prefix(200))) {
TableColumn("ID") { Text("\($0.id)").monospacedDigit().foregroundStyle(.secondary) }.width(40)
TableColumn("Source / Result") { row in VStack(alignment:.leading,spacing:3) { Text(row.input).foregroundStyle(.secondary).lineLimit(1);Text(row.after?.title ?? row.issue ?? "No match").foregroundStyle(row.after == nil ? Color.orange : Color.primary).lineLimit(2) } }.width(min:220,ideal:300)
TableColumn("Source / Result") { row in VStack(alignment:.leading,spacing:3) { Text(row.input).foregroundStyle(.secondary).lineLimit(1).help(row.input);Text(row.after?.title ?? row.issue ?? "No match").foregroundStyle(row.after == nil ? Color.orange : Color.primary).lineLimit(2) } }.width(min:220,ideal:300)
TableColumn("Artist") { Text($0.after?.artist ?? "—") }.width(min:110,ideal:170)
TableColumn("Album") { Text($0.after?.album ?? "—") }.width(min:75,ideal:110)
TableColumn("Track") { Text($0.after?.track ?? "—").monospacedDigit() }.width(45)
@@ -470,3 +470,15 @@ struct ReinterpretNamesSheet: View {
Task { do { try await model.applyNameChanges(plan);dismiss() } catch { issue = error.localizedDescription } }
}
}
struct NameReinterpretationCommands {
var perform: () -> Void
var enabled: Bool
}
private struct NameReinterpretationKey: FocusedValueKey { typealias Value = NameReinterpretationCommands }
extension FocusedValues {
var nameReinterpretation: NameReinterpretationCommands? {
get { self[NameReinterpretationKey.self] }
set { self[NameReinterpretationKey.self] = newValue }
}
}