Skip to content

Conversation

@happychriss
Copy link

Description

Feature Request: #23266

Added an "add" button at the bottom of the photo-viewer, with a toast menu: "Album", "Archive", "Locked Folder"
This changes enables a user to add photos directly to an album while browsing through them in the photo viewer.
Selecting Add->Album will open the AlbumSelector widget.

Fixes # (issue)
none

How Has This Been Tested?

Manual testing following scenarios:

General scenarios:

  • user is owning the photo
  • user is not owning the photo
  • photo is uploaded
  • photo is not uploaded

Each above scenario:

  • Add photo to Album
  • Add photo to Archive
  • Add photo to locked folder (with non existing locked folder)
  • Add photo to locked folder (with existing locked folder)

Screenshots (if appropriate)

feature_mobile_add

Checklist:

  • [ x] I have performed a self-review of my own code
  • I have made corresponding changes to the documentation if applicable
  • [ x] I have no unrelated changes in the PR.
  • [ x] I have confirmed that any new dependencies are strictly necessary.
  • I have written tests for new code (if applicable)
  • [ x] I have followed naming conventions/patterns in the surrounding code
  • [ x] All code in src/services/ uses repositories implementations for database calls, filesystem operations, etc.
  • [ ]x All code in src/repositories/ is pretty basic/simple and does not have any immich specific logic (that belongs in src/services/)

Please describe to which degree, if any, an LLM was used in creating this pull request.

no LLM
...

@bwees bwees self-assigned this Nov 4, 2025
@bwees bwees changed the title Feature/add to album from photo view feat(mobile): add to album from asset viewer Nov 4, 2025
@shenlong-tanwen shenlong-tanwen requested a review from bwees November 5, 2025 12:08
Copy link
Member

@bwees bwees left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this :). Most of this is small nitpicks so should be pretty trivial to fix!

Comment on lines +190 to +200
String? _remoteIdOf(Object asset) {
if (asset is RemoteAsset) return asset.id;

try {
final dyn = asset as dynamic;
final rid = dyn.remoteId ?? dyn.id;
return rid is String ? rid : null;
} catch (_) {
return null;
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets remove this function and just add a check for if (asset is RemoteAsset) instead of calling this function. Additionally, we should never fall back to the id of an asset as that is not related to remoteId in any way.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only weird case would be viewing an asset that has been uploaded to the server but is being viewed from the local library timeline. Using hasRemote instead of checking if the asset is a RemoteAsset type has burned us in the past so I always use th "is" check :).

return;
}

final addedCount = await ref.read(remoteAlbumProvider.notifier).addAssets(album.id, [id]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
final addedCount = await ref.read(remoteAlbumProvider.notifier).addAssets(album.id, [id]);
final addedCount = await ref.read(remoteAlbumProvider.notifier).addAssets(album.id, [asset.remoteId]);

@bwees bwees force-pushed the feature/add_to_album_from_photo_view branch from 20cbe81 to 2a001ad Compare November 10, 2025 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants