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 "mounted" checks look for a .gallery-editor descendant that never exists #7426
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, Edit tab, click any template (for example Square HD).
In devtools: document.querySelector('#gallery-editor-container .gallery-editor')
Close the edit with the x on the Edit tab, confirm, click the Edit tab again so the landing shows.
In devtools: document.getElementById('gallery-editor-container').className
Expected Behaviour
Step 2 finds the mounted editor, since five guards use that selector to decide whether the editor is open: the setup-cancel handler (gallery.js:40), Gallery's Escape handler (gallery.js:3172), _doCloseGallery (gallery.js:3302), _galleryEditMounted() (galleryEditor.js:392) and the global Escape guard in ui.js:1541.
Actual Behaviour
Step 2 returns null. _buildEditor() (galleryEditor.js:9941) sets container.className = 'gallery-editor' on #gallery-editor-container itself, so there is never a .gallery-editor descendant and all five checks are always false.
Today nothing visible breaks, because isEditorOpen() or window.__galleryEditLive sits next to four of them. The ui.js guard has no such fallback: galleryEditing is always false there.
Step 4 shows a second trap for the obvious fix: closeEditor() leaves the gallery-editor class on the container, so the landing shown after a close still has it. Matching #gallery-editor-container.gallery-editor would treat that landing as an open editor, and _doCloseGallery would then refuse to close the Gallery from it ("Close the edit tab first").
The New canvas instance of the same selector (gallery.js:1334) is #7155, fixed by #7156; this issue covers the other five.
Logs / Screenshots
none needed, the devtools output above is the whole repro.
Are you willing to submit a fix? Yes, I can open a PR
Activity