Skip to content

feat(spx-gui): support deletion of in-progress gen assets and unify collapse/close interaction #2982

@xgopilot

Description

@xgopilot

Background

This issue is recorded from the discussion in PR #2963 (feat(spx-gui): separate generation entry).

After the gen entry is separated, there are two remaining UX issues to address:

Problem 1: No deletion support for in-progress gen assets

When a user starts generating a sprite/backdrop (via AI generation), the in-progress gen item appears in the sprite list / backdrop list as a collapsed thumbnail. Currently, there is no way to delete/cancel a collapsed gen item from the list view.

The GenState (src/components/editor/gen.ts) already has removeSprite(id) and removeBackdrop(id) methods, but they are not exposed in the UI. The SpriteGenItem and BackdropGenItem collapsed thumbnails show loading animations but have no delete/cancel action.

Expected behavior: Users should be able to right-click (or via a context menu) on a collapsed gen item in the sprite/backdrop list to cancel/delete it.

Problem 2: Inconsistent "collapse" vs "close" interaction

Currently, the SpriteGenModal has two behaviors:

  • Collapse (@collapse event on SpriteGen.vue): Minimizes the modal and creates a collapsed gen item in the sprite list, keeping the generation running in the background. This is handled via genCollapseHandler.
  • Close (clicking the X or mask): Shows a confirmation dialog asking whether to exit (cancel) the generation.

However, BackdropGenModal (BackdropGenModal.vue) does not have a collapse flow — it always shows the exit confirmation dialog and cancels the generation. It is missing the genCollapseHandler prop and the collapse button.

Expected behavior:

  • Unify the collapse/close interaction between SpriteGenModal and BackdropGenModal
  • Backdrop generation should also support collapsing into a background gen item (similar to sprite gen)
  • The "collapse" and "close" semantics should be clearly distinguished in both modals

Files involved

  • spx-gui/src/components/asset/gen/sprite/SpriteGenModal.vue — has collapse + close logic
  • spx-gui/src/components/asset/gen/backdrop/BackdropGenModal.vue — only has close logic (no collapse)
  • spx-gui/src/components/asset/gen/sprite/SpriteGenItem.vue — collapsed sprite gen item (no delete action)
  • spx-gui/src/components/asset/gen/backdrop/BackdropGenItem.vue — collapsed backdrop gen item (no delete action)
  • spx-gui/src/components/editor/gen.tsGenState with removeSprite/removeBackdrop methods (unused in UI)
  • spx-gui/src/components/asset/index.tsuseBackdropGenModal (missing genCollapseHandler)
  • spx-gui/src/components/editor/sprite/SpriteList.vue — renders SpriteGenItem items (no delete handler)
  • spx-gui/src/components/editor/stage/backdrop/BackdropsEditor.vue — renders backdrops (no gen item UI)

Acceptance Criteria

  • In-progress sprite gen items in the sprite list can be deleted/cancelled from the list view
  • In-progress backdrop gen items in the backdrop list can be deleted/cancelled from the list view
  • Backdrop generation modal supports "collapse" action (keep running in background) in addition to "close" (cancel)
  • Collapse and close interaction is consistent between sprite and backdrop gen modals

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