PM-Oberfläche: Favoriten/Navigator/Aufgaben, Tabs, PM-Filter, PM-Kacheln, IPTC-Layout wie PM, ⌘I Mass-Edit, ⌘U Upload, Code-Ersetzung live, 8 Farbklassen, paralleles + gecachtes Metadaten-Laden, BILDER/INPUT+SENT

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012bGzgsxrmbBhDzeMV2L57D
This commit is contained in:
Lichtkasten DevandClaude Opus 5.5 committed 2026-11-03 23:51:33 +00:00
1 parent d100249c12
commit c0ee93995f
18 files changed
+1311 -515

No files matched your search

@@ -28,7 +28,7 @@ struct ContactSheetView: View {
}
.padding(10)
}
.background(Color(nsColor: .underPageBackgroundColor))
.background(Color(white: 0.22))
.onChange(of: state.cursorID) { _, id in
if let id { proxy.scrollTo(id) }
}
@@ -60,7 +60,8 @@ struct ItemContextMenu: View {
let item: PhotoItem
var body: some View {
Button("IPTC-Info …") { ensureSelected(); state.openWindow("iptc") }
Button("IPTC-Info … (I)") { ensureSelected(); state.openWindow("iptc") }
Button("IPTC für Auswahl … (⌘I)") { ensureSelected(); state.openWindow("iptc-batch") }
Button("Tag umschalten") { ensureSelected(); state.toggleTag() }
Menu("Bewertung") {
ForEach(0...5, id: \.self) { n in
@@ -68,7 +69,8 @@ struct ItemContextMenu: View {
}
}
Menu("Farbmarkierung") {
ForEach(ColorLabel.allCases, id: \.self) { l in Button(l.germanName) { ensureSelected(); state.setLabel(l) } }
ForEach(ColorLabel.allCases, id: \.self) { l in Button("\(l.pmColorClass) – \(l.germanName)") { ensureSelected(); state.setLabel(l) } }
Button("0 – Keine") { ensureSelected(); state.setLabel(nil) }
}
Divider()
Button("In Lightroom bearbeiten (⌘E)") { ensureSelected(); state.sendToLightroom(export: false, develop: true) }
@@ -98,64 +100,89 @@ struct ThumbnailCell: View, Equatable {
a.item == b.item && a.size == b.size && a.selected == b.selected && a.isCursor == b.isCursor && a.imageURL == b.imageURL
}
private static let captionField = IPTCField.byID["caption"]!
/// PM shows the selection as a pale yellow card.
private static let selectedFill = Color(red: 0.93, green: 0.96, blue: 0.68)
private var dateLine: String {
guard let d = item.captureDate else { return "" }
return ThumbnailCell.dateFormatter.string(from: d)
}
private static let dateFormatter: DateFormatter = {
let f = DateFormatter()
f.dateFormat = "dd.MM.yyyy - HH:mm:ss"
return f
}()
private var cameraLine: String {
var lens: [String] = []
if let fl = item.exif["FocalLength"] { lens.append(fl.replacingOccurrences(of: ".0 mm", with: "mm").replacingOccurrences(of: " mm", with: "mm")) }
if let f = item.exif["FNumber"] { lens.append(f) }
let left = lens.joined(separator: " ")
let model = item.exif["Model"] ?? ""
return [left, model].filter { !$0.isEmpty }.joined(separator: " - ")
}
var body: some View {
VStack(spacing: 4) {
let textColor: Color = selected ? .black : .primary
VStack(spacing: 2) {
ZStack {
Rectangle().fill(Color.black.opacity(0.25))
if let image {
Image(nsImage: image).resizable().interpolation(.medium).scaledToFit()
.shadow(color: .black.opacity(0.4), radius: 2, y: 1)
} else {
ProgressView().controlSize(.small)
}
}
.frame(width: size - 12, height: (size - 12) * 0.72)
.clipped()
.frame(width: size - 14, height: (size - 14) * 0.75)
.padding(.top, 6)
VStack(spacing: 0) {
Text(item.filename).lineLimit(1).truncationMode(.middle)
Text(dateLine).lineLimit(1)
Text(item.iptc.text["headline"] ?? " ").lineLimit(1).truncationMode(.middle)
Text(cameraLine.isEmpty ? " " : cameraLine).lineLimit(1)
}
.font(.system(size: 11))
.foregroundStyle(textColor)
.frame(maxWidth: .infinity)
HStack(spacing: 6) {
// PM: color class bar with the rating dots/stars inside
ZStack {
Capsule().fill(item.label?.color ?? Color.gray.opacity(0.35))
HStack(spacing: 6) {
ForEach(1...5, id: \.self) { n in
if n <= item.rating {
Image(systemName: "star.fill").font(.system(size: 8))
} else {
Circle().frame(width: 3, height: 3)
}
}
}
.foregroundStyle(item.label == nil ? Color.primary.opacity(0.6) : Color.white)
}
.frame(height: 12)
HStack(spacing: 4) {
Button(action: onTagClick) {
Image(systemName: item.tagged ? "checkmark.square.fill" : "square")
.foregroundStyle(item.tagged ? Color.accentColor : .secondary)
.font(.system(size: 14))
.foregroundStyle(item.tagged ? (selected ? Color.black : Color.white) : Color.secondary)
}
.buttonStyle(.plain)
.help("Tag (T)")
Text(item.filename).font(.caption).lineLimit(1).truncationMode(.middle)
Spacer(minLength: 2)
if !item.companions.isEmpty {
Text("+\(item.companions.map { $0.pathExtension.uppercased() }.joined(separator: "+"))")
.font(.system(size: 9, weight: .semibold))
.padding(.horizontal, 3)
.background(RoundedRectangle(cornerRadius: 3).fill(Color.secondary.opacity(0.25)))
}
}
HStack(spacing: 1) {
ForEach(1...5, id: \.self) { n in
Image(systemName: n <= item.rating ? "star.fill" : "star")
.font(.system(size: 9))
.foregroundStyle(n <= item.rating ? Color.yellow : Color.secondary.opacity(0.4))
}
Spacer()
if !item.iptc.isEmpty(Self.captionField) {
Image(systemName: "text.alignleft").font(.system(size: 9)).foregroundStyle(.secondary)
.help("Hat Bildunterschrift")
}
}
.padding(.horizontal, 8)
.padding(.bottom, 6)
}
.padding(6)
.frame(width: size)
.background(
RoundedRectangle(cornerRadius: 6)
.fill(selected ? Color.accentColor.opacity(0.35) : Color.gray.opacity(0.14))
RoundedRectangle(cornerRadius: 2)
.fill(selected ? ThumbnailCell.selectedFill : Color(white: 0.30))
)
.overlay(
RoundedRectangle(cornerRadius: 6)
.strokeBorder(item.label.map(\.color) ?? .clear, lineWidth: 3)
)
.overlay(
RoundedRectangle(cornerRadius: 6)
.strokeBorder(isCursor ? Color.white.opacity(0.9) : .clear, lineWidth: 1)
RoundedRectangle(cornerRadius: 2)
.strokeBorder(isCursor ? Color.accentColor : .clear, lineWidth: 2)
)
.task(id: imageURL) {
image = ImageLoader.shared.cachedThumbnail(imageURL)
@@ -171,7 +198,10 @@ extension ColorLabel {
case .yellow: return .yellow
case .green: return .green
case .blue: return .blue
case .purple: return .purple
case .purple: return Color(red: 0.85, green: 0.2, blue: 0.85)
case .cyan: return .cyan
case .orange: return .orange
case .gray: return Color(white: 0.45)
}
}
}