Repository navigation
perf(popup-menu): track the pointer trail only while a submenu trigger is hovered - #586
Draft
kianbazza wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
kianbazza
force-pushed
the
ui-644-track-the-pointer-trail-only-while-a-submenu-trigger-is
branch
from
October 10, 2026 23:33
dfbd7a0 to
e665f20
Compare
This branch was successfully deployed
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.
Summary
Every mounted
SubmenuTriggerkept a sharedwindowpointermovelistener alive and recorded a point on every move anywhere on the page, even with nothing near a trigger. The trail now records only while something holds it: the trigger while it's hovered, and its leave monitor while it runs.The trail starts empty when the pointer enters the trigger. A fast pass that lands only one sample inside the trigger gets the leave point as its second point, so its heading follows the real path through the trigger instead of the fallback that aims at the submenu.
The per-move aim guard traces (
leave-monitor-pointermove,leave-monitor-hit-eval,pointermove-blocked-by-guard,pointermove-open-suppressed-after-explicit-close) now pass their details as a function, so nothing is built unlesslogAimGuardEventsis on.Evidence
pointer-trail.test.tsxcounts livewindowpointermovelisteners.AssertionError: expected 1 to be +0After: passes
Fast passes, one pointer sample inside the trigger:
Both pass. Without the leave point, "flick straight down" fails: a single sample falls back to aiming at the submenu and the guard activates.
The aim guard tests in
popup-menu.test.tsx(lifecycle, continuous aim monitoring,closeDelay, safe triangle) pass unchanged.use-mouse-trail.test.tsxnow takes a hold before checking that subscribers share one listener, since mounting no longer subscribes.Merge Danger
Door: two-way
Blast Radius: small
Submenu aim only. The heading at leave now comes from the moves over the trigger (plus the leave point when there's only one), not from moves before the pointer reached it. When the pointer crosses the trigger in a single sample, that is a shorter path than before. A trigger hidden by filtering while a leave monitor runs now ends that monitor right away instead of at its timeout.
Closes UI-644