From 8fec0d26e8637a1c96dbcac841417fdd176d480a Mon Sep 17 00:00:00 2001
From: Ariver <shanghai3168@gmail.com>
Date: Sun, 07 Jun 2026 01:28:37 +0800
Subject: [PATCH] docs: add App Store Connect filling guide

---
 Apptag/ApptagApp.swift |   44 ++++++++++++++++++++++++++++++++++++++------
 1 files changed, 38 insertions(+), 6 deletions(-)

diff --git a/Apptag/ApptagApp.swift b/Apptag/ApptagApp.swift
index c35007f..b26b6f7 100644
--- a/Apptag/ApptagApp.swift
+++ b/Apptag/ApptagApp.swift
@@ -210,6 +210,14 @@
         setupLaunchAtLogin()
         suppressReopenUntil = Date().addingTimeInterval(1.0)
         configureApplicationMenuWhenAvailable(retries: 200)
+        warmAppIndexInBackground()
+    }
+
+    /// Pre-scan application folders so the first App Grid open can hydrate from cache quickly.
+    private func warmAppIndexInBackground() {
+        DispatchQueue.global(qos: .utility).async {
+            _ = AppIndexer.scan(useCache: true)
+        }
     }
 
     func applicationDidBecomeActive(_ notification: Notification) {
@@ -430,7 +438,11 @@
         }
 
         if isQuickSearchOpen {
-            NotificationCenter.default.post(name: .tagLauncherQuickSearchDismissRequested, object: nil)
+            NotificationCenter.default.post(
+                name: .tagLauncherQuickSearchDismissRequested,
+                object: nil,
+                userInfo: ["source": QuickSearchDismissSource.programmatic]
+            )
         }
 
         if !requiresForegroundOwnership {
@@ -987,7 +999,11 @@
         isQuickSearchOpen = false
         removeQuickSearchExternalMouseMonitor()
         updateOverlayLevelForTextInput()
-        NotificationCenter.default.post(name: .tagLauncherQuickSearchDismissRequested, object: nil)
+        NotificationCenter.default.post(
+            name: .tagLauncherQuickSearchDismissRequested,
+            object: nil,
+            userInfo: ["source": QuickSearchDismissSource.keyboard]
+        )
         if shouldHideOverlayAfterDismiss {
             quickSearchShouldHideOverlayOnClose = false
             quickSearchOnlyOverlaySession = false
@@ -1526,7 +1542,11 @@
         ) { [weak self] _ in
             DispatchQueue.main.async {
                 guard self?.isQuickSearchOpen == true else { return }
-                NotificationCenter.default.post(name: .tagLauncherQuickSearchDismissRequested, object: nil)
+                NotificationCenter.default.post(
+                    name: .tagLauncherQuickSearchDismissRequested,
+                    object: nil,
+                    userInfo: ["source": QuickSearchDismissSource.mouse]
+                )
             }
         }
     }
@@ -1538,7 +1558,11 @@
         ) { [weak self] event in
             guard let self, self.isQuickSearchOpen else { return event }
             if event.window === self.overlayWindow {
-                NotificationCenter.default.post(name: .tagLauncherQuickSearchDismissRequested, object: nil)
+                NotificationCenter.default.post(
+                    name: .tagLauncherQuickSearchDismissRequested,
+                    object: nil,
+                    userInfo: ["source": QuickSearchDismissSource.mouse]
+                )
                 return nil
             }
             return event
@@ -1633,7 +1657,11 @@
         updateOverlayLevelForTextInput()
         quickSearchShouldHideOverlayOnClose = false
         quickSearchOnlyOverlaySession = false
-        NotificationCenter.default.post(name: .tagLauncherQuickSearchDismissRequested, object: nil)
+        NotificationCenter.default.post(
+            name: .tagLauncherQuickSearchDismissRequested,
+            object: nil,
+            userInfo: ["source": QuickSearchDismissSource.programmatic]
+        )
     }
 
     @objc private func switchLanguage(_ sender: NSMenuItem) {
@@ -1695,7 +1723,11 @@
         }
         if hit == self {
             if quickSearchSuppressesBackdropDismiss {
-                NotificationCenter.default.post(name: .tagLauncherQuickSearchDismissRequested, object: nil)
+                NotificationCenter.default.post(
+                    name: .tagLauncherQuickSearchDismissRequested,
+                    object: nil,
+                    userInfo: ["source": QuickSearchDismissSource.backdrop]
+                )
                 return
             }
             if suppressBackdropDismiss {

--
Gitblit v1.9.3