fix(editor): guard the second Esc path against the busy overlay too

There are two Escape handlers: a capture-phase one for the editor and the global one-surface-per-keystroke chain. Only the first was guarded, so export - which reaches the editor through the global chain - still popped the discard-confirm under the overlay.
This commit is contained in:
r-zakarya
2026-08-01 17:35:04 +01:00
parent 5d10935ae2
commit 6bb64832ef
2 changed files with 7 additions and 0 deletions
+6
View File
@@ -8139,6 +8139,12 @@ async function init() {
e.preventDefault();
openCheatsheet();
} else if (e.key === 'Escape') {
// A blocking operation owns the screen (export, sync, rotation):
// the busy overlay is above every surface listed below, so nothing
// here is actually reachable — and the editor's discard-confirm
// would open invisible underneath it. Second Esc path; the
// capture-phase one for the editor carries the same guard.
if (isBusy()) return;
// Close in priority order: confirm first (most modal-y), then the
// palette — it OPENS OVER the info modals (Ctrl+K on top of the
// cheatsheet), so it must close before them. ONE surface per