Ariver
2026-05-20 ec6e0da8224a54dd7273adc2a797f149fd9795c8
Apptag/SmartCategorization/SmartStartService.swift
@@ -261,7 +261,8 @@
                source: .localCatalog,
                reason: "Matched Smart Start catalog entry: \(matched.name)",
                provenance: matched.sourceEvidence,
                defaultNote: matched.localizedNote
                defaultNote: matched.localizedNote,
                defaultNoteCandidates: matched.notes?.values.map { $0 } ?? []
            ))
        }
@@ -314,6 +315,10 @@
                continue
            }
            if let result = TagDatabase.ensureSystemTag(for: categoryID, in: &store) {
                if var tagDef = store.tags[result.name] {
                    tagDef.color = categoryID.defaultColorIndex
                    store.tags[result.name] = tagDef
                }
                if result.created {
                    createdTagCount += 1
                }
@@ -348,12 +353,21 @@
            }
            if let defaultNote = assignment.defaultNote?.trimmingCharacters(in: .whitespacesAndNewlines),
               !defaultNote.isEmpty,
               store.appNotes[path]?.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty != false {
                store.appNotes[path] = String(defaultNote.prefix(TagDatabase.maxAppNoteLength))
                uncommonPaths.insert(path)
                if store.uncommonSources[path] == nil {
                    store.uncommonSources[path] = .auto
               !defaultNote.isEmpty {
                let currentNote = store.appNotes[path]?.trimmingCharacters(in: .whitespacesAndNewlines)
                let knownDefaultNotes = Set(assignment.defaultNoteCandidates.compactMap(normalizedNote))
                let normalizedCurrentNote = normalizedNote(currentNote)
                let shouldSeedNote = currentNote?.isEmpty != false
                    || normalizedCurrentNote.map { knownDefaultNotes.contains($0) } == true
                if shouldSeedNote {
                    store.appNotes[path] = String(defaultNote.prefix(TagDatabase.maxAppNoteLength))
                    if currentNote?.isEmpty != false {
                        uncommonPaths.insert(path)
                        if store.uncommonSources[path] == nil {
                            store.uncommonSources[path] = .auto
                        }
                    }
                }
            }
        }