PM-Einstellungen komplett importieren (Vorlagen, Code-Dateien, Trennzeichen, Feld-Listen, Ingest), ▾-Wertelisten, Info-Fenster ⌘B/⌘N + Pfeiltasten, Keyword-Limit pro Eintrag

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 00:52:42 +00:00
1 parent 12f61b5d66
commit 2bf0d851aa
11 files changed
+516 -15

No files matched your search

@@ -87,6 +87,7 @@ final class AppState: ObservableObject {
@Published var showTemplatePicker = false
@Published var showTemplateManager = false
@Published var showIngest = false
@Published var showPMImport = false
@Published var windowRequest: WindowRequest?
/// Card(s) that triggered the ingest window.
@Published var pendingIngestSources: [URL] = []
@@ -682,9 +683,21 @@ final class AppState: ObservableObject {
Task { await applyIPTCAndWait(draft, fields: fields, to: targets) }
}
/// Remembers used values for the ▾ list of each field (most recent first, like PM's recent values).
func rememberFieldValues(_ values: IPTCValues, fields: [IPTCField]) {
for f in fields where f.kind != .list && f.kind != .multiline {
guard let v = values.text[f.id]?.trimmingCharacters(in: .whitespaces), !v.isEmpty, !v.contains("{") else { continue }
var list = settings.fieldLists[f.id] ?? []
list.removeAll { $0 == v }
list.insert(v, at: 0)
settings.fieldLists[f.id] = Array(list.prefix(60))
}
}
@discardableResult
func applyIPTCAndWait(_ draft: IPTCValues, fields: [IPTCField], to targets: [PhotoItem]) async -> Bool {
guard !targets.isEmpty, !fields.isEmpty, let w = writer else { return false }
rememberFieldValues(draft, fields: fields)
statusText = "Schreibe IPTC in \(targets.count) Bild(er) …"
var count = 0
for t in targets {