Skip to content

Gallery editor "mounted" checks look for a .gallery-editor descendant that never exists #7426

Done

Description

@o3LL

Prerequisites

  • 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

  1. Start the app, open Gallery, Edit tab, click any template (for example Square HD).
  2. In devtools: document.querySelector('#gallery-editor-container .gallery-editor')
  3. Close the edit with the x on the Edit tab, confirm, click the Edit tab again so the landing shows.
  4. 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

  1. added
    ready for review
    on Nov 29, 2026
  2. removed
    ready for review
    on Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions