Summary
The in-app menus (the titlebar hamburger menu and the context menus) are not mutually exclusive: opening one does not dismiss another that is already open, so two menus can be on screen at once.
Reproduction
- Left-click the titlebar hamburger to open its menu.
- Without clicking elsewhere, right-click a tab (or the document area).
- The context menu opens while the hamburger menu stays open.
The stale menu also survives focus loss — e.g. it remains open while another window comes to the foreground.
Mechanism
Each menu instance dismisses itself on an outside left-click (click/mousedown listeners), but:
- a
contextmenu (right-click) event is not one of the dismissal triggers, so opening menu B never closes menu A;
- window blur / focus change is not a dismissal trigger either, so a menu outlives the window's foreground status.
There is no shared "only one menu open" coordination between the independent menu components.
Suggested fix
Either dismiss on contextmenu + window blur in the shared ContextMenu component, or introduce a tiny module-level "current open menu" token so opening any menu closes the previous one. Both are local to the menu component and need no changes at call sites.
(Noticed while QA-ing the multiwindow work in #214; independent of it — reproducible in a single window.)
🤖 Generated with Claude Code
Summary
The in-app menus (the titlebar hamburger menu and the context menus) are not mutually exclusive: opening one does not dismiss another that is already open, so two menus can be on screen at once.
Reproduction
The stale menu also survives focus loss — e.g. it remains open while another window comes to the foreground.
Mechanism
Each menu instance dismisses itself on an outside left-click (
click/mousedownlisteners), but:contextmenu(right-click) event is not one of the dismissal triggers, so opening menu B never closes menu A;There is no shared "only one menu open" coordination between the independent menu components.
Suggested fix
Either dismiss on
contextmenu+ windowblurin the shared ContextMenu component, or introduce a tiny module-level "current open menu" token so opening any menu closes the previous one. Both are local to the menu component and need no changes at call sites.(Noticed while QA-ing the multiwindow work in #214; independent of it — reproducible in a single window.)
🤖 Generated with Claude Code