Confirmation before deleating a folder
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
π 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 :)
hi @290Priyansh and @rahulharpal1603 can i take this issue? i would love to fix this up :)
Hi @rahulharpal1603 i want to work on this , please allow me to fix this .
@rahulharpal1603 Solved the issue , and its perfectly resolved now , check my PR it is ready to merge .
Hi ,@rahulharpal1603 sir and @290Priyansh may I work on this issue ? I am able to fix this issue .
It's already assigned and I have started to work on it.
Hi maintainer π
I would like to work on this issue.
Please assign it to me.
Thanks!
Hi,@rahulharpal1603 and @290Priyansh I want to fix this issue, can you please assign it to me?
Hi,@rahulharpal1603 and @290Priyansh I want to fix this issue, can you please assign it to me?
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 Yes, feel free to take this issue over
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-foldersalready 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:
useMutationFeedbackdefaultsshowSuccess: 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.
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?