InvokeAI icon indicating copy to clipboard operation
InvokeAI copied to clipboard

Undo for delete in image gallery

Open mcbexx opened this issue 2 years ago • 6 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Contact Details

No response

What should this feature add?

Since it is currently not possible to get an deleted image (and its metadata) back into the gallery database by simply retrieving the deleted image(s) from the system recycle bin, an undo function for delete operations (single and multiple images) inside of the image gallery would be a nice feature.

Alternatives

No response

Additional Content

No response

mcbexx avatar Sep 15 '23 00:09 mcbexx

This is probably a good first contribution for the backend. Maybe a bit a more complicated for the frontend, but still pretty approachable.

Backend

The images table in the db already has a deleted_at column, which was added with a view towards a future soft delete feature. We don't use it just yet.

The solution would be to update the db queries to use the deleted_at column instead of actually deleting records. All image queries would need an additional constraint checking if deleted_at is null.

We'd also need HTTP routes to un-delete an image (set its deleted_at to null).

Frontend

On the frontend, we'd need another area to the gallery that displays all deleted images, multi-select functionality and UI to un-delete them.

It's probably best to not worry about categorizing the deleted images - just paginate them. This could use a much simpler pagination and caching strategy than the rest of the gallery, which is a bit involved.

I'm happy to chat if anybody wants to raise their hand for this.

psychedelicious avatar Sep 17 '23 13:09 psychedelicious

please assign me to this issue

kurayami07734 avatar Oct 02 '23 16:10 kurayami07734

please assign me to this issue

Can do! Are you in the Discord as well?

Millu avatar Oct 02 '23 20:10 Millu

Joined it now

kurayami07734 avatar Oct 03 '23 17:10 kurayami07734

What happend with this? Is it abandoned or already implemented?

Developer-42 avatar May 23 '24 14:05 Developer-42

@Developer-42 The person who asked to be assigned hasn't worked on it.

psychedelicious avatar May 23 '24 20:05 psychedelicious