Skip to content

Conversation

@robinbrisa
Copy link
Contributor

@robinbrisa robinbrisa commented Jun 3, 2025

Description

When an asset in a shared album has 1 or more likes, the total like count is displayed next to the heart icon (just like it already does for comments).

Extra: count text size reduced from XL to L to prevent the activity widget from growing when counts appear.

How Has This Been Tested?

  • Open an asset that has likes. The like count should appear
  • Like an asset. The like counter should increment
  • Unlike an asset. The like counter should decrement
  • The like count should not appear on the main album page

Screenshots (if appropriate)

image

API changes

The /api/activities/statistics endpoint now also returns the like count : {"comments":2,"likes":8}

Checklist:

  • I have performed a self-review of my own code
  • I have no unrelated changes in the PR.
  • I have confirmed that any new dependencies are strictly necessary.
  • 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/)

@JobiJoba
Copy link
Contributor

JobiJoba commented Jun 4, 2025

Hey, small question as you worked on that part of the code, the likes count are not shown on an album page
image

As you probably now have the knowledge about it, would it be difficult to do that? (I want to replicate your web change to the mobile app)

@robinbrisa robinbrisa changed the title feat(web): display number of likes on asset viewer feat(web): display number of likes in asset viewer Jun 4, 2025
@robinbrisa
Copy link
Contributor Author

robinbrisa commented Jun 4, 2025

As you probably now have the knowledge about it, would it be difficult to do that? (I want to replicate your web change to the mobile app)

It can very easily display the total amount of likes throughout the whole album. I don't show it on purpose as I was not sure if it was relevant but it's worth discussing the matter.

The /api/activities/statistics api endpoint already exposes the total number of likes for the album so you can get this info at the same time as the number of comments.

Copy link
Member

@danieldietzler danieldietzler 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 needs to decide if we actually want that UX/UI wise.

@robinbrisa robinbrisa force-pushed the feat/display-likes-count branch from ef2c3ed to 9f83cb4 Compare June 4, 2025 11:41
@alextran1502 alextran1502 enabled auto-merge (squash) June 4, 2025 13:22
auto-merge was automatically disabled June 4, 2025 14:07

Head branch was pushed to by a user without write access

@alextran1502 alextran1502 enabled auto-merge (squash) June 4, 2025 15:34
auto-merge was automatically disabled June 4, 2025 15:37

Head branch was pushed to by a user without write access

@robinbrisa
Copy link
Contributor Author

Sorry for all the mess, everything should pass now :)

@alextran1502 alextran1502 merged commit a26d703 into immich-app:main Jun 4, 2025
47 checks passed
savely-krasovsky pushed a commit to savely-krasovsky/immich that referenced this pull request Jun 8, 2025
* feat: display number of likes

* fix: properly decrement like count on unlike

Co-authored-by: Daniel Dietzler <[email protected]>

* chore: pr feedback

* chore: updated related test

* chore: formatter run

* chore: force numberOfLikes to null in album context to pass lint

* chore: open-api updated

* fix: use undefined, not null

* styling tweaks

* chore: updated sql

---------

Co-authored-by: Daniel Dietzler <[email protected]>
Co-authored-by: Alex Tran <[email protected]>
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