From ec6e0da8224a54dd7273adc2a797f149fd9795c8 Mon Sep 17 00:00:00 2001
From: Ariver <shanghai3168@gmail.com>
Date: Wed, 20 May 2026 12:51:53 +0800
Subject: [PATCH] chore: mark stable baseline as 7.6.0
---
Apptag/AppGridItem.swift | 22 +++++++++++++---------
1 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/Apptag/AppGridItem.swift b/Apptag/AppGridItem.swift
index 5a9a61b..746d384 100644
--- a/Apptag/AppGridItem.swift
+++ b/Apptag/AppGridItem.swift
@@ -10,7 +10,7 @@
var sourceTag: String? = nil
var dragModeActive: Bool = false
var onDragModeChange: ((Bool) -> Void)? = nil
- var onBubbleHover: ((AppInfo, CGRect, Bool) -> Void)? = nil
+ var onBubbleHover: ((AppInfo, CGRect, AppBubbleHoverEvent) -> Void)? = nil
var onEditNote: ((AppInfo, CGRect) -> Void)? = nil
var bubbleDisabled: Bool = false
var itemID: String
@@ -75,16 +75,15 @@
interactionFrame = frame
if bubbleDisabled || dragModeActive {
setHoverState(false)
- onBubbleHover?(app, frame, false)
+ onBubbleHover?(app, frame, .exited)
return
}
if hovering {
setHoverState(true)
- guard shouldShowAppBubble else { return }
- onBubbleHover?(app, frame, hovering)
+ onBubbleHover?(app, frame, .entered(canShowBubble: shouldShowAppBubble))
} else if isHovered {
setHoverState(false)
- onBubbleHover?(app, frame, hovering)
+ onBubbleHover?(app, frame, .exited)
} else {
setHoverState(false)
}
@@ -98,23 +97,23 @@
}
.opacity(dragModeActive ? 0.92 : 1)
.animation(.easeOut(duration: 0.08), value: dragModeActive)
- .id(dragResetToken)
+ .id("\(itemID)|reset-\(dragResetToken)")
.onChange(of: dragModeActive) { _, active in
if active {
setHoverState(false)
- onBubbleHover?(app, interactionFrame, false)
+ onBubbleHover?(app, interactionFrame, .exited)
}
}
.onChange(of: bubbleDisabled) { _, disabled in
if disabled {
setHoverState(false)
- onBubbleHover?(app, interactionFrame, false)
+ onBubbleHover?(app, interactionFrame, .exited)
}
}
.onDisappear {
if hoveredAppItemID == itemID {
hoveredAppItemID = nil
- onBubbleHover?(app, interactionFrame, false)
+ onBubbleHover?(app, interactionFrame, .exited)
}
}
}
@@ -138,6 +137,11 @@
}
}
+enum AppBubbleHoverEvent {
+ case entered(canShowBubble: Bool)
+ case exited
+}
+
private struct AppGridItemHoverTracker: NSViewRepresentable {
let onHover: (Bool, CGRect) -> Void
--
Gitblit v1.9.3