immich/mobile/lib/presentation/widgets/action_buttons
Timon f0cf3311d5
feat(mobile): Allow users to set profile picture from asset viewer (#25517)
* init

* fix

* styling

* temporary workaround for 500 error

**Root cause:**
The autogenerated Dart OpenAPI client (`UsersApi.createProfileImage()`) had two issues:
1. It set `Content-Type: multipart/form-data` without a boundary, which overrode the correct header that Dart's `MultipartRequest` would set (`multipart/form-data; boundary=...`).
2. It added the file to both `mp.fields` and `mp.files`, creating a duplicate text field.

**Result:**
Multer on the server failed to parse the multipart body, so `@UploadedFile()` was `undefined` → accessing `file.path` in `UserService.createProfileImage()` threw → **500 Internal Server Error**.

**Workaround:**
Bypass the autogenerated method in `UserApiRepository.createProfileImage()` and send the multipart request directly using the same `ApiClient` (basePath + auth), ensuring:
- No manual `Content-Type` header (let `MultipartRequest` set it with boundary)
- File only in `mp.files`, not `mp.fields`
- Proper filename fallback

* Revert "temporary workaround for 500 error"

This reverts commit 8436cd402632ca7be9272a1c72fdaf0763dcefb6.

* generate route for ProfilePictureCropPage

* add route import

* simplify

* try this

* Revert "try this"

This reverts commit fcf37d2801055c49010ddb4fd271feb900ee645a.

* try patching

* Reapply "temporary workaround for 500 error"

This reverts commit faeed810c21e4c9f0839dfff1f34aa6183469e56.

* Revert "Reapply "temporary workaround for 500 error""

This reverts commit a14a0b76d14975af98ef91748576a79cef959635.

* fix upload

* Refactor image conversion logic by introducing a new utility function. Replace inline image-to-Uint8List conversion with the new utility in EditImagePage, DriftEditImagePage, and ProfilePictureCropPage.

* use toast over snack

* format

* Revert "try patching"

This reverts commit 68a616522a1eee88c4a9755a314c0017e6450c0f.

* Enhance toast notification in ProfilePictureCropPage to include success type for better user feedback.

* Revert "simplify"

This reverts commit 8e85057a40.

* format

* add tests

* refactor to use statefulwidget

* format

---------

Co-authored-by: Alex <alex.tran1502@gmail.com>
2026-02-22 06:02:33 +00:00
..
add_action_button.widget.dart feat(mobile): inline asset details (#25952) 2026-02-17 09:24:34 -06:00
advanced_info_action_button.widget.dart feat(mobile): move buttons in the bottom sheet to the kebabu menu (#24175) 2025-12-15 16:44:27 -06:00
archive_action_button.widget.dart feat(mobile): move buttons in the bottom sheet to the kebabu menu (#24175) 2025-12-15 16:44:27 -06:00
base_action_button.widget.dart feat(mobile): album options to kebab menu (#24204) 2025-12-26 18:46:05 +00:00
cast_action_button.widget.dart feat(mobile): move top bar buttons into kebabu menu in AssetViewer (#24461) 2025-12-09 18:26:28 +00:00
delete_action_button.widget.dart feat(mobile): move buttons in the bottom sheet to the kebabu menu (#24175) 2025-12-15 16:44:27 -06:00
delete_local_action_button.widget.dart feat(mobile): move buttons in the bottom sheet to the kebabu menu (#24175) 2025-12-15 16:44:27 -06:00
delete_permanent_action_button.widget.dart feat(mobile): move buttons in the bottom sheet to the kebabu menu (#24175) 2025-12-15 16:44:27 -06:00
delete_trash_action_button.widget.dart chore: bump dart sdk to 3.8 (#20355) 2025-07-28 14:04:03 -05:00
download_action_button.widget.dart chore(mobile): add kebabu menu in asset viewer (#24387) 2025-12-05 19:51:59 +00:00
download_status_floating_button.widget.dart fix: download feedback (#22178) 2025-09-19 00:47:01 -05:00
edit_date_time_action_button.widget.dart feat: drift edit time and date action (#20377) 2025-07-30 14:40:13 -05:00
edit_image_action_button.widget.dart feat(mobile): inline asset details (#25952) 2026-02-17 09:24:34 -06:00
edit_location_action_button.widget.dart chore: bump dart sdk to 3.8 (#20355) 2025-07-28 14:04:03 -05:00
favorite_action_button.widget.dart chore(mobile): add kebabu menu in asset viewer (#24387) 2025-12-05 19:51:59 +00:00
like_activity_action_button.widget.dart feat(mobile): inline asset details (#25952) 2026-02-17 09:24:34 -06:00
motion_photo_action_button.widget.dart feat(mobile): move top bar buttons into kebabu menu in AssetViewer (#24461) 2025-12-09 18:26:28 +00:00
move_to_lock_folder_action_button.widget.dart feat(mobile): move buttons in the bottom sheet to the kebabu menu (#24175) 2025-12-15 16:44:27 -06:00
remove_from_album_action_button.widget.dart feat(mobile): move buttons in the bottom sheet to the kebabu menu (#24175) 2025-12-15 16:44:27 -06:00
remove_from_lock_folder_action_button.widget.dart feat(mobile): move buttons in the bottom sheet to the kebabu menu (#24175) 2025-12-15 16:44:27 -06:00
restore_trash_action_button.widget.dart chore: bump dart sdk to 3.8 (#20355) 2025-07-28 14:04:03 -05:00
set_album_cover.widget.dart feat(mobile): Allow users to set album cover from mobile app (#25515) 2026-02-22 05:53:39 +00:00
set_profile_picture_action_button.widget.dart feat(mobile): Allow users to set profile picture from asset viewer (#25517) 2026-02-22 06:02:33 +00:00
share_action_button.widget.dart fix(mobile): cancel share download when dialog is dismissed (#25466) 2026-02-05 19:08:35 +00:00
share_link_action_button.widget.dart feat(mobile): move buttons in the bottom sheet to the kebabu menu (#24175) 2025-12-15 16:44:27 -06:00
similar_photos_action_button.widget.dart feat(mobile): star rating (#24457) 2026-01-23 21:17:46 +05:30
stack_action_button.widget.dart chore: bump dart sdk to 3.8 (#20355) 2025-07-28 14:04:03 -05:00
trash_action_button.widget.dart feat(mobile): move buttons in the bottom sheet to the kebabu menu (#24175) 2025-12-15 16:44:27 -06:00
unarchive_action_button.widget.dart feat(mobile): move buttons in the bottom sheet to the kebabu menu (#24175) 2025-12-15 16:44:27 -06:00
unfavorite_action_button.widget.dart chore(mobile): add kebabu menu in asset viewer (#24387) 2025-12-05 19:51:59 +00:00
unstack_action_button.widget.dart feat(mobile): move buttons in the bottom sheet to the kebabu menu (#24175) 2025-12-15 16:44:27 -06:00
upload_action_button.widget.dart chore: dart http foreground upload (#24883) 2026-01-15 20:10:08 -06:00