Bug: hovering a NavigationMenu trigger opens its Content after the
configured \`openDelay\` (default 200ms). If the user then clicked
the trigger — naturally, after the open is visible — the click handler
saw \`isOpen=true\` and called \`closeNow()\`, shutting the menu the
user just opened. Net effect: the first click appears to open AND
close the menu in one go.
Repro (commit before fix):
- hover for ≥200ms (or any delay long enough to trigger
\`scheduleOpen\`)
- menu opens
- click the trigger
- menu closes within milliseconds
Fix: track \`lastOpenedAt\` per NavigationMenuTriggerProvider via a
root \`\$effect\` that stamps the timestamp whenever \`isOpen\`
transitions to true (regardless of whether the open came from
hover, click, or keyboard). The click handler checks \`Date.now() -
lastOpenedAt < 250\` and silently ignores the close-toggle in that
window — treating the click as "commit the open" intent, not "toggle
shut".
Two-click toggle behavior is preserved: a click ≥250ms after the open
still closes the menu (verified: openBefore=true, stillOpenAfterClick=
true, closedAfter2ndClick=true). The 250ms threshold is slightly above
the default openDelay (200ms) so the protection covers the typical
hover-then-click sequence without making the toggle feel sluggish.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>