fix(core): keep ActionPanel submenu open when hovering into it - #17
Open
kinged007 wants to merge 1 commit into
Open
fix(core): keep ActionPanel submenu open when hovering into it#17kinged007 wants to merge 1 commit into
kinged007 wants to merge 1 commit into
Conversation
The ActionPanel source submenu used openOnHover with delay 0/closeDelay 0, which relies on floating-ui's safePolygon hover-intent. The polygon geometry is degenerate when the popup is taller/wider than its trigger and flips to the opposite side, so the popup closes while the pointer is still inside it (or while moving into it), making the action buttons hard to click. Replace with controlled open state and a standard hover-intent pattern: a 150ms close grace period that is cancelled whenever the pointer is over the trigger or the popup. Also set the selected source when opening via hover so the plugin action panels (preview/comments) render on first open.
kinged007
force-pushed
the
fix/submenu-hover-close
branch
from
August 11, 2026 21:59
c1cef50 to
ab5bcc9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix: ActionPanel source submenu closes when moving the mouse into it
Fixes #16
Problem
In the element inspector's action panel, hovering a source entry opens the plugin submenu (code preview + "Add comment" / "Copy path" actions), but the submenu disappears as soon as the mouse moves into it — even while the pointer is still inside the popup. Clicking entries is also flaky ("buttons sometimes unclickable") because the menu can close before the click lands.
Root cause
The
SubmenuusedDropdownMenu.TriggerwithopenOnHover,delay={0},closeDelay={0}. Base UI's hover-close path is governed by floating-ui'ssafePolygon, which only keeps the popup open if the pointer travels through a narrow safe zone between the trigger and the popup:side="right"withcollisionPadding).POLYGON_BUFFER / 2= 0.25px from the cursor), so any diagonal traversal or small vertical deviation while crossing the 4px gap exits the polygon and closes the menu — even though the pointer is about to enter (or is already inside) the popup's bounding box.closeDelay={0}means any missed "landing" closes the menu immediately.Fix
Replace the
openOnHover/safePolygon close behavior with a standard hover-intent pattern that react-trace fully controls:openstate on theDropdownMenu.Root.SUBMENU_CLOSE_DELAY_MS) that is cancelled whenever the pointer is over the trigger or the popup.setSelectedSource) when opening via hover too — previously the hover-open path (which goes through the controlledopenprop) never ransetSelectedSource, so the plugin action panels rendered an empty popup on the first hover until a click opened the menu throughonOpenChange.Verification
Reproduced the original bug headlessly against a dev server (popup closed 3px inside its edge while moving the mouse in), then verified the fix: