Skip to content

ref(ui): Add ellipsize string helper #94935

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

Merged
merged 6 commits into from
Jul 7, 2025
Merged

ref(ui): Add ellipsize string helper #94935

merged 6 commits into from
Jul 7, 2025

Conversation

gggritso
Copy link
Member

@gggritso gggritso commented Jul 4, 2025

Was surprised that this helper doesn't exist? Maybe it does, but somewhere I didn't see it? Anyway I added a new one, y'all let me know what you want to call this thing, and if all the behaviour makes sense.

@gggritso gggritso requested a review from a team July 4, 2025 20:24
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jul 4, 2025
@gggritso gggritso marked this pull request as ready for review July 4, 2025 20:38
@gggritso gggritso requested a review from a team as a code owner July 4, 2025 20:38
cursor[bot]

This comment was marked as outdated.

gggritso and others added 2 commits July 6, 2025 22:08
Co-authored-by: Jonas <jonas.badalic@sentry.io>
cursor[bot]

This comment was marked as outdated.

Copy link

codecov bot commented Jul 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #94935      +/-   ##
==========================================
- Coverage   87.93%   87.88%   -0.05%     
==========================================
  Files       10455    10449       -6     
  Lines      606439   604345    -2094     
  Branches    23550    23550              
==========================================
- Hits       533251   531109    -2142     
- Misses      72821    72869      +48     
  Partials      367      367              

cursor[bot]

This comment was marked as outdated.

@gggritso
Copy link
Member Author

gggritso commented Jul 7, 2025

@JonasBa thanks for the suggestions, accepted 🙏🏻 I also futzed a bit with the truncation behaviour, after thinking about it for a while. In short, I think it's acceptable to trimEnd the string before ellipsizing because the ellipsis is already hiding information that was removed via truncation. But I think all-whitespace strings should be exempt from that, since in that case trimEnd removes all information. Open to other opinions!

@gggritso gggritso merged commit de7c822 into master Jul 7, 2025
47 checks passed
@gggritso gggritso deleted the ref/string-ellipsize branch July 7, 2025 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants