fix(tooltip): use text-pretty instead of text-balance#393
Merged
Conversation
`text-balance` (CSS `text-wrap: balance`) tries to make every line of the tooltip roughly the same width. That works well for short, headline style tooltips but leaves visible whitespace on the right for any multi-sentence tooltip, because the balanced break points often fall before the `max-w-64` ceiling. `text-pretty` keeps the widow/orphan protection users expect from paragraph-style text while letting lines fill toward the container width. Short single-line tooltips are unaffected; longer ones now use the full available width.
|
✅ No security or compliance issues detected. Reviewed everything up to 7ad0ef2. Security Overview
Detected Code Changes
|
📊 Build Bundle StatsThe latest build generated the following assets: |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts tooltip text-wrapping behavior in the frontend by switching the Tailwind utility used for multi-line tooltip layout, aiming to reduce ragged right edges/extra whitespace for multi-sentence tooltips.
Changes:
- Replaced
text-balancewithtext-prettyonTooltipContentto improve multi-line tooltip wrapping.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
artkorotkikh-dfinity
approved these changes
May 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Multi-sentence tooltips (e.g. the
hotkeyTooltipand the upcoming following-status tooltips) render with visible whitespace on the right side.text-balanceevens out line lengths, which often breaks earlier than themax-w-64ceiling and leaves the right edge ragged.Example of unbalanced tooltips: #392
Changes
text-balancefortext-prettyonTooltipContent. Short single-line tooltips look the same; multi-line tooltips now fill toward the container width while still avoiding widows/orphans.