From 7db2326a984e1eaf10e1ee52e8ca057a0f4bc469 Mon Sep 17 00:00:00 2001
From: Ariver <ar@MacBook-Air.local>
Date: Wed, 06 May 2026 16:33:22 +0800
Subject: [PATCH] checkpoint: v3.0.4 — 修复新建 tag 消失的 bug:addNewTag 写 TagDatabase.createTag 持久化
---
Apptag/TagEditorView.swift | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/Apptag/TagEditorView.swift b/Apptag/TagEditorView.swift
index 96e839d..4661760 100644
--- a/Apptag/TagEditorView.swift
+++ b/Apptag/TagEditorView.swift
@@ -147,13 +147,12 @@
// SIP-protected apps where xattr write silently fails.
}
- /// Add a new tag name+color to the local registry only (no xattr write until
- /// the tag is assigned to apps via "Edit App Categories").
- /// Does NOT call onRefresh — would overwrite tagColors with scan results.
+ /// Add a new tag name+color and persist to the database.
private func addNewTag() {
let name = newTagNameText.trimmingCharacters(in: .whitespaces)
guard !name.isEmpty else { return }
tagColors[name] = newTagColorIndex
+ TagEditor.createTag(name, color: newTagColorIndex)
addingNewTag = false
newTagNameText = ""
}
--
Gitblit v1.9.3