From 6f3ed4f3b8eb45734ca77916b4c96fab937cb2e2 Mon Sep 17 00:00:00 2001
From: Ariver <shanghai3168@gmail.com>
Date: Sun, 31 May 2026 02:58:27 +0800
Subject: [PATCH] Prepare 7.8.7 dock policy release
---
Apptag/ContentView.swift | 65 ++++++++++++++++++++++++++++----
1 files changed, 56 insertions(+), 9 deletions(-)
diff --git a/Apptag/ContentView.swift b/Apptag/ContentView.swift
index e5389cd..9b6ce7c 100644
--- a/Apptag/ContentView.swift
+++ b/Apptag/ContentView.swift
@@ -313,6 +313,7 @@
var editingBubble: AppBubbleContext? = nil
var pendingUncategorizedDrop: PendingUncategorizedDrop? = nil
var pendingTagRemovalDrop: PendingTagRemovalDrop? = nil
+ var uncategorizedDropSuppressFuturePrompt = false
var tagRemovalDropSuppressFuturePrompt = false
var appDragResetToken = 0
var bubbleDraftNote = ""
@@ -386,6 +387,7 @@
@State private var quickSearchFocusToken = 0
@State private var quickSearchSelectionScrollToken = 0
@State private var quickSearchCloseHidesOverlay = false
+ @State private var quickSearchOnlySession = false
@State private var quickSearchErrorMessage: String? = nil
@State private var initialQuickSearchConsumed = false
@@ -393,8 +395,10 @@
self.hideOverlay = hideOverlay
self.initialQuickSearchSource = initialQuickSearchSource
let startsInQuickSearch = initialQuickSearchSource != nil
+ let startsInQuickSearchOnlySession = initialQuickSearchSource == QuickSearchOpenSource.globalHidden
_quickSearchVisible = State(initialValue: startsInQuickSearch)
- _quickSearchCloseHidesOverlay = State(initialValue: initialQuickSearchSource == QuickSearchOpenSource.globalHidden)
+ _quickSearchCloseHidesOverlay = State(initialValue: startsInQuickSearchOnlySession)
+ _quickSearchOnlySession = State(initialValue: startsInQuickSearchOnlySession)
_quickSearchFocusToken = State(initialValue: startsInQuickSearch ? 1 : 0)
}
@@ -409,6 +413,7 @@
@AppStorage("showUncommonAppBubbles") private var showUncommonAppBubbles = AppDefaults.showUncommonAppBubbles
@AppStorage("useAppKitTagNavigation") private var useAppKitTagNavigation = AppDefaults.useAppKitTagNavigation
@AppStorage("skipTagRemovalDropConfirm") private var skipTagRemovalDropConfirm = false
+ @AppStorage("skipUncategorizedDropConfirm") private var skipUncategorizedDropConfirm = false
private let editSidebarWidth: CGFloat = 188
private let editSidebarHorizontalInset: CGFloat = 12
@@ -445,7 +450,10 @@
}
private var shouldRenderAppGridBehindQuickSearch: Bool {
- !quickSearchVisible || !quickSearchCloseHidesOverlay
+ if quickSearchOnlySession {
+ return false
+ }
+ return !quickSearchVisible || !quickSearchCloseHidesOverlay
}
var body: some View {
@@ -525,7 +533,10 @@
refreshAppsIfNeeded()
if let initialQuickSearchSource, !initialQuickSearchConsumed {
initialQuickSearchConsumed = true
- quickSearchCloseHidesOverlay = initialQuickSearchSource == QuickSearchOpenSource.globalHidden
+ if initialQuickSearchSource == QuickSearchOpenSource.globalHidden {
+ quickSearchCloseHidesOverlay = true
+ quickSearchOnlySession = true
+ }
if !quickSearchVisible {
quickSearchVisible = true
quickSearchFocusToken &+= 1
@@ -534,7 +545,10 @@
NotificationCenter.default.post(
name: .tagLauncherQuickSearchVisibilityChanged,
object: nil,
- userInfo: ["active": true]
+ userInfo: [
+ "active": true,
+ "hideOverlayOnClose": quickSearchCloseHidesOverlay
+ ]
)
}
}
@@ -546,6 +560,8 @@
.onReceive(NotificationCenter.default.publisher(for: .tagLauncherOverlayDidHide)) { _ in
resetTransientDragState()
closeQuickSearch(notify: true, hideOverlayIfNeeded: false)
+ quickSearchOnlySession = false
+ quickSearchCloseHidesOverlay = false
}
.onReceive(NotificationCenter.default.publisher(for: .tagLauncherQuickSearchRequested)) { notification in
let source = notification.userInfo?["source"] as? String ?? QuickSearchOpenSource.mainOverlay
@@ -703,7 +719,11 @@
private func openQuickSearch(source: String) {
guard canOpenQuickSearch else { return }
dismissAppBubble()
- quickSearchCloseHidesOverlay = source == QuickSearchOpenSource.globalHidden
+ if source == QuickSearchOpenSource.globalHidden {
+ quickSearchOnlySession = true
+ }
+ quickSearchCloseHidesOverlay = quickSearchCloseHidesOverlay
+ || source == QuickSearchOpenSource.globalHidden
quickSearchVisible = true
quickSearchQuery = ""
quickSearchManualSelection = false
@@ -713,7 +733,10 @@
NotificationCenter.default.post(
name: .tagLauncherQuickSearchVisibilityChanged,
object: nil,
- userInfo: ["active": true]
+ userInfo: [
+ "active": true,
+ "hideOverlayOnClose": quickSearchCloseHidesOverlay
+ ]
)
}
@@ -734,16 +757,20 @@
quickSearchSelectedID = nil
quickSearchManualSelection = false
quickSearchErrorMessage = nil
- quickSearchCloseHidesOverlay = false
if notify {
NotificationCenter.default.post(
name: .tagLauncherQuickSearchVisibilityChanged,
object: nil,
- userInfo: ["active": false]
+ userInfo: [
+ "active": false,
+ "hideOverlayOnClose": shouldHideOverlay
+ ]
)
}
if shouldHideOverlay {
hideOverlay()
+ } else {
+ quickSearchCloseHidesOverlay = false
}
}
@@ -1420,6 +1447,8 @@
UncategorizedDropConfirmBubble(
title: tr("drop.uncategorizedConfirmTitle"),
message: uncategorizedConfirmMessage(for: pendingDrop),
+ doNotRemindTitle: tr("drop.removeTagDoNotAskAgain"),
+ doNotRemind: $appGridInteraction.uncategorizedDropSuppressFuturePrompt,
cancelTitle: tr("tag.cancel"),
confirmTitle: tr("edit.confirm"),
onCancel: dismissUncategorizedDropConfirm,
@@ -1728,7 +1757,9 @@
}
private func handleAppGridScrollActivity() {
- appGridInteraction.hoveredBubble = nil
+ if appGridInteraction.hoveredBubble != nil {
+ appGridInteraction.hoveredBubble = nil
+ }
}
private func handleBubbleHover(app: AppInfo, frame: CGRect, event: AppBubbleHoverEvent) {
@@ -2046,7 +2077,13 @@
guard !removableTags.isEmpty else { return }
let assignedTags = assignedRegularDisplayTags(for: removableTags)
+ if skipUncategorizedDropConfirm {
+ moveDroppedAppToUncategorized(path: app.path.path, tags: removableTags)
+ return
+ }
+
clearAppBubbleState()
+ appGridInteraction.uncategorizedDropSuppressFuturePrompt = false
withAnimation(.spring(response: 0.24, dampingFraction: 0.84)) {
appGridInteraction.pendingUncategorizedDrop = PendingUncategorizedDrop(
app: app,
@@ -2100,6 +2137,7 @@
}
private func dismissUncategorizedDropConfirm() {
+ appGridInteraction.uncategorizedDropSuppressFuturePrompt = false
resetTransientDragState(keepingPendingUncategorizedDrop: true)
withAnimation(.easeOut(duration: 0.18)) {
appGridInteraction.pendingUncategorizedDrop = nil
@@ -2110,10 +2148,19 @@
guard let pendingDrop = appGridInteraction.pendingUncategorizedDrop else { return }
let path = pendingDrop.app.path.path
let tags = pendingDrop.removableTags
+ let shouldSuppressFuturePrompt = appGridInteraction.uncategorizedDropSuppressFuturePrompt
+ if shouldSuppressFuturePrompt {
+ skipUncategorizedDropConfirm = true
+ }
+ appGridInteraction.uncategorizedDropSuppressFuturePrompt = false
resetTransientDragState(keepingPendingUncategorizedDrop: true)
withAnimation(.easeOut(duration: 0.16)) {
appGridInteraction.pendingUncategorizedDrop = nil
}
+ moveDroppedAppToUncategorized(path: path, tags: tags)
+ }
+
+ private func moveDroppedAppToUncategorized(path: String, tags: [String]) {
guard !tags.isEmpty else { return }
TagEditor.removeTags(tags, from: [path])
showDropRefresh()
--
Gitblit v1.9.3