Skip to content

Gallery editor: a draft or image that fails to load leaves an empty editor open ("Close the edit tab first") #7427

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, click the Edit tab so the landing shows.
  2. In devtools: (await import('/static/js/galleryEditor.js?v=20260909movepicklayer1')).openEditor(null, null, null, 'x', 'no-such-draft-id')
  3. Same with an image URL that 404s: openEditor('/static/no-such-image.png', 'no-such-image', null, 'x')
  4. 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

  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