PictoPy icon indicating copy to clipboard operation
PictoPy copied to clipboard

Confirmation before deleating a folder

Open 290Priyansh opened this issue 10 months ago β€’ 13 comments

Currently, deleting a folder happens immediately without any warning or confirmation. This makes it very easy to accidentally delete folders and lose associated data.

Why this is an issue

  • Folder deletion is a destructive action

  • Accidental clicks can permanently remove user data

  • There is no opportunity for the user to cancel or reconsider

Expected Behavior

Before deleting a folder:

  • Show a warning message explaining that the action is irreversible

  • Display a confirmation dialog (e.g., β€œAre you sure you want to delete this folder?”)

  • Proceed with deletion only after explicit user confirmation

290Priyansh avatar Jan 04 '26 18:01 290Priyansh

πŸ‘‹ 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 Jan 04 '26 18:01 github-actions[bot]

hi @290Priyansh and @rahulharpal1603 can i take this issue? i would love to fix this up :)

8sami avatar Jan 04 '26 18:01 8sami

Hi @rahulharpal1603 i want to work on this , please allow me to fix this .

hharshhsaini avatar Jan 05 '26 10:01 hharshhsaini

@rahulharpal1603 Solved the issue , and its perfectly resolved now , check my PR it is ready to merge .

hharshhsaini avatar Jan 05 '26 11:01 hharshhsaini

Hi ,@rahulharpal1603 sir and @290Priyansh may I work on this issue ? I am able to fix this issue .

aurthitaacharya-afk avatar Jan 05 '26 11:01 aurthitaacharya-afk

It's already assigned and I have started to work on it.

290Priyansh avatar Jan 05 '26 11:01 290Priyansh

Hi maintainer πŸ‘‹
I would like to work on this issue.
Please assign it to me.
Thanks!

serusharma avatar Jan 11 '26 06:01 serusharma

Hi,@rahulharpal1603 and @290Priyansh I want to fix this issue, can you please assign it to me?

HardikaPaliwal avatar Jan 29 '26 06:01 HardikaPaliwal

Hi,@rahulharpal1603 and @290Priyansh I want to fix this issue, can you please assign it to me?

JITENDRAGAHERWAR03 avatar Feb 23 '26 14:02 JITENDRAGAHERWAR03

Hi @rahulharpal1603 β€” I'd like to pick up this issue and see it through. It's been open since early January and assigned to @290Priyansh, but there's no PR yet after roughly six months, so I'd be glad to take it over and get it resolved.

I've reviewed the codebase and have a concrete implementation plan. There's a reusable ConfirmDialog component at frontend/src/components/ConfirmDialog/ConfirmDialog.tsx suited to this exact case β€” it accepts title, description, confirmLabel, an onConfirm handler, and a destructive flag (which applies the red AlertTriangle styling). I'll wire the folder-delete action to open this dialog with destructive enabled, so deletion only executes on explicit confirmation, with a clear cancel path. Reusing ConfirmDialog keeps the UI consistent rather than introducing a one-off modal (the older DeleteImageDialog is a bespoke Yes/No dialog, so I'll follow the newer shared pattern).

@290Priyansh β€” if you're still working on this, feel free to continue; otherwise I'm happy to take it forward. Could you assign it to me?

prawnsgupta avatar Jul 22 '26 10:07 prawnsgupta

@prawnsgupta Yes, feel free to take this issue over

290Priyansh avatar Jul 24 '26 06:07 290Priyansh

Thanks @290Priyansh for handing this over β€” I've opened #1426.

Before writing anything I went back through the review you left on #955, @rahulharpal1603, since the straightforward "dialog on every delete" is exactly what you pushed back on there. So this PR follows your suggestion instead:

  • Folders can be multi-selected and deleted through a single confirmation, so clearing out a parent folder that expanded into a dozen nested ones is one dialog rather than a dozen. /folders/delete-folders already took a list of ids, so the whole selection goes in one request and no backend change was needed.
  • On the second point β€” that a confirmation on top of the existing post-delete dialog would feel repetitive β€” that checks out: useMutationFeedback defaults showSuccess: true, so deleting currently pops a "Folder Deleted" modal. Since the user now confirms up front and watches the rows disappear, I've turned that success modal off for deletion. Errors still surface. It's a one-line revert if you'd rather keep it.

Two smaller things while I was in there: the confirmation says the photos themselves stay on disk (deletion only clears the library entry and its cascaded rows), because "cannot be undone" on its own reads like the files are going too. And the icon-only trash button had no accessible name, so it now has an aria-label.

https://github.com/user-attachments/assets/0a29cc22-c37c-4dd9-90f9-4ad156ece03a

There's no checkbox primitive in components/ui and @radix-ui/react-checkbox isn't installed, so I used native checkboxes styled with the existing tokens rather than pull in a new dependency β€” happy to swap that for the Radix primitive if you'd prefer.

Covered by 15 tests across both the single and bulk flows; full frontend suite passes at 215.

prawnsgupta avatar Jul 27 '26 10:07 prawnsgupta

Hi @rohan-pandeyy I saw that there hasn't been any activity on this issue since july so can you assign this issue to me if available?

yashchaurasia667 avatar Oct 26 '26 10:10 yashchaurasia667