Summary
While an in-app modal dialog is showing (e.g. the unsaved-changes dialog), right-clicking anywhere still opens the document context menu (Select All / Open File Location / Edit / Close File) on top of the modal's overlay — and its items are clickable.
Reproduction
- Make a tab dirty and close it (or close the window) so the unsaved-changes modal appears.
- Right-click anywhere in the window.
- The document context menu opens over the dimmed overlay; "Close File" / "Edit" can be invoked mid-dialog.
Mechanism
The modal overlay blocks left-clicks on the UI underneath, but the document context menu is bound at the document level via the contextmenu event, which the overlay does not intercept. So the overlay stops direct interaction with tabs/buttons, yet the document menu remains a reachable side door into actions (Edit, Close File) that can race the modal's own flow — e.g. "Close File" can start a second close path while the dialog's walk is mid-flight.
Suggested fix
Gate the document contextmenu handler on "no modal open" (the modal's visibility state already exists), or have the overlay capture and stop contextmenu like it does clicks.
(Noticed while QA-ing #214, but the substrate — modal overlay + document-level context menu — is upstream behavior reproducible in a single window.)
🤖 Generated with Claude Code
Summary
While an in-app modal dialog is showing (e.g. the unsaved-changes dialog), right-clicking anywhere still opens the document context menu (Select All / Open File Location / Edit / Close File) on top of the modal's overlay — and its items are clickable.
Reproduction
Mechanism
The modal overlay blocks left-clicks on the UI underneath, but the document context menu is bound at the document level via the
contextmenuevent, which the overlay does not intercept. So the overlay stops direct interaction with tabs/buttons, yet the document menu remains a reachable side door into actions (Edit, Close File) that can race the modal's own flow — e.g. "Close File" can start a second close path while the dialog's walk is mid-flight.Suggested fix
Gate the document
contextmenuhandler on "no modal open" (the modal's visibility state already exists), or have the overlay capture and stopcontextmenulike it does clicks.(Noticed while QA-ing #214, but the substrate — modal overlay + document-level context menu — is upstream behavior reproducible in a single window.)
🤖 Generated with Claude Code