-
Notifications
You must be signed in to change notification settings - Fork 3.2k
fix(ui) Add ellipses and tooltip to long names on home page header #13425
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
Conversation
useEffect(() => { | ||
const el = textRef.current; | ||
if (el) { | ||
setIsTruncated(el.scrollWidth > el.clientWidth); | ||
} | ||
}, [text]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we put this in a resize observer? Maybe not by default -- could impact performance, but option would be nice
}, [text]); | ||
|
||
return ( | ||
<Tooltip2 title={isTruncated ? text : undefined}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we always using "Tooltip2" over regular tooltip? I think of Tooltip2
as more of a "structured tooltip". And then we should just make our regular Tooltip look like we want, i.e. with a white background and gray text
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah that's a good question we need to clear up. let's ask designers to get a final call here
🔴 Meticulous spotted visual differences in 135 of 1393 screens tested: view and approve differences detected. Meticulous evaluated ~9 hours of user flows against your PR. Last updated for commit 04c1b13. This comment will update as new commits are pushed. |
Codecov ReportAttention: Patch coverage is ✅ All tests successful. No failed tests found. ❌ Your patch status has failed because the patch coverage (55.71%) is below the target coverage (75.00%). You can increase the patch coverage or adjust the target coverage. 📢 Thoughts on this report? Let us know! |
With the recent changes to the home page where we got rid of that huge color block, I noticed we weren't properly handling long names but truncating them with an ellipses but they were just getting cut off. I fix this by adding an
OverflowText
component that's pretty bare bones right now but can be beefed out later for different use cases. This simply adds ellipses and shows a tooltip if text is too wide for its area. Still allows line breaks and what not.Here's it in action on the home page: