PictoPy icon indicating copy to clipboard operation
PictoPy copied to clipboard

add confirmation dialog before deleting folders

Open 290Priyansh opened this issue 10 months ago • 6 comments

Fixes: #939 Adds a warning and confirmation dialog before folder deletion to prevent accidental data loss. Does not affect files on disk.

Before

https://github.com/user-attachments/assets/fd9d883d-363b-4f85-b36d-6ccc29cf9c44

After

https://github.com/user-attachments/assets/b9daae16-a7cf-4068-a68d-474354ef6605

Summary by CodeRabbit

  • New Features
    • Introduced a confirmation dialog for folder deletion in library management. The dialog displays the affected folder path and provides a clear explanation of what happens when you delete a folder and its associated content. Users must explicitly confirm their action before folders are permanently removed from the library.

✏️ Tip: You can customize this high-level summary in your review settings.

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

📝 Walkthrough

Walkthrough

Adds a confirmation dialog component for folder deletion and integrates it into the folder management UI. Users now see a warning dialog before deletion is executed, replacing immediate deletion with a two-step confirmation flow.

Changes

Cohort / File(s) Summary
New Confirmation Dialog
frontend/src/components/Dialog/DeleteFolderDialog.tsx
New React functional component implementing a styled modal dialog with folder path display, warning message, and action buttons (Cancel, Delete from Library). Handles open/close state and confirm callback.
Folder Management Integration
frontend/src/pages/SettingsPage/components/FolderManagementCard.tsx
Introduces deletion confirmation flow with local state (deleteDialogOpen, folderToDelete) and handlers (handleDeleteClick, handleConfirmDelete). Integrates DeleteFolderDialog component, changing delete button action from immediate deletion to dialog trigger. Minor fix to percent display default value.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • #516: Related PR that handles deleteFolder via useFolderOperations hook; this PR builds on that by adding confirmation staging in FolderManagementCard before deletion is executed.

Suggested labels

frontend, enhancement

Poem

🐰 A dialog appears with a warning so clear,
"Delete this folder?" now holds no fear.
Confirmation clicked twice, intentions confirmed,
Safe deletion achieved—no data burned! 🗑️✨

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding a confirmation dialog before folder deletion.
Linked Issues check ✅ Passed All objectives from issue #939 are met: warning message, explicit confirmation dialog, and deletion only after user confirmation are all implemented.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing the confirmation dialog feature requested in issue #939; no unrelated modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • [ ] 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot] avatar Jan 05 '26 14:01 coderabbitai[bot]

Hi, @290Priyansh, I am interested in contributing to this issue, can you please assign it me

HardikaPaliwal avatar Jan 29 '26 06:01 HardikaPaliwal

@rahulharpal1603 Hi, is this issue still open?

I’d like to work on it if it’s still available. Please let me know if I can proceed.

devnucleus950 avatar Apr 12 '26 20:04 devnucleus950

Hi @290Priyansh, thank you for bringing this up earlier, and sorry for the late response.

I agree with adding a confirmation step here since folder deletion is a destructive action and it’s easy to misclick.

One concern though is around the current behavior of PictoPy where selecting a parent folder lists all its nested folders as well. Say for example I mistakenly add a huge directory with 100s of sub-directories, in that case, a users might often want to delete multiple folders. If we show a confirmation dialog for every single deletion, it could introduce a lot of friction and slow down bulk cleanup workflows.

Also, since PictoPy already shows a dialog after a folder is deleted, this change would effectively introduce an additional prompt in the flow, which may feel a bit repetitive from a user experience standpoint.

One possible direction worth exploring could be enabling bulk deletion (for example, via a multi-select option in the Folder Management component), followed by a single confirmation dialog for the entire action. This would help maintain safety while keeping the experience efficient for larger cleanups.

rohan-pandeyy avatar May 02 '26 20:05 rohan-pandeyy

⚠️ This PR has merge conflicts.

Please resolve the merge conflicts before review.

Your PR will only be reviewed by a maintainer after all conflicts have been resolved.

📺 Watch this video to understand why conflicts occur and how to resolve them: https://www.youtube.com/watch?v=Sqsz1-o7nXk

github-actions[bot] avatar May 13 '26 07:05 github-actions[bot]

⚠️ This PR still has unresolved merge conflicts and has been inactive for the past 30 days.

The PR has merge conflicts label is still applied, and there has been no recent activity on this PR.

Please resolve the merge conflicts or leave a comment if you are still actively working on it.

If there is no further activity within the next 5 days, this PR may be automatically closed to help keep the PR backlog manageable.

github-actions[bot] avatar Jun 13 '26 06:06 github-actions[bot]

🔒 Closing this PR due to unresolved merge conflicts and prolonged inactivity.

This PR still had unresolved merge conflicts, and there was no activity within 5 days of the stale warning being posted.

You may reopen this PR or submit a new one after resolving the merge conflicts.

github-actions[bot] avatar Jun 18 '26 07:06 github-actions[bot]