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/ContentView.swift |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Apptag/ContentView.swift b/Apptag/ContentView.swift
index 4a4e4f4..66c849e 100644
--- a/Apptag/ContentView.swift
+++ b/Apptag/ContentView.swift
@@ -272,10 +272,10 @@
         if phase != .none {
             NotificationCenter.default.post(name: .apptagEditModeChanged, object: nil, userInfo: ["active": true])
             NSApp.activate(ignoringOtherApps: true)
-            // Sync drag order from database when entering edit mode
-            if draggedTagNames.isEmpty {
-                draggedTagNames = TagEditor.orderedTagNames()
-            }
+            // Always sync tag list from database when entering edit mode
+            let store = TagDatabase.load()
+            tagColors = store.tags.mapValues { $0.color }
+            draggedTagNames = TagEditor.orderedTagNames()
         }
         editPhase = phase
         if phase == .none {

--
Gitblit v1.9.3