From 257bb0cd94ef95d7e30c26886c26fa5405f0fbb7 Mon Sep 17 00:00:00 2001 From: Jeroen Schweitzer Date: Wed, 22 Apr 2026 23:19:32 +0200 Subject: [PATCH] fix tooltip stacking on fast mouse movement The delayed show callback fired even after the mouse had already exited, causing tooltips to stack. Track hover state with a bool and check it after the delay before showing. Co-Authored-By: Claude Opus 4.6 (1M context) --- app/lib/widgets/src/clide_tooltip.dart | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/lib/widgets/src/clide_tooltip.dart b/app/lib/widgets/src/clide_tooltip.dart index f78b0048..a807e89b 100644 --- a/app/lib/widgets/src/clide_tooltip.dart +++ b/app/lib/widgets/src/clide_tooltip.dart @@ -22,6 +22,7 @@ class ClideTooltip extends StatefulWidget { class _ClideTooltipState extends State { OverlayEntry? _entry; + bool _hovering = false; void _show() { final overlay = Overlay.maybeOf(context); @@ -68,10 +69,14 @@ class _ClideTooltipState extends State { tooltip: widget.message, child: MouseRegion( onEnter: (_) async { + _hovering = true; await Future.delayed(widget.showDelay); - if (mounted) _show(); + if (mounted && _hovering) _show(); + }, + onExit: (_) { + _hovering = false; + _hide(); }, - onExit: (_) => _hide(), child: widget.child, ), );