Skip to content

[6.x] Fit more filename characters into asset grid#13979

Open
daun wants to merge 18 commits intostatamic:6.xfrom
daun:feature/asset-filename-ellipsis
Open

[6.x] Fit more filename characters into asset grid#13979
daun wants to merge 18 commits intostatamic:6.xfrom
daun:feature/asset-filename-ellipsis

Conversation

@daun
Copy link
Contributor

@daun daun commented Feb 18, 2026

Refactor asset filenames to display more of the filename when truncating.

  • Use Inter font for asset and folder names, for reliable measurements
  • Use custom character map for calculating string length without dom overhead
  • Extract middle ellipsis logic into its own component
  • Result: ~40% more characters visible at identical font size
  • Bundle size increases by 1.1 kB, from 893.7 kB to 894.8 kB

Before

16 characters per filename.

Screenshot 2026-02-18 at 12 17 14

After

21-23 characters per filename, around 40% improvement.

Screenshot 2026-02-18 at 12 14 45

Possible improvements

  • Make the component available in the UI package Wouldn't work without that
  • Inline the middle ellipsis logic from the package to save a few kB Done, saved 3 kB and simplified things

Credits

The core logic (though much simplified for our use case) is from dynamic-middle-ellipsis. The package also provides a script for generating the custom character width map.

@daun daun changed the title [6.x] Display more filename characters in asset grid [6.x] Fit more filename characters into asset grid Feb 18, 2026
@jackmcdade
Copy link
Member

Love it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments