From 28be00ea53666fd5500a702a3c187c0e27dd90ad Mon Sep 17 00:00:00 2001
From: Ariver <shanghai3168@gmail.com>
Date: Sat, 27 Jun 2026 16:26:30 +0800
Subject: [PATCH] Simplify SmartStart default categories

---
 src/Apptag/ContentView.swift |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/src/Apptag/ContentView.swift b/src/Apptag/ContentView.swift
index 80fb99e..2560bb9 100644
--- a/src/Apptag/ContentView.swift
+++ b/src/Apptag/ContentView.swift
@@ -19,6 +19,7 @@
     static let theme = "theme"
     static let tags = "tags"
     static let data = "data"
+    static let about = "about"
 }
 
 // MARK: - Edit Phase
@@ -2953,6 +2954,15 @@
             closeQuickSearch(hideOverlayIfNeeded: true)
             hideOverlay()
         }
+        if isCurrentApp(app) {
+            if closeQuickSearchOnSuccess && !closeQuickSearchAndOverlayBeforeOpening {
+                closeQuickSearch(hideOverlayIfNeeded: closeOverlayOnSuccess)
+            }
+            if closeOverlayOnSuccess && !closeQuickSearchAndOverlayBeforeOpening {
+                hideOverlay()
+            }
+            return
+        }
         let configuration = NSWorkspace.OpenConfiguration()
         NSWorkspace.shared.openApplication(at: app.path, configuration: configuration) { _, error in
             DispatchQueue.main.async {
@@ -2974,6 +2984,16 @@
         }
     }
 
+    private func isCurrentApp(_ app: AppInfo) -> Bool {
+        if app.bundleIdentifier?.caseInsensitiveCompare(AppIdentity.bundleIdentifier) == .orderedSame {
+            return true
+        }
+
+        let currentURL = Bundle.main.bundleURL.standardizedFileURL.resolvingSymlinksInPath()
+        let appURL = app.path.standardizedFileURL.resolvingSymlinksInPath()
+        return currentURL == appURL
+    }
+
     func openApp(_ app: AppInfo) {
         hideOverlay()
         launchApp(app, closeOverlayOnSuccess: false)

--
Gitblit v1.9.3