Repository navigation
Improve dashboard tooltip wrapping - #22235
James Newton-King (JamesNK) wants to merge 1 commit into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 22235Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 22235" |
Tests selector13 / 101 PR test projects · 2 PR jobs, from 3 changed files. Selected PR test projects (13 / 101)
Selected PR jobs (2)
How these were chosen — grouped by what changed
🔧 📦 affected project Job reasons
Selection computed for commit |
There was a problem hiding this comment.
🟡 Changes recommended
The trailing trim removes combining accents from complete retained words, changing text such as “café” to “cafe” even when truncation occurs at a word boundary.
1 open issue
What changed in this PR
Improves long plain-text tooltips in the Aspire dashboard while preserving rich tooltip content.
Changes:
- Adjusts tooltip width limits to use available space and wrap long text.
- Caps plain-text tooltips at 1,024 UTF-16 units, preferring word boundaries and adding an ellipsis.
- Adds Playwright coverage for truncation boundaries, surrogate handling, and rich-content preservation.
| File | Description |
|---|---|
| tests/Aspire.Dashboard.Playwright.Tests/Integration/Playwright/ResourcesTests.cs | Adds plain-text truncation and rich-tooltip preservation tests. |
| src/Aspire.Dashboard/wwwroot/js/app-tooltips.js | Implements length-limited, word-aware plain-text truncation. |
| src/Aspire.Dashboard/wwwroot/css/controls.css | Updates tooltip width limits for viewport and anchor space. |
Review effort: Balanced
| end = boundary; | ||
| } | ||
|
|
||
| let prefix = text.slice(0, end).replace(/[\p{White_Space}\p{Cc}\p{Mn}]+$/u, ""); |

Description
Long dashboard tooltips can be unnecessarily narrow compared with native browser tooltips. This change allows plain-text tooltips to use more of the available space, wrap long words, and truncate very long text consistently. Rich tooltips remain unchanged.
User-facing usage
Hover a dashboard element with a long text tooltip to see it wrap within the available viewport. Text exceeding 1,024 UTF-16 units is shortened at a word boundary where possible and ends with an ellipsis.
Screenshots
The comparison page shows the original and updated Fluent tooltip rules for the same text:
An unbroken 10,000-character value wraps and is truncated:
Validation
Passed the focused Playwright scenario (1 test) with the following command, before the final CSS width simplification:
On the final CSS, the local comparison page passed 24 wrapping and placement checks at 360px. Its 800px iframe run timed out waiting for a tooltip on the 10,000-character case, so the 1440px checks were not reached.
Directly hovering the 10,000-character case in the comparison page displayed 1,024 characters including an ellipsis, at an 800px tooltip width within a 1096px viewport.
Fixes # (issue)
Checklist
<remarks />and<code />elements on your triple slash comments?