tnc-ca-geo / animl-frontend

A frontend web app for viewing & labeling camera trap data by The Nature Conservancy.
https://animl.camera
Other
16 stars 0 forks source link

Bulk image deletion #227

Open nathanielrindlaub opened 1 month ago

nathanielrindlaub commented 1 month ago

Right now, users can delete images via bulk-selecting them and clicking "delete images", but because it's not implemented as an async task, we limit it to a maximum of 500 images at a time to prevent timeouts. It would be great to support the deletion of more images now that we have the async task management service in place. I think this would involve the following:

  1. A button to delete all images that are currently filtered. Perhaps this button should live at the bottom of the filter panel, along side the "get info" and "data export" buttons? Maybe it's time for a hamburger-esque menu button down there to store this and other actions we might want to apply to all images matching the current filters as it's getting a little crowded.
  2. Create a mutation resolver and task handler in animl-api for deleteImagesAsync that can accept filters as an input. We should keep the current deleteImages mutation & workflow to allow for users doing the bulk-selection or individual image approach.
  3. A UI to display the state of the async task and display errors.
nathanielrindlaub commented 1 month ago

I'm actually not sure that we did end up setting a maximum number of images we could delete? I can't find any indication that we did in the the frontend or animl-api code. So a first step would be to stress test how many images deleteImages can handle before timing out.