Repository navigation
Fix dashboard tooltips over non-localhost HTTP - #22414
Conversation
Co-authored-by: Copilot <[email protected]>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 22414Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 22414" |
Tests selector13 / 101 PR test projects · 2 PR jobs, from 2 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.
🟢 Approval recommended
No active review issues are blocking the tooltip identifier changes.
No open issues 🎉
What changed in this PR
Fixes dashboard tooltips on non-localhost HTTP origins by removing their dependency on crypto.randomUUID(), without changing transport or authentication settings.
Changes:
- Uses a shared document-local sequence for HTML and SVG tooltip identifiers, preserving existing element IDs and avoiding generated DOM ID collisions.
- Updates the Playwright regression test to exercise both tooltip paths with
randomUUIDunavailable and verify the HTML accessibility association.
| File | Description |
|---|---|
tests/Aspire.Dashboard.Playwright.Tests/Integration/Playwright/DashboardInteractionsTests.cs |
Simulates unavailable randomUUID and checks tooltip accessibility. |
src/Aspire.Dashboard/wwwroot/js/app-tooltips.js |
Replaces UUID generation with document-local sequential identifiers. |
Review effort: Balanced
PR #22414 browser testing report
Targeted passing command (PowerShell; test project built first, then rerun without rebuilding): $env:BROWSER_PATH = "$env:ProgramFiles\Google\Chrome\Application\chrome.exe"
$env:PLAYWRIGHT_NODEJS_PATH = (Get-Command node.exe).Source
$env:PLAYWRIGHT_DRIVER_SEARCH_PATH = (Resolve-Path '.\artifacts\bin\Aspire.Dashboard.Playwright.Tests\Debug\net11.0').Path
dotnet test --project .\tests\Aspire.Dashboard.Playwright.Tests\Aspire.Dashboard.Playwright.Tests.csproj --no-build --no-launch-profile -- --filter-method '*.Tooltips_SvgAnchorsPositionAndCleanUp' --filter-not-trait 'quarantined=true'No actionable code-review findings. Browser validation confirmed the fix from source; packaged validation remains outstanding. The working tree was unchanged. No test workspace or test server was left running. |
|
/backport to release/17.0 |
|
Started backporting to |
|
✅ No documentation update needed. Step 5 branch: proven false positive →
|
Backport of #22414 to release/17.0 /cc @JamesNK ## Customer Impact Users opening the Aspire dashboard over plain HTTP on a non-localhost hostname or IP address can't see tooltips on affected controls or resource graph nodes. The fix restores those tooltips without requiring a change to the dashboard URL. ## Testing On #22414, Chromium reproduced both failures before the fix and verified that HTML and SVG tooltips worked afterward on non-localhost HTTP. All three dashboard Playwright cases passed on rerun. The release backport was not separately browser-tested. [Test report](#22414 (comment)) ## Risk Low. The fix only changes how the dashboard generates tooltip identifiers. It preserves existing element IDs and doesn't change transport or authentication settings. ## Regression? Yes. The dashboard modernization (#21412) introduced a dependency on `crypto.randomUUID()` for tooltip anchors. Browsers don't expose that API on ordinary non-localhost HTTP origins. Co-authored-by: James Newton-King <[email protected]> Co-authored-by: Copilot <[email protected]>
Description
Dashboard tooltips can fail over plain HTTP on a non-localhost hostname or IP address because browsers only expose
crypto.randomUUID()in secure contexts. HTML targets without an existing ID fail to open a tooltip, and SVG targets fail when setting up the positioning anchor.Generate both identifiers from a shared, document-local sequence instead. Preserve existing element IDs and skip any generated DOM ID that is already in use. No new dependencies are required.
User-facing usage
Open an existing dashboard over non-localhost HTTP and hover over a control with a tooltip or a node in the resource graph. Both tooltips appear without needing to change the dashboard URL. This does not change the dashboard's transport or authentication settings.
Validation
node --check .\src\Aspire.Dashboard\wwwroot\js\app-tooltips.jspassed.crypto.randomUUIDis unavailable. It covered ID collision handling, existing IDs, accessibility associations, and SVG positioning and cleanup.randomUUIDunavailable. The repository's outerloop test was not run locally.Fixes # (issue)
Checklist
<remarks />and<code />elements on your triple slash comments?