You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Gallery editor: a draft or image that fails to load leaves an empty editor open ("Close the edit tab first") #7427
I searched open issues and discussions and did not find an existing report of this bug.
This is not a security vulnerability.
I am running the latest code from the dev branch and the bug still reproduces there.
Odysseus Revision
1a7fbc4f (2026-11-28)
Install Method
Manual Python install (pip / venv)
Operating System
Linux
Steps to Reproduce
Start the app, open Gallery, click the Edit tab so the landing shows.
In devtools: (await import('/static/js/galleryEditor.js?v=20260909movepicklayer1')).openEditor(null, null, null, 'x', 'no-such-draft-id')
Same with an image URL that 404s: openEditor('/static/no-such-image.png', 'no-such-image', null, 'x')
Same through the UI: a saved project whose data can't be restored (for example imgWidth: 0), then click its card under Saved projects.
Expected Behaviour
One toast with the real error ("Draft not found", "Failed to load image", "Failed to load draft: ..."), the editor closes and the Edit tab landing comes back.
Actual Behaviour
The error toast is immediately replaced by "Close the edit tab first", and the Edit tab is left with an empty editor: a blank canvas, the draft status reading "Saved", and no landing. Clicking the broken project's card shows only "Close the edit tab first"; the real error is never readable.
openEditor() mounts the editor before it fetches the draft or the image. The three failure paths then call closeEditor() without force (static/js/galleryEditor.js:13944, :13970, :14101). state.editorOpen is already true, so closeEditor() takes it as a user trying to close an open edit and refuses (:14136).
The cancelled New canvas path already does this right: closeEditor({ force: true }) plus gallery-editor-setup-cancelled, which makes gallery.js render the landing again.
Logs / Screenshots
A screenshot of step 4 on dev is in the linked PR.
Are you willing to submit a fix? Yes, I can open a PR
Activity