Neues Design 'Leuchttisch' (warmes Graphit, Bernstein-Akzent) für alle Fenster; Lupe im Studio-Layout (Filmstreifen + IPTC-Panel mit ⌘N/⌘B); Matchday-Ansicht (Teamleiste, Spielerinnen-Liste, Teamfilter, Kacheln mit Teamfarbe + Nummer)

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-04 15:40:53 +00:00
1 parent 44f995c3d0
commit 7a349b8c34
13 files changed
+920 -203

No files matched your search

+106 -71
View File
@@ -18,6 +18,7 @@ struct ContactSheetView: View {
isCursor: state.cursorID == item.id,
imageURL: state.previewURL(for: item),
badge: state.suggestionBadge(for: item.id),
player: state.matchdayActive ? state.playerInfo(for: item) : nil,
onTagClick: { tagClick(item) })
.equatable()
.id(item.id)
@@ -29,7 +30,7 @@ struct ContactSheetView: View {
}
.padding(10)
}
.background(Color(white: 0.22))
.background(LK.ground)
.onChange(of: state.cursorID) { _, id in
if let id { proxy.scrollTo(id) }
}
@@ -108,113 +109,147 @@ struct ThumbnailCell: View, Equatable {
let imageURL: URL
/// open jersey suggestions ("#10 #7")
let badge: String?
/// Matchday: main player (team color edge + big number)
let player: AppState.PlayerInfo?
let onTagClick: () -> Void
@State private var image: NSImage?
static func == (a: ThumbnailCell, b: ThumbnailCell) -> Bool {
a.item == b.item && a.size == b.size && a.selected == b.selected && a.isCursor == b.isCursor && a.imageURL == b.imageURL && a.badge == b.badge
a.item == b.item && a.size == b.size && a.selected == b.selected && a.isCursor == b.isCursor && a.imageURL == b.imageURL && a.badge == b.badge && a.player == b.player
}
/// 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 = {
private static let timeFormatter: DateFormatter = {
let f = DateFormatter()
f.dateFormat = "dd.MM.yyyy - HH:mm:ss"
f.dateFormat = "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: " - ")
private var timeLine: String {
item.captureDate.map { ThumbnailCell.timeFormatter.string(from: $0) } ?? ""
}
var body: some View {
let textColor: Color = selected ? .black : .primary
VStack(spacing: 2) {
VStack(alignment: .leading, spacing: 0) {
ZStack {
Rectangle().fill(LK.deep)
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 - 14, height: (size - 14) * 0.75)
.overlay(alignment: .topTrailing) {
if let badge {
Text(badge)
.font(.system(size: 10, weight: .bold).monospacedDigit())
.foregroundStyle(.white)
.padding(.horizontal, 5).padding(.vertical, 2)
.background(Capsule().fill(Color.blue.opacity(0.85)))
.padding(4)
.help("Spieler-Vorschlag – mit I prüfen und annehmen")
.frame(width: size - 20, height: (size - 20) * 0.72)
.clipShape(RoundedRectangle(cornerRadius: 8))
// Matchday: team color edge
.overlay(alignment: .leading) {
if let t = player?.team {
UnevenRoundedRectangle(topLeadingRadius: 8, bottomLeadingRadius: 8)
.fill(t.shirtColor.swiftUI).frame(width: 5)
}
}
.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)
}
// tag: amber check, top left
.overlay(alignment: .topLeading) {
Button(action: onTagClick) {
Group {
if item.tagged {
Image(systemName: "checkmark")
.font(.system(size: 11, weight: .heavy))
.foregroundStyle(LK.onAmber)
.frame(width: 22, height: 22)
.background(RoundedRectangle(cornerRadius: 6).fill(LK.amber))
} else {
RoundedRectangle(cornerRadius: 6).stroke(Color.white.opacity(selected || isCursor ? 0.6 : 0.0), lineWidth: 1.5)
.frame(width: 22, height: 22)
}
}
.foregroundStyle(item.label == nil ? Color.primary.opacity(0.6) : Color.white)
}
.frame(height: 12)
Button(action: onTagClick) {
Image(systemName: item.tagged ? "checkmark.square.fill" : "square")
.font(.system(size: 14))
.foregroundStyle(item.tagged ? (selected ? Color.black : Color.white) : Color.secondary)
.padding(8)
.contentShape(Rectangle())
}
.buttonStyle(.plain)
.help("Tag (T)")
}
.padding(.horizontal, 8)
.padding(.bottom, 6)
// open player suggestion
.overlay(alignment: .bottomTrailing) {
if let badge {
Text(badge)
.font(LK.mono(11, .semibold))
.foregroundStyle(LK.amber)
.padding(.horizontal, 8).padding(.vertical, 3)
.background(Capsule().fill(LK.deep.opacity(0.88)))
.padding(8)
.help("Spieler-Vorschlag – prüfen mit I oder in der Lupe")
}
}
if let player {
// Matchday line: number in team color + name
HStack(spacing: 8) {
Text(player.number.map(String.init) ?? "–")
.font(.system(size: 20, weight: .heavy, design: .rounded))
.foregroundStyle(player.team?.shirtColor.swiftUI ?? LK.text2)
.frame(minWidth: 26, alignment: .leading)
VStack(alignment: .leading, spacing: 1) {
Text(player.name + (player.confirmed ? "" : " ?"))
.font(.system(size: 12, weight: .semibold)).foregroundStyle(LK.text).lineLimit(1)
Text(timeLine).font(LK.mono(11)).foregroundStyle(LK.muted)
}
Spacer(minLength: 2)
stars
}
.padding(.top, 9)
} else {
HStack(spacing: 8) {
Circle().fill(item.label?.lkColor ?? LK.faint).frame(width: 9, height: 9)
Text(item.filename).font(LK.mono(11.5, .medium)).foregroundStyle(LK.text)
.lineLimit(1).truncationMode(.middle)
if !item.companions.isEmpty {
Text(item.companions.map { $0.pathExtension.uppercased() }.joined(separator: "+"))
.font(.system(size: 9, weight: .bold)).foregroundStyle(LK.muted)
}
}
.padding(.top, 9)
HStack {
Text(timeLine).font(LK.mono(11)).foregroundStyle(LK.muted)
if !item.iptc.isEmpty(Self.captionField) {
Image(systemName: "text.alignleft").font(.system(size: 9)).foregroundStyle(LK.muted)
.help("Hat Bildunterschrift")
}
Spacer()
stars
}
.padding(.top, 3)
}
}
.padding(10)
.frame(width: size)
.background(
RoundedRectangle(cornerRadius: 2)
.fill(selected ? ThumbnailCell.selectedFill : Color(white: 0.30))
)
.background(RoundedRectangle(cornerRadius: 12).fill(selected ? LK.selected : LK.card))
.overlay(
RoundedRectangle(cornerRadius: 2)
.strokeBorder(isCursor ? Color.accentColor : .clear, lineWidth: 2)
RoundedRectangle(cornerRadius: 12)
.stroke(selected ? LK.amber : (isCursor ? LK.amber.opacity(0.5) : Color.clear), lineWidth: selected ? 2 : 1)
)
.shadow(color: selected ? LK.amber.opacity(0.18) : .clear, radius: 14, y: 6)
.overlay(alignment: .topTrailing) {
// color class as small tab in the corner (matchday shows team instead of the dot line)
if player != nil, let l = item.label {
Circle().fill(l.lkColor).frame(width: 9, height: 9).padding(16)
}
}
.task(id: imageURL) {
image = ImageLoader.shared.cachedThumbnail(imageURL)
if image == nil { image = await ImageLoader.shared.thumbnail(for: imageURL) }
}
}
private static let captionField = IPTCField.byID["caption"]!
private var stars: some View {
HStack(spacing: 1) {
ForEach(0..<item.rating, id: \.self) { _ in
Image(systemName: "star.fill").font(.system(size: 9))
}
}
.foregroundStyle(LK.amber)
}
}
extension ColorLabel {