From e3a788e6d4d8125f15c3f1451e64721d118a63cb Mon Sep 17 00:00:00 2001
From: Ariver <ar@MacBook-Air.local>
Date: Wed, 06 May 2026 16:36:56 +0800
Subject: [PATCH] checkpoint: v3.0.4 — 每次进入编辑模式强制刷新 tagColors+draggedTagNames 从 DB,确保新建 tag 可见

---
 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