BUG: Image viewer can delete a different photo from the one selected

Abierto
#1,793 2 comentarios 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 3 días

@Saurabhyadav0 ya está trabajando en esto.

Desde el 29/11/2026.

  • #1795 de @Saurabhyadav0 — abierto

Evaluación

Este issue todavía no se ha evaluado.

Descripción

bug good first issue
Is there an existing issue for this?
  • I have searched the existing issues
What happened?

Description

The image viewer can delete a different photo from the one selected. The delete dialog does not remember which photo it was opened for, so it deletes whichever photo is current when you confirm.

Steps to reproduce

  1. Add a folder with at least 3 photos.
  2. Open the first photo and click Slideshow.
  3. Click Delete.
  4. Wait until the photo behind the dialog changes.
  5. Click Delete in the dialog.

Second trigger: open the delete dialog without the slideshow, press the → arrow key, then confirm.

Expected behavior

The photo shown when Delete was clicked is removed.

Actual behavior

The photo the viewer has since moved to is removed. In my test the dialog was opened on photo A and photo B was deleted.

If "Delete from Computer" is checked, the same photo ID is sent for deletion from disk, so the wrong file would be permanently deleted. I tested with it unchecked.

Cause

In frontend/src/components/Media/MediaView.tsx, handleConfirmDelete reads currentImage at confirm time. The slideshow and keyboard navigation stay active while the dialog is open.

Suggested fix

  • Store the image ID when the dialog opens and delete that ID.
  • Pause the slideshow and ignore viewer shortcuts while the dialog is open.
  • Add tests for both triggers.

Environment

macOS, dev branch at 751ff6ca. Reproduced in Chrome against the local backend (with a stand-in for the Tauri layer), and in a Jest test.

I would like to work on this if approved.

Screenshots

1. Delete dialog opened on photo A
1-dialog-opened-on-A

2. Slideshow moves to photo B while the dialog is open
2-slideshow-moved-to-B

3. After confirming, photo B is deleted instead of A
3-B-deleted

Record
  • I agree to follow this project's Code of Conduct
Lenguaje dominante
Python
Estrellas
322
Forks
793
Merge medio
6 d 10 h
PR fusionados (30 d)
20

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de AOSSIE-Org/PictoPy

Todos los issues de AOSSIE-Org/PictoPy

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.