mirror-immich/mobile/lib/presentation/pages
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
..
dev feat(mobile): html text (#25739) 2026-02-19 12:27:16 -06:00
editing feat(mobile): Allow users to set profile picture from asset viewer (#25517) 2026-02-22 06:02:33 +00:00
profile feat(mobile): Allow users to set profile picture from asset viewer (#25517) 2026-02-22 06:02:33 +00:00
search fix(mobile): handle userPreferencesProvider error state during sync (#26332) 2026-02-20 08:57:28 -06:00
cleanup_preview.page.dart feat: free up space (#24999) 2026-01-07 20:55:28 -06:00
download_info.page.dart fix: download feedback (#22178) 2025-09-19 00:47:01 -05:00
drift_activities.page.dart feat(mobile): inline asset details (#25952) 2026-02-17 09:24:34 -06:00
drift_album.page.dart fix(mobile): inherit toolbar opacity (#25694) 2026-02-16 09:54:57 +05:30
drift_album_options.page.dart fix(mobile): inherit toolbar opacity (#25694) 2026-02-16 09:54:57 +05:30
drift_archive.page.dart chore: bump dart sdk to 3.8 (#20355) 2025-07-28 14:04:03 -05:00
drift_asset_selection_timeline.page.dart chore: bump dart sdk to 3.8 (#20355) 2025-07-28 14:04:03 -05:00
drift_asset_troubleshoot.page.dart fix: mobile edit handling (#25315) 2026-01-19 12:22:53 -06:00
drift_create_album.page.dart fix(mobile): cannot create album while name field is focused (#24449) 2025-12-08 09:33:01 -06:00
drift_favorite.page.dart chore: bump dart sdk to 3.8 (#20355) 2025-07-28 14:04:03 -05:00
drift_library.page.dart refactor(mobile): consolidate image requests (#25743) 2026-02-05 12:16:42 -05:00
drift_local_album.page.dart chore(mobile): translate missing strings (#22057) 2025-09-16 08:51:03 -05:00
drift_locked_folder.page.dart chore: bump dart sdk to 3.8 (#20355) 2025-07-28 14:04:03 -05:00
drift_map.page.dart fix(mobile): bring back map settings (#25448) 2026-01-22 21:51:48 +00:00
drift_memory.page.dart feat(mobile): inline asset details (#25952) 2026-02-17 09:24:34 -06:00
drift_partner_detail.page.dart chore(mobile): add `debugPrint` lint rule (#21872) 2025-09-12 18:56:00 -04:00
drift_people_collection.page.dart refactor(mobile): consolidate image requests (#25743) 2026-02-05 12:16:42 -05:00
drift_person.page.dart fix(mobile): person birthday viewing/editing (#20731) 2025-08-06 22:13:56 +00:00
drift_place.page.dart fix: mobile edit handling (#25315) 2026-01-19 12:22:53 -06:00
drift_place_detail.page.dart chore: bump dart sdk to 3.8 (#20355) 2025-07-28 14:04:03 -05:00
drift_recently_taken.page.dart chore: bump dart sdk to 3.8 (#20355) 2025-07-28 14:04:03 -05:00
drift_remote_album.page.dart feat(mobile): album options to kebab menu (#24204) 2025-12-26 18:46:05 +00:00
drift_trash.page.dart chore: remove unused key and fix casing for recent_albums (#24691) 2026-02-12 16:06:22 +01:00
drift_user_selection.page.dart feat: sync AuthUserV1 (#21565) 2025-09-08 14:00:10 -05:00
drift_video.page.dart chore: bump dart sdk to 3.8 (#20355) 2025-07-28 14:04:03 -05:00
local_timeline.page.dart fix: storage indicator (#22077) 2025-09-16 12:46:48 -05:00