-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
fix(mobile): use correct delete action #25111
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?
fix(mobile): use correct delete action #25111
Conversation
When viewing a trashed asset, the viewer now shows the permanent delete button instead of "Move to bin" which made no sense for already-trashed items. Changes: - Added `isTrashed` field to RemoteAsset domain model - Map `deletedAt` from entity to `isTrashed` in domain model - Check asset.isTrashed in viewer bottom bar - Added `useShortLabel` param to DeletePermanentActionButton for compact display
|
For future reference, it's basically never necessary to close a PR because the git history is bad; you can just (force) push the history you do want to the same branch. |
Sorry about that, overeager |
|
@ByteSizedMarius Static analysis is still failing. Can you look into it? |
Also mb, will be more thorough in the future. |
|
The changes look good, but I'd rather merge this after #25113 is in. I'll add a TextWidget that takes care of rendering the HTML tags inside the translation texts soon so you can rebase that branch on top of it and use the existing key. I'll ping you once that is up. Thanks for working on this |
Description
When viewing a trashed asset in the image viewer (library > trash > image viewer), the delete button incorrectly showed the same delete dialog used for the move to trash action (
DeleteActionButton; "...This action will move the asset to the server's trash). This was confusing since the asset is already in the trash. Also, pressing this button and confirming the dialog wouldn't actually delete the image from trash.Changes:
isTrashedfield toRemoteAssetdomain model (mapped fromdeletedAtin entity) to be able to access this parameter from image viewerasset.isTrashedand usesDeletePermanentActionButtonfor trashed assetsuseShortLabelparameter toDeletePermanentActionButtonto display "Delete" text in viewer instead of "Delete permanently", as it would break into two lines, which looked strangeI believe this fixes #21949, #20587
Note:
DeletePermanentActionButtonandDeleteActionButtoncurrently do not currently have confirmation dialogs, which I find to be dangerous. This means, that pressing delete now will immediately delete the image from trash. Maybe this was conscious decision, but I will make a suggestion in a second PR.Sorry about #25110 😅
How 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 was used to assist with implementing this pull request (understanding why
isTrashedfromcurrentAssetwasn't working and addingisTrashedto domain model).