Skip to content

fix(web): resize long album names (Closes #26533)#27024

Closed
updatemike wants to merge 1 commit intoimmich-app:mainfrom
updatemike:fix/album-title-resize
Closed

fix(web): resize long album names (Closes #26533)#27024
updatemike wants to merge 1 commit intoimmich-app:mainfrom
updatemike:fix/album-title-resize

Conversation

@updatemike
Copy link

@updatemike updatemike commented Mar 18, 2026

Description

This PR fixes the issue where long album titles will cause them to overflow from the screen without any attempt to resize it.

I added two things for this fix: size classes for the Album title and a method for calculating the Album title's current size and choosing which size class to pick.

The size classes' values follow the project's guidelines starting with the largest size, which are the same as the original default values, and reducing the size in tiers. These classes use tailwind css and follow project's specification for different sized viewports.

To calculate the Album title's text size I found two options: the use of Canvas2D or creating a temporary invisible DOM element. I chose the latter because the project's tooling mentioned lack of support for Canvas2D. After calculating the title's size, the method calculates which size class the title should have to fit in the viewport.

For visibility reasons the size classes don't go any lower than what was set as the smallest size class but if needed it is very easy to add and/or remove size tiers. I verified that my fix worked as intended and created e2e tests for it.

Fixes #26533 (issue)

How Has This Been Tested?

  • Manually tested using the development container in chrome and firefox.
  • Added a e2e test

Screenshots (if appropriate)

image

Checklist:

  • I have carefully read CONTRIBUTING.md
  • 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/)

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

I used a LLM for grammar and spell checking and also for some questioning about alternative methods of implementation.

...

Reduce the album title font size for large titles.

Signed-off-by: Michael Maycock <michael.maycock@tecnico.ulisboa.pt>
@immich-push-o-matic
Copy link

immich-push-o-matic bot commented Mar 18, 2026

Label error. Requires exactly 1 of: changelog:.*. Found: 🖥️web. A maintainer will add the required label.

@bo0tzz
Copy link
Member

bo0tzz commented Mar 18, 2026

Does this duplicate #27012?

@danieldietzler
Copy link
Member

Yes, it does. Sorry!

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.

[Web] [Issue] Web UI does not properly display long album names

3 participants