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

オープン
#1,793 コメント 2 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 3 日以内に返信

@Saurabhyadav0 がすでに取り組んでいます。

2026年11月29日 から。

  • #1795 @Saurabhyadav0 による — オープン

評価

この issue はまだ評価されていません。

説明

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
主要言語
Python
スター
322
フォーク
793
平均マージ
6日 10時間
マージ済み PR(30日)
20

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

AOSSIE-Org/PictoPy のほかの issue

AOSSIE-Org/PictoPy の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。