[PR #18913] feat(web): Change the primary asset of a stack #15879

Closed
opened 2026-02-05 15:56:00 +03:00 by OVERLORD · 0 comments
Owner

Original Pull Request: https://github.com/immich-app/immich/pull/18913

State: closed
Merged: Yes


Description

Adds a menu option in the asset viewer to change a stack's primary asset. Upon change, the asset viewer's stack is updated (for the preview images at the bottom), and the main page is updated to account for the change in primary asset.

There is a quirk, due to how stacks display in the favorites page: if a favorite was the primary asset, and the primary asset gets changed to a non-favorite, then the asset will no longer show up in favorites. This applies even in the favorites page, which is kind of jarring when the asset is now missing from favorites.
Note this isn't due to the primary asset changing, but to how stacks are handled throughout Immich.

Fixes #8498

How Has This Been Tested?

  1. Creating a stack, then changing the primary asset and backing out of the viewer
  2. Adding to a stack, then changing the primary asset and backing out of the viewer

The stack is updated in both the asset viewer's stack preview, and on the photos page

Screenshots (if appropriate)

image

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation if applicable
  • I have no unrelated changes in the PR.
  • I have confirmed that any new dependencies are strictly necessary.
  • I have written tests for new code (if applicable)
  • I have followed naming conventions/patterns in the surrounding code
  • All code in src/services/ uses repositories implementations for database calls, filesystem operations, etc.
  • All code in src/repositories/ is pretty basic/simple and does not have any immich specific logic (that belongs in src/services/)
**Original Pull Request:** https://github.com/immich-app/immich/pull/18913 **State:** closed **Merged:** Yes --- ## Description Adds a menu option in the asset viewer to change a stack's primary asset. Upon change, the asset viewer's stack is updated (for the preview images at the bottom), and the main page is updated to account for the change in primary asset. There is a quirk, due to how stacks display in the favorites page: if a favorite was the primary asset, and the primary asset gets changed to a non-favorite, then the asset will no longer show up in favorites. This applies even in the favorites page, which is kind of jarring when the asset is now missing from favorites. Note this isn't due to the primary asset changing, but to how stacks are handled throughout Immich. Fixes #8498 ## How Has This Been Tested? 1. Creating a stack, then changing the primary asset and backing out of the viewer 2. Adding to a stack, then changing the primary asset and backing out of the viewer The stack is updated in both the asset viewer's stack preview, and on the photos page <details><summary><h2>Screenshots (if appropriate)</h2></summary> ![image](https://github.com/user-attachments/assets/f6615ddd-0387-439d-afff-3c46fb493097) </details> ## Checklist: - [x] I have performed a self-review of my own code - [x] 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. - [x] 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/`)
OVERLORD added the pull-request label 2026-02-05 15:56:00 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#15879