Skip to content

feat(ui): (optional) Protect starred media from accidental deletion - #9458

Open
FloeHetling wants to merge 1 commit into
invoke-ai:mainfrom
FloeHetling:qol_2026q2/starred-protector
Open

feat(ui): (optional) Protect starred media from accidental deletion#9458
FloeHetling wants to merge 1 commit into
invoke-ai:mainfrom
FloeHetling:qol_2026q2/starred-protector

Conversation

@FloeHetling

Copy link
Copy Markdown
Contributor
  • new settings option: "Protect starred media"
  • when protection is enabled, following features will be active:
  • there will be impossible to delete an image or video with Star mark. If "Confirm on delete" is enabled, a warning toast will appear on said attempt (silent otherwise)
  • upon attempting to use "Delete Board, Images & Videos" option, additional confirmation will be issued if said board has at least one media item with Star mark
  • upon agreeing, marked media will be kept and moved to "Uncategorized", while the board and unmarked media will be deleted
  • upon attempting to delete a group selected of images or videos, media marked with Star will not be touched and a toast about protection status will be thrown if "Confirm on delete" is enabled (silent otherwise)
  • same behavior should be expected from "Delete All Uncategorized Images/Videos" option
  • protection is disabled by default and existing deletion clients keep the old behavior

Summary

  • new settings option: "Protect starred media"
  • the option is disabled by default, so the usual deletion behavior is left unchanged
  • when protection is enabled, following features will be active:
  • there will be impossible to delete an image or video with Star mark. If "Confirm on delete" is enabled, a warning toast will appear on said attempt (silent otherwise)
  • upon attempting to use "Delete Board, Images & Videos" option, additional confirmation will be issued if said board has at least one image or video with Star mark
  • upon agreeing to delete such board, the board and all unmarked media will be deleted. Starred images and videos will be kept and moved to "Uncategorized"
  • upon attempting to delete a group selected of images or videos, media marked with Star will not be touched and a toast about protection status will be thrown if "Confirm on delete" is enabled (silent otherwise)
  • same behavior should be expected from "Delete All Uncategorized Images/Videos" option
  • the protection is enforced by backend image and video services. Existing clients keep the old behavior unless they explicitly request starred media protection
  • failed deletion and media skipped due to protection are reported separately, so frontend selection and cached media are only cleaned for items that were actually deleted

Related Issues / Discussions

This is a complete re-work of #8406, done from scratch relying on latest unified gallery, video deletion and multi-user board changes.

QA Instructions

Careful. This test implies some of the images and videos can or will be eventually lost. For safety of your artwork, consider using testing environment

  • have some images and videos to start test with, 10x media items should be enough
  • enable the "Protect starred media" option in your app Settings
  • mark 2 images, select 3 images, 2 of which are marked and 1 is not. Press the Delete key or use Delete icon in viewer. Expected behavior: one unmarked artwork should be deleted, while both marked images should be left untouched
  • repeat the previous step with videos. Expected behavior: only unmarked videos should be deleted
  • enable "Confirm on delete" and attempt to delete a marked image or video. Expected behavior: the media should stay untouched and a warning toast should appear. Disable "Confirm on delete" and repeat the attempt: the media should still be protected, but without the warning toast
  • create a new board and move one marked image and one marked video there. Add one unmarked image and one unmarked video. Attempt to delete that board using "Delete Board, Images & Videos" option. Expected behavior: additional confirmation should be issued about deleting the board with starred media
  • agree to the additional confirmation. Expected behavior: the board and both unmarked items should be gone. The marked image and video should be left untouched and moved to "Uncategorized"
  • use "Delete All Uncategorized Images/Videos" from "Uncategorized" board context menu. Confirm the deletion. Expected behavior: unmarked media should be deleted, while the marked image and video should be left untouched
  • disable "Protect starred media" and delete the remaining marked items. Expected behavior: the usual deletion behavior should be restored and starred media should be deleted

Merge Plan

No special merge plan should be needed. The feature was completely re-done from scratch on top of latest main instead of reusing the old implementation. Generated OpenAPI schema and frontend API types are included in the PR.

Checklist

  • The PR has a short but descriptive title, suitable for a changelog
  • Tests added / updated (if applicable)
  • !Changes to a redux slice have a corresponding migration
  • Documentation added / updated (if applicable)
  • Updated What's New copy (if doing a release after this PR)

- new settings option: "Protect starred media"
 - when protection is enabled, following features will be active:
 * there will be impossible to delete an image or video with Star mark. If "Confirm on delete" is enabled, a warning toast will appear on said attempt (silent otherwise)
 * upon attempting to use "Delete Board, Images & Videos" option, additional confirmation will be issued if said board has at least one media item with Star mark
 * upon agreeing, marked media will be kept and moved to "Uncategorized", while the board and unmarked media will be deleted
 * upon attempting to delete a group selected of images or videos, media marked with Star will not be touched and a toast about protection status will be thrown if "Confirm on delete" is enabled (silent otherwise)
 * same behavior should be expected from "Delete All Uncategorized Images/Videos" option
 * protection is disabled by default and existing deletion clients keep the old behavior
@github-actions github-actions Bot added api python PRs that change python files services PRs that change app services frontend PRs that change frontend files python-tests PRs that change python tests labels Aug 4, 2026
@FloeHetling
FloeHetling marked this pull request as ready for review August 4, 2026 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api frontend PRs that change frontend files python PRs that change python files python-tests PRs that change python tests services PRs that change app services

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant