From b56798e9a8aabf707f0b59bfd8bc398b821eb25b Mon Sep 17 00:00:00 2001 From: shrimbly Date: Wed, 11 Mar 2026 08:48:14 +1300 Subject: [PATCH] fix: remove dead click-outside handler in FloatingNodeHeader The useEffect registered an event listener whose handler body was empty (only a comment stub), so it added overhead with no behavior. Co-Authored-By: Claude Opus 4.6 --- src/components/nodes/FloatingNodeHeader.tsx | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/src/components/nodes/FloatingNodeHeader.tsx b/src/components/nodes/FloatingNodeHeader.tsx index bd5cb5d6..ed067919 100644 --- a/src/components/nodes/FloatingNodeHeader.tsx +++ b/src/components/nodes/FloatingNodeHeader.tsx @@ -187,26 +187,6 @@ export const FloatingNodeHeader = memo(function FloatingNodeHeader({ return () => document.removeEventListener("mousedown", handleClickOutside); }, [isEditingComment, handleCommentSubmit]); - // Click outside handler for focused comment tooltip - useEffect(() => { - const handleClickOutsideTooltip = (e: MouseEvent) => { - if (tooltipRef.current && !tooltipRef.current.contains(e.target as Node)) { - // Clear focused comment (would need to be passed as a callback) - } - }; - - if (isCommentFocused && !isEditingComment) { - const timer = setTimeout(() => { - document.addEventListener("mousedown", handleClickOutsideTooltip); - }, 100); - return () => { - clearTimeout(timer); - document.removeEventListener("mousedown", handleClickOutsideTooltip); - }; - } - return () => document.removeEventListener("mousedown", handleClickOutsideTooltip); - }, [isCommentFocused, isEditingComment]); - // Determine if controls should be visible const showControls = isHovered || selected;