From 597c5e5e13d9185d23329c020829df4b128a82a4 Mon Sep 17 00:00:00 2001
From: Ariver <shanghai3168@gmail.com>
Date: Sat, 13 Jun 2026 14:40:55 +0800
Subject: [PATCH] Fix outside blank tag removal drop

---
 src/Apptag/AppGridCollectionView.swift |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/src/Apptag/AppGridCollectionView.swift b/src/Apptag/AppGridCollectionView.swift
index 68e508c..5889cd3 100644
--- a/src/Apptag/AppGridCollectionView.swift
+++ b/src/Apptag/AppGridCollectionView.swift
@@ -282,10 +282,16 @@
                 if activeReorderCard === card {
                     activeReorderCard = nil
                 }
+                if lastReorderContainerID == card.containerID {
+                    lastReorderContainerID = ""
+                    lastReorderScreenFrame = nil
+                }
                 return
             }
             activeReorderCard?.clearReorderInsertion()
             activeReorderCard = nil
+            lastReorderContainerID = ""
+            lastReorderScreenFrame = nil
         }
 
         fileprivate func activeReorderPath(in containerID: String, copy: Bool) -> String? {
@@ -308,7 +314,8 @@
                   let lastReorderScreenFrame
             else { return false }
 
-            return lastReorderScreenFrame.insetBy(dx: -44, dy: -44).contains(screenPoint)
+            let guardOutset = AppGridCollectionMetrics.reorderEmptyDropCancelOutset
+            return lastReorderScreenFrame.insetBy(dx: -guardOutset, dy: -guardOutset).contains(screenPoint)
         }
 
         private static func signature(
@@ -860,6 +867,7 @@
     static let headerBottomGap: CGFloat = 6
     static let iconColumnGap: CGFloat = 6
     static let iconRowGap: CGFloat = 2
+    static let reorderEmptyDropCancelOutset: CGFloat = 4
     static let hoverScale: CGFloat = 1.22
     static let labelHeight: CGFloat = 14
 

--
Gitblit v1.9.3