Skip to content
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

feat(web): Add "set as featured" option for an asset #14879

Merged
merged 1 commit into from
Dec 23, 2024

Conversation

IMBeniamin
Copy link
Contributor

@IMBeniamin IMBeniamin commented Dec 23, 2024

Description

This is a QoL feature that enables a user to set the featured photo of a person while inspecting (in full screen) said person.
This is an alternative flow to the currently existing one: person -> three dots -> select featured photo
It is now possible to set a featured photo by doing this:
person -> photo -> three dots -> use this as featured photo
The option is hidden in all views except when a person is provided to the asset-grid (i.e. the people/id page)

Note: I have followed the "set as album cover" implementation for this. The prop is propagated from the asset-grid all the way down to the asset-viewer-nav-bar. I do not like the fact that the handle function has been duplicated in both cases, but at least it's consistent.
[handleSelectFeaturePhoto]
(https://github.com/IMBeniamin/immich/blob/de39bf2b1701069b33949d5da3e0f47cdd338672/web/src/lib/components/asset-viewer/actions/set-person-featured-action.svelte#L19)
handleSelectFeaturePhoto

How Has This Been Tested?

  • Open the asset viewer from the timeline. Option should NOT be visible
  • Open the asset viewer from the album asset grid view. Option should NOT be visible
  • Open the asset viewer from the people page. Option IS visible
  • Feature photo is updated after clicking the set as featured photo option

Screenshots

image

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation if applicable

@bo0tzz
Copy link
Member

bo0tzz commented Dec 23, 2024

Neat! How does this behave if there are multiple people in the photo?

@IMBeniamin
Copy link
Contributor Author

Neat! How does this behave if there are multiple people in the photo?

The action is only shown when navigating to the asset viewer from a person. Consequently the person which is updated is always the one from which the asset grid has been created.

Example:

https://<immich_host>/people/c96b6bb7-553a-434b-867f-843f0ec89e6c/photos/a65bacc5-85e9-4d81-8e67-71fa4fd6b282?previousRoute=%2Fpeople
Would update the featured photo for c96b6bb7-553a-434b-867f-843f0ec89e6c

Copy link
Contributor

@jrasm91 jrasm91 left a comment

Choose a reason for hiding this comment

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

LGTM

@alextran1502 alextran1502 merged commit b88f98b into immich-app:main Dec 23, 2024
35 of 36 checks passed
@IMBeniamin IMBeniamin deleted the feat/set-feat-photo branch December 24, 2024 19:29
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.

4 participants