From b29f7228d5bacf7086b7155f24d92fffd65bda11 Mon Sep 17 00:00:00 2001
From: Ariver <shanghai3168@gmail.com>
Date: Sun, 31 May 2026 01:52:17 +0800
Subject: [PATCH] Prepare 7.8.6 explicit app grid launch release

---
 Apptag/ApptagApp.swift                                                                    |    6 +-
 Apptag/ProcessSingleton.swift                                                             |    6 ++
 Scripts/window_logic_qa.sh                                                                |   10 +++++
 Apptag/Info.plist                                                                         |    6 ++-
 Release/AppStore-7.8.6-20260531.0146/QA_RELEASE_EVIDENCE.md                               |   37 ++++++++++++++++++
 Release/AppStore-7.8.6-20260531.0146/README.md                                            |   29 ++++++++++++++
 CHANGELOG.md                                                                              |    7 +++
 Release/AppStore-7.8.6-20260531.0146/APP_STORE_ASSET_INVENTORY.md                         |   17 ++++++++
 Release/AppStore-7.8.6-20260531.0146/Archive/TagLauncher-7.8.6-20260531.0146-local-QA.dmg |    0 
 9 files changed, 112 insertions(+), 6 deletions(-)

diff --git a/Apptag/ApptagApp.swift b/Apptag/ApptagApp.swift
index 6b7c698..449efca 100644
--- a/Apptag/ApptagApp.swift
+++ b/Apptag/ApptagApp.swift
@@ -208,10 +208,10 @@
         configureApplicationMenuWhenAvailable(retries: 12)
     }
 
-    /// Dock icon click → show overlay (same as menubar "Show TagLauncher")
+    /// Reopening the already-running app must not implicitly show App Grid.
+    /// App Grid is only opened by explicit launcher commands: main hotkey or status item/menu.
     func applicationShouldHandleReopen(_ sender: NSApplication, hasVisibleWindows flag: Bool) -> Bool {
         guard Date() >= suppressReopenUntil else { return false }
-        showOrFocusOverlay()
         return false  // Suppress default "unhide all windows" behavior
     }
 
@@ -1477,7 +1477,7 @@
     }
 
     @objc private func handleExternalActivationRequest(_ notification: Notification) {
-        let shouldShowOverlay = notification.userInfo?["showOverlay"] as? Bool ?? true
+        let shouldShowOverlay = notification.userInfo?["showOverlay"] as? Bool ?? false
         guard shouldShowOverlay else { return }
         showOrFocusOverlay()
     }
diff --git a/Apptag/Info.plist b/Apptag/Info.plist
index 122fa50..153ed6e 100644
--- a/Apptag/Info.plist
+++ b/Apptag/Info.plist
@@ -19,15 +19,17 @@
 	<key>CFBundlePackageType</key>
 	<string>APPL</string>
 	<key>CFBundleShortVersionString</key>
-	<string>7.8.5</string>
+	<string>7.8.6</string>
 	<key>CFBundleVersion</key>
-	<string>20260530.1744</string>
+	<string>20260531.0146</string>
 	<key>LSApplicationCategoryType</key>
 	<string>public.app-category.utilities</string>
 	<key>LSMinimumSystemVersion</key>
 	<string>15.0</string>
 	<key>LSMultipleInstancesProhibited</key>
 	<true/>
+	<key>LSUIElement</key>
+	<true/>
 	<key>NSHighResolutionCapable</key>
 	<true/>
 	<key>NSPrincipalClass</key>
diff --git a/Apptag/ProcessSingleton.swift b/Apptag/ProcessSingleton.swift
index cf8db77..af0e54b 100644
--- a/Apptag/ProcessSingleton.swift
+++ b/Apptag/ProcessSingleton.swift
@@ -31,7 +31,11 @@
     }
 
     private static func handOffAndExit() -> Never {
-        let shouldShowOverlay = !CommandLine.arguments.dropFirst().contains("--hide")
+        let arguments = CommandLine.arguments.dropFirst()
+        let shouldShowOverlay = arguments.contains("--show-overlay")
+        if !shouldShowOverlay {
+            NSApplication.shared.setActivationPolicy(.accessory)
+        }
         let ownerInstance = NSRunningApplication
             .runningApplications(withBundleIdentifier: AppIdentity.bundleIdentifier)
             .filter { $0.processIdentifier != getpid() && !$0.isTerminated }
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c71395a..455be64 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,12 @@
 # TagLauncher Changelog
 
+## [7.8.6] — 2026-05-31
+
+- 修复未按主快捷键时 App Grid 可能被重复启动或外部激活路径误唤出的问题;App Grid 现在只由主快捷键或状态栏显式命令打开
+- 加固重复实例移交逻辑:默认不再显示 App Grid,非显示型重复实例先切到 accessory,避免产生多个 Dock 图标
+- 窗口 QA 增加“重复启动不显示 App Grid、不增加 Dock 图标”的回归用例
+- 版本号更新为 `7.8.6`,Build 更新为 `20260531.0146`
+
 ## [7.8.5] — 2026-05-30
 
 - 优化设置页语言列表布局:语言页从两列改为三列,并使用下方空白区域,默认可显示更多语言选项
diff --git a/Release/AppStore-7.8.6-20260531.0146/APP_STORE_ASSET_INVENTORY.md b/Release/AppStore-7.8.6-20260531.0146/APP_STORE_ASSET_INVENTORY.md
new file mode 100644
index 0000000..e280940
--- /dev/null
+++ b/Release/AppStore-7.8.6-20260531.0146/APP_STORE_ASSET_INVENTORY.md
@@ -0,0 +1,17 @@
+# App Store Asset Inventory
+
+This release pack freezes TagLauncher `7.8.6` build `20260531.0146`.
+
+## Included
+
+- `Archive/TagLauncher-7.8.6-20260531.0146-local-QA.dmg`
+- `README.md`
+- `QA_RELEASE_EVIDENCE.md`
+- `APP_STORE_ASSET_INVENTORY.md`
+
+## External Items Still Required For App Store Upload
+
+- Apple Developer Bundle ID selection/confirmation in App Store Connect.
+- Mac App Store signing certificate and provisioning profile.
+- Final App Store screenshots and metadata review before submission.
+
diff --git a/Release/AppStore-7.8.6-20260531.0146/Archive/TagLauncher-7.8.6-20260531.0146-local-QA.dmg b/Release/AppStore-7.8.6-20260531.0146/Archive/TagLauncher-7.8.6-20260531.0146-local-QA.dmg
new file mode 100644
index 0000000..d53d009
--- /dev/null
+++ b/Release/AppStore-7.8.6-20260531.0146/Archive/TagLauncher-7.8.6-20260531.0146-local-QA.dmg
Binary files differ
diff --git a/Release/AppStore-7.8.6-20260531.0146/QA_RELEASE_EVIDENCE.md b/Release/AppStore-7.8.6-20260531.0146/QA_RELEASE_EVIDENCE.md
new file mode 100644
index 0000000..d22afa4
--- /dev/null
+++ b/Release/AppStore-7.8.6-20260531.0146/QA_RELEASE_EVIDENCE.md
@@ -0,0 +1,37 @@
+# QA Release Evidence
+
+## Build Under Test
+
+- Version: `7.8.6`
+- Build: `20260531.0146`
+- App: `/Users/ar/Projects/Taglauncher/build/TagLauncher.app`
+- DMG: `/Users/ar/Projects/Taglauncher/build/TagLauncher.dmg`
+- Archived DMG: `Archive/TagLauncher-7.8.6-20260531.0146-local-QA.dmg`
+- DMG SHA-256: `2664a188b3cb601cc86a36d12e4e4b3aae7fb28f7b470caa8cb0f5ff58ca8bef`
+
+## Checks
+
+- Version metadata:
+  - `CFBundleShortVersionString = 7.8.6`
+  - `CFBundleVersion = 20260531.0146`
+  - `LSUIElement = true`
+- Code signing:
+  - `codesign --verify --deep --strict --verbose=2 build/TagLauncher.app`
+  - Result: passed
+- Disk image:
+  - `hdiutil verify build/TagLauncher.dmg`
+  - Result: passed
+- Window logic:
+  - `APP_BUILD=20260531.0146 Scripts/window_logic_qa.sh`
+  - Result: `ALL WINDOW LOGIC QA PASSED`
+- Duplicate launch regression:
+  - Repeated `open -n build/TagLauncher.app`
+  - Expected: one Dock tile, no App Grid
+  - Result: passed
+
+## Targeted Fix Coverage
+
+- Reopening an already-running app no longer implicitly shows App Grid.
+- Duplicate-instance notifications default to no overlay.
+- Non-show duplicate instances start with accessory activation policy to avoid Dock tile multiplication.
+
diff --git a/Release/AppStore-7.8.6-20260531.0146/README.md b/Release/AppStore-7.8.6-20260531.0146/README.md
new file mode 100644
index 0000000..b4df694
--- /dev/null
+++ b/Release/AppStore-7.8.6-20260531.0146/README.md
@@ -0,0 +1,29 @@
+# TagLauncher 7.8.6 Release Pack
+
+This folder freezes TagLauncher `7.8.6` build `20260531.0146` for local QA distribution and Mac App Store submission preparation.
+
+## Release Identity
+
+- Product: `TagLauncher`
+- Version: `7.8.6`
+- Build: `20260531.0146`
+- Branch: `codex/fix-quick-search-focus-routing`
+- Local QA DMG: `Archive/TagLauncher-7.8.6-20260531.0146-local-QA.dmg`
+- DMG SHA-256: `2664a188b3cb601cc86a36d12e4e4b3aae7fb28f7b470caa8cb0f5ff58ca8bef`
+
+## Changes Since 7.8.5
+
+- Removed the implicit App Grid show path from app reopen events.
+- Hardened duplicate-instance handoff so repeated launches do not show App Grid unless explicitly requested.
+- Started non-show duplicate instances as accessory processes to prevent duplicate Dock tiles.
+- Added window QA coverage for repeated duplicate launches: no extra Dock icons and no unexpected overlay.
+
+## Verification
+
+- App version metadata verified: `7.8.6 (20260531.0146)`
+- `LSUIElement = true`
+- `codesign --verify --deep --strict --verbose=2 build/TagLauncher.app`: passed
+- `hdiutil verify build/TagLauncher.dmg`: passed
+- `Scripts/window_logic_qa.sh`: passed
+- Targeted duplicate-launch check: repeated `open -n` kept one Dock tile and zero TagLauncher overlay windows.
+
diff --git a/Scripts/window_logic_qa.sh b/Scripts/window_logic_qa.sh
index 3d90bec..89beba4 100755
--- a/Scripts/window_logic_qa.sh
+++ b/Scripts/window_logic_qa.sh
@@ -1054,6 +1054,15 @@
 sleep 1.5
 assert_single_qa_app_instance
 assert_single_dock_tile
+swift_assert no-overlay
+for _ in {1..3}; do
+  "$APP_BUNDLE/Contents/MacOS/TagLauncher" >/dev/null 2>&1 &
+  sleep 0.25
+done
+sleep 2.0
+assert_single_qa_app_instance
+assert_single_dock_tile
+swift_assert no-overlay
 for _ in {1..3}; do
   "$APP_BUNDLE/Contents/MacOS/TagLauncher" --hide >/dev/null 2>&1 &
   sleep 0.25
@@ -1061,6 +1070,7 @@
 sleep 2.0
 assert_single_qa_app_instance
 assert_single_dock_tile
+swift_assert no-overlay
 kill_all_taglauncher_instances
 sleep 0.4
 swift_assert no-overlay

--
Gitblit v1.9.3