Skip to content

Fix dashboard tooltips over non-localhost HTTP - #22414

Merged
Eric Erhardt (eerhardt) merged 1 commit into
mainfrom
jamesnk/fix-dashboard-tooltips-http
Nov 19, 2026
Merged

Eric Erhardt (eerhardt) merged 1 commit into
mainfrom
jamesnk/fix-dashboard-tooltips-http

Conversation

@JamesNK

Copy link
Copy Markdown
Member

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.js passed.
  • An isolated headless Chrome check with the dashboard's Fluent UI module passed on a non-localhost HTTP origin where crypto.randomUUID is unavailable. It covered ID collision handling, existing IDs, accessibility associations, and SVG positioning and cleanup.
  • Updated the dashboard Playwright regression test to cover both tooltip paths with randomUUID unavailable. The repository's outerloop test was not run locally.

Fixes # (issue)

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 22414

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 22414"

@github-actions

Copy link
Copy Markdown
Contributor

Tests selector

13 / 101 PR test projects · 2 PR jobs, from 2 changed files.

Selected PR test projects (13 / 101)

Aspire.Dashboard.Components.Tests, Aspire.Dashboard.Tests, Aspire.Hosting.Azure.Kubernetes.Tests, Aspire.Hosting.Azure.Tests, Aspire.Hosting.Blazor.Tests, Aspire.Hosting.Dotnet.Tests, Aspire.Hosting.DotnetTool.Tests, Aspire.Hosting.JavaScript.Tests, Aspire.Hosting.Radius.Tests, Aspire.Hosting.Testing.Tests, Aspire.Hosting.Tests, Aspire.Playground.Tests, Aspire.Templates.Tests

Selected PR jobs (2)

extension-e2e, native-dashboard-validation


How these were chosen — grouped by what changed

⚠️ 12 of the 13 selected test projects come from a single change — src/Aspire.Dashboard/wwwroot/js/app-tooltips.js.

🔧 src/Aspire.Dashboard/wwwroot/js/app-tooltips.js (changed source)
→ 12 via the project graph: Aspire.Dashboard.Components.Tests, Aspire.Dashboard.Tests, Aspire.Hosting.Azure.Kubernetes.Tests (3 hops), Aspire.Hosting.Azure.Tests (2 hops), Aspire.Hosting.Blazor.Tests (2 hops), Aspire.Hosting.Dotnet.Tests (2 hops), Aspire.Hosting.DotnetTool.Tests (2 hops), Aspire.Hosting.JavaScript.Tests, Aspire.Hosting.Radius.Tests (2 hops), Aspire.Hosting.Testing.Tests, Aspire.Hosting.Tests, Aspire.Playground.Tests (2 hops)

📦 affected project Aspire.Dashboard
→ 1 test: Aspire.Templates.Tests

Job reasons

Job Triggered by
extension-e2e • src/Aspire.Dashboard/wwwroot/js/app-tooltips.js
• affected project Aspire.Dashboard
native-dashboard-validation affected project Aspire.Dashboard

Selection computed for commit dc14a26.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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 randomUUID unavailable 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

@JamesNK

Copy link
Copy Markdown
Member Author

PR #22414 browser testing report

  • PR: Fix dashboard tooltips over non-localhost HTTP
  • Tested: 2026-11-19, Windows, Chrome 157.0.8103.51
  • Verified PR head and local checkout: dc14a26df138d5ad74556ed1e7cf6aea95393ae7
  • Base used for comparison: 6835cb71f8f83d784d7a7ff21888bf0e07da6701
  • Scope: dashboard tooltip JavaScript and its Playwright regression test. No public API or deployment changes.
Scenario Result Evidence
Before/after on non-localhost HTTP Passed Playwright served each commit's JavaScript with the pinned Fluent UI module on an intercepted non-loopback HTTP origin. Chrome confirmed isSecureContext === false and typeof crypto.randomUUID === "undefined". The base failed for HTML without an ID and for SVG; the PR showed both tooltips without page errors.
Existing IDs, collisions, and cleanup Passed Reserved tooltip-anchor-1 in the fixture; the HTML tooltip used a different ID and reused it on reopening. Existing HTML and SVG IDs and aria-describedby associations were preserved. SVG positioning and Escape cleanup worked.
Localhost compatibility Passed The same PR checks passed over http://localhost/, where Chrome exposes crypto.randomUUID.
Dashboard Playwright regression 3 passed on rerun The actual dashboard fixture exercised a, g, and path SVG anchors and an ID-less HTML target with randomUUID unavailable. After correcting a local driver lookup issue, the first browser run passed two cases and timed out once in the path case's existing positioning assertion after refocus. The unchanged rerun passed all three; the cause of the one-off timeout was not established.
Packaged dashboard smoke test Not run The Windows dogfood build job was still in progress at the end of validation. No package was installed.

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.

@eerhardt
Eric Erhardt (eerhardt) merged commit 4ad3cfe into main Nov 19, 2026
164 checks passed
@microsoft-github-policy-service microsoft-github-policy-service Bot added this to the 17.1 milestone Nov 19, 2026
@JamesNK

Copy link
Copy Markdown
Member Author

/backport to release/17.0

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/17.0 (link to workflow run)

@aspire-repo-bot

Copy link
Copy Markdown
Contributor

✅ No documentation update needed.

Step 5 branch: proven false positive → bug_fix_restores_documented_behavior.

  • Triggered signals (2): pr_body_has_cli_flag_mention (evidence: the PR body's validation line node --check ...app-tooltips.js, a Node command rather than an Aspire CLI flag) and pr_body_has_user_facing_section (evidence: the "User-facing usage" heading, which only says tooltips now appear over non-localhost HTTP).
  • Changed files: src/Aspire.Dashboard/wwwroot/js/app-tooltips.js and one Playwright test. Together they fix tooltips failing when crypto.randomUUID() is unavailable in insecure contexts. No new options, settings, APIs, or documented behavior change, so there is nothing to document.

Jose Perez Rodriguez (joperezr) pushed a commit that referenced this pull request Nov 20, 2026
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants