PictoPy icon indicating copy to clipboard operation
PictoPy copied to clipboard

BUG: PROD: v1.3.0-beta Failed image deletion dialog displays full Windows path instead of filename

Open Prakhar1808 opened this issue 1 month ago • 6 comments

Is there an existing issue for this?

  • [x] I have searched the existing issues

What happened?

Description

when images fail to be deleted from the host device, the dialog message extracts filenames using: In frontend/src/hooks/useDeleteImages.ts

${failedPaths.map((path) => path.split('/').pop()).join(', ')}

Because it only splits on the forward slash (/), on Windows systems where paths use backslashes (), split('/') does not find any separator. Consequently, .pop() returns the entire absolute Windows path rather than the file basename.

Screenshots

Image Image

Steps to reproduce

  1. Run PictoPy v1.3.0-beta on Windows.
  2. Attempt to delete an image with "Delete from device" checked on a file that cannot be deleted (e.g. read-only file or permission denied).
  3. Observe the "Some Files Could Not Be Deleted" error dialog.
  4. The dialog displays the raw absolute path (C:\Users\...\image.jpg) instead of just image.jpg.

proposed fix (diff)

- message: `The following file(s) could not be deleted from your device: ${failedPaths.map((path) => path.split('/').pop()).join(', ')}`,
+ message: `The following file(s) could not be deleted from your device: ${failedPaths.map((path) => path.split(/[/\\]/).pop()).join(', ')}`,

Record

  • [x] I agree to follow this project's Code of Conduct

Prakhar1808 avatar Oct 25 '26 10:10 Prakhar1808

👋 Thanks for opening this issue! The maintainers will review it shortly. Till then, do not open any PR. This is a strict rule we like to follow around here :)

github-actions[bot] avatar Oct 25 '26 10:10 github-actions[bot]

i would like to work on this do lmk

Prakhar1808 avatar Oct 25 '26 10:10 Prakhar1808

⚠️ Potential Duplicate Issue (Semantic Match)

This issue appears semantically similar to the following issues in AOSSIE-Org/PictoPy:

  1. BUG: Windows path separator breaks image filename search in AddImagesToAlbumDialog (#1528, open) https://github.com/AOSSIE-Org/PictoPy/issues/1528 Similarity: 65.2%

  2. BUG: Folder setup step shows the full Windows path as the folder name, not just the basename (#1588, open) https://github.com/AOSSIE-Org/PictoPy/issues/1588 Similarity: 60.6%

Please review before proceeding.

github-actions[bot] avatar Oct 25 '26 10:10 github-actions[bot]

@Prakhar1808 Can i get this assigned to me? I want to work on this

RitikaSen27 avatar Oct 26 '26 08:10 RitikaSen27

@Prakhar1808 Can i get this assigned to me? I want to work on this

hey @RitikaSen27, I am already have a working fix on this, though i would encourage you to find bugs in the latest beta

Prakhar1808 avatar Oct 26 '26 14:10 Prakhar1808

@Prakhar1808 oh okay Thanks for letting me know.

RitikaSen27 avatar Oct 26 '26 18:10 RitikaSen27