-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
feat(mobile): add confirmation dialogs to delete action buttons #25113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat(mobile): add confirmation dialogs to delete action buttons #25113
Conversation
Adds confirmation dialogs to DeleteActionButton and DeletePermanentActionButton in grid view to prevent accidental deletion. Addresses immich-app#19775. - Change DeleteActionButton default showConfirmation to true - Add showConfirmation parameter to DeletePermanentActionButton - Add i18n key for permanent delete confirmation message
|
Label error. Requires exactly 1 of: changelog:.*. Found: 📱mobile. A maintainer will add the required label. |
mobile/lib/presentation/widgets/action_buttons/delete_action_button.widget.dart
Show resolved
Hide resolved
mobile/lib/presentation/widgets/action_buttons/delete_permanent_action_button.widget.dart
Show resolved
Hide resolved
| "delete_local_dialog_ok_force": "Delete Anyway", | ||
| "delete_others": "Delete others", | ||
| "delete_permanently": "Delete permanently", | ||
| "delete_permanently_action_confirmation_message": "Are you sure you want to permanently delete this asset? This action cannot be undone.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not permanently_delete_assets_prompt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
permanently_delete_assets_prompt contains <b> for multiple assets, which is not rendered in flutter dialogs. How should this be handled? Has this usecase happened before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pass the total number of assets as the count and the translation will be resolved accordingly to the singular or multiple variant
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I didnt put <b> in inline code. What I was trying to communicate is, that the strings contain html that I do not see the mobile app currently being able to resolve or render. I understood how the singular/plural string resolving works.
|
this PR depends on #25111 for delete actions to be correct. Without 25111, |
|
@ByteSizedMarius You can rebase this branch on top of #25739 which adds the |
Description
Adds confirmation dialogs to
DeleteActionButtonandDeletePermanentActionButtonto prevent accidental deletion. Addresses #19775.When deleting photos/videos from grid view (multiselect), there's no confirmation dialog. This is particularly dangerous for locked folder content where deletion is permanent and irreversible. This is an opinionated change and open to discussion, but in my opinion, deletions (especially permanent, but also when sent to trash) should always have a confirmation.
I also changed the confirmation text in english, as I found it confusing/difficult to understand.
Ref #25111
Changes
DeleteActionButton: ChangeshowConfirmationdefault fromfalsetotrue(note: maybe these params could be removed, but I kept/added them for consistency)DeletePermanentActionButton: AddshowConfirmationparameter (defaulttrue) with confirmation dialogshowConfirmation: trueinbottom_bar.widget.dartdelete_permanently_action_confirmation_messageHow Has This Been Tested?
Checklist:
src/services/uses repositories implementations for database calls, filesystem operations, etc.src/repositories/is pretty basic/simple and does not have any immich specific logic (that belongs insrc/services/)Please describe to which degree, if any, an LLM was used in creating this pull request.
Claude Code was used to assist with implementation.