Skip to content

Add Markdown descriptions to dashboard text visualizer dialogs - #20819

Merged
Mitch Denny (mitchdenny) merged 1 commit into
mainfrom
dashboard-text-visualizer-description
Oct 10, 2026
Merged

Mitch Denny (mitchdenny) merged 1 commit into
mainfrom
dashboard-text-visualizer-description

Conversation

@JamesNK

Copy link
Copy Markdown
Member

Description

Mermaid graph exports currently show diagram source without explaining the format. This change adds an optional Markdown description above text visualizer content and uses it to explain Mermaid with a link to Aspire's documentation.

  • Display descriptions above text/code or rendered Markdown, using the existing Markdown renderer and safe URL schemes.
  • Keep the description behind the existing secret-warning consent gate, and leave copying and downloading unchanged.
  • Fill the dialog's available content width and confine scrolling to the visualized content, keeping the description and action buttons stationary.
  • Size the content through a single-cell grid on Fluent's exposed content part, without depending on its generated wrapper markup.
  • Add one dialog regression, extend the existing Mermaid-export theory, and update localization inputs.

No new dependencies are required.

User-facing usage

Open Resources > Graph > Export as Mermaid. Above the diagram source, the dialog now displays:

Mermaid is a text-based format for defining diagrams. Learn more about Mermaid.

The source viewer uses the available dialog width. Copy and Download continue to use only the diagram source, not the description.

Screenshots / Recordings

This PR includes UI changes. Please add screenshots or screen recordings so reviewers can evaluate the visual changes without running locally.

  • For before/after comparisons, place them side-by-side or label them clearly.
  • For interactive changes (animations, transitions, new flows), prefer a short screen recording (GIF or video).
  • If you cannot capture visuals now, note what scenario to test and mark this section as TODO.

Mermaid export dialog with its Markdown description and a single content scrollbar

Validation

Targeted component tests: passed, 33 tests, 0 failures, 0 skipped. Build output was isolated to avoid disturbing the running Dashboard:

$env:MSBUILDTERMINALLOGGER = 'false'
$validationDirectory = [System.IO.Directory]::CreateTempSubdirectory('aspire-text-visualizer-pr-')
$validationRoot = Join-Path $validationDirectory.FullName 'bin\'
try {
    dotnet test --project .\tests\Aspire.Dashboard.Components.Tests\Aspire.Dashboard.Components.Tests.csproj --no-restore --no-launch-profile -p:ArtifactsBinDir=$validationRoot -- --filter-method '*.Render_TextVisualizerDialog*' --filter-method '*.ResourceGraph_ExportMermaid_UsesVisibleGraph' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true' --hangdump --hangdump-timeout 2m
    $testExitCode = $LASTEXITCODE
}
finally {
    Remove-Item -LiteralPath $validationDirectory.FullName -Recurse -Force
}
exit $testExitCode

Dashboard rebuild: passed with 0 warnings and 0 errors. Resource health check: passed.

$appHost = 'C:\Development\Source\aspire\playground\TestShop\TestShop.AppHost\TestShop.AppHost.csproj'
aspire resource aspire-dashboard rebuild --apphost $appHost --non-interactive
aspire wait aspire-dashboard --apphost $appHost --non-interactive

Localization update: passed with 0 warnings and 0 errors.

$env:MSBUILDTERMINALLOGGER = 'false'
dotnet build .\src\Aspire.Dashboard\Aspire.Dashboard.csproj --no-restore /t:UpdateXlf

Browser verification: passed at 1224x522, 1280x900, 375x667, and 844x390. Confirmed that the container and viewer fill the available content width, only the viewer scrolls, and the description and action buttons remain within the dialog.

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

Explain Mermaid exports and keep scrolling within the full-width content viewer.

Co-authored-by: Copilot <[email protected]>
@github-actions

github-actions Bot commented Oct 8, 2026

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 -- 20819

Or

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

@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Tests selector

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

Selected PR test projects (13 / 98)

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

⚠️ 10 of the 13 selected test projects come from a single change — src/Aspire.Dashboard/Components/Dialogs/TextVisualizerDialog.razor.

🔧 src/Aspire.Dashboard/Components/Dialogs/TextVisualizerDialog.razor (changed source)
→ 10 via the project graph: 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

🔧 src/Aspire.Dashboard/wwwroot/css/layout.css (changed source)
→ 1 via the project graph: Aspire.Dashboard.Tests

🧪 tests/Aspire.Dashboard.Components.Tests/Controls/TextVisualizerDialogTests.cs (changed test)
→ 1 directly: Aspire.Dashboard.Components.Tests

🧪 tests/Aspire.Dashboard.Components.Tests/Pages/ResourcesTests.cs (changed test)
→ 1 directly: Aspire.Dashboard.Components.Tests

Job reasons

Job Triggered by
extension-e2e • src/Aspire.Dashboard/Components/Dialogs/TextVisualizerDialog.razor, src/Aspire.Dashboard/Components/Dialogs/TextVisualizerDialog.razor.cs, src/Aspire.Dashboard/Components/Dialogs/TextVisualizerDialog.razor.css, src/Aspire.Dashboard/Components/Pages/Resources.razor.cs, src/Aspire.Dashboard/Model/OpenTextVisualizerDialogOptions.cs, src/Aspire.Dashboard/Model/TextVisualizerDialogViewModel.cs, src/Aspire.Dashboard/Resources/Resources.Designer.cs, src/Aspire.Dashboard/Resources/Resources.resx, src/Aspire.Dashboard/Resources/xlf/Resources.cs.xlf, src/Aspire.Dashboard/Resources/xlf/Resources.de.xlf, src/Aspire.Dashboard/Resources/xlf/Resources.es.xlf, src/Aspire.Dashboard/Resources/xlf/Resources.fr.xlf, src/Aspire.Dashboard/Resources/xlf/Resources.it.xlf, src/Aspire.Dashboard/Resources/xlf/Resources.ja.xlf, src/Aspire.Dashboard/Resources/xlf/Resources.ko.xlf, src/Aspire.Dashboard/Resources/xlf/Resources.pl.xlf, src/Aspire.Dashboard/Resources/xlf/Resources.pt-BR.xlf, src/Aspire.Dashboard/Resources/xlf/Resources.ru.xlf, src/Aspire.Dashboard/Resources/xlf/Resources.tr.xlf, src/Aspire.Dashboard/Resources/xlf/Resources.zh-Hans.xlf, src/Aspire.Dashboard/Resources/xlf/Resources.zh-Hant.xlf, src/Aspire.Dashboard/wwwroot/css/layout.css
• affected project Aspire.Dashboard
native-dashboard-validation affected project Aspire.Dashboard

Selection computed for commit d7e06b6.

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.

🟡 Changes recommended

The consent-gating requirement lacks focused regression coverage for Markdown descriptions.

1 open finding
What changed in this PR

Adds localized Markdown guidance above Mermaid source in the dashboard text visualizer while preserving consent gating and existing copy/download behavior.

Changes:

  • Adds optional Markdown descriptions with safe-link rendering.
  • Updates dialog sizing and scrolling.
  • Adds component coverage and localization resources.
File Description
tests/​.../​Pages/​ResourcesTests.cs Verifies Mermaid description wiring.
tests/​.../​Controls/​TextVisualizerDialogTests.cs Tests optional description rendering.
src/​Aspire.Dashboard/​wwwroot/​css/​layout.css Sizes dialog content using CSS grid.
Resources.zh-Hant.xlf Adds localization unit.
Resources.zh-Hans.xlf Adds localization unit.
Resources.tr.xlf Adds localization unit.
Resources.ru.xlf Adds localization unit.
Resources.pt-BR.xlf Adds localization unit.
Resources.pl.xlf Adds localization unit.
Resources.ko.xlf Adds localization unit.
Resources.ja.xlf Adds localization unit.
Resources.it.xlf Adds localization unit.
Resources.fr.xlf Adds localization unit.
Resources.es.xlf Adds localization unit.
Resources.de.xlf Adds localization unit.
Resources.cs.xlf Adds localization unit.
Resources.resx Defines the Mermaid description.
Resources.Designer.cs Exposes the localized description.
TextVisualizerDialogViewModel.cs Carries optional Markdown content.
OpenTextVisualizerDialogOptions.cs Accepts an optional description.
Resources.razor.cs Supplies Mermaid guidance to the dialog.
TextVisualizerDialog.razor.css Keeps descriptions stationary while content scrolls.
TextVisualizerDialog.razor.cs Propagates description options.
TextVisualizerDialog.razor Renders gated Markdown descriptions.
Files not reviewed (1)
  • src/Aspire.Dashboard/Resources/Resources.Designer.cs: Generated file

🧠 Review effort: Balanced


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@sebastienros

Copy link
Copy Markdown
Contributor

Since you added SQL colorization, is it also possible to add a mermaid visualizer as an option? (I understand you'd want the text too)

@mitchdenny
Mitch Denny (mitchdenny) merged commit a011c87 into main Oct 10, 2026
304 of 307 checks passed
@microsoft-github-policy-service microsoft-github-policy-service Bot added this to the 17.0 milestone Oct 10, 2026
aspire-repo-bot Bot added a commit to microsoft/aspire.dev that referenced this pull request Oct 10, 2026
@aspire-repo-bot

Copy link
Copy Markdown
Contributor

Pull request created: #1863

Generated by PR Documentation Check · copilot · auto · 92.4 AIC · ⌖ 16.1 AIC · ⊞ 20.4K

@aspire-repo-bot

Copy link
Copy Markdown
Contributor

📝 Documentation has been drafted in microsoft/aspire.dev#1863 targeting release/17.0.

PR #20819 adds an optional Markdown description above the text visualizer's content (triggered signals: dashboard_user_facing_page_changed on Resources.razor.cs; new_public_type adding TextVisualizerDialogViewModel.MarkdownDescription; pr_body_has_user_facing_section/pr_body_has_cli_flag_mention from the PR's "User-facing usage" section). It's first used by Resources > Graph > Export as Mermaid, which now shows "Mermaid is a text-based format for defining diagrams. [Learn more about Mermaid]((aka.ms/redacted) above the diagram source. Updated src/frontend/src/content/docs/dashboard/explore.mdx: added a new "Export the graph as Mermaid" subsection under Resources page documenting the feature, the description text, and that Copy/Download apply only to the diagram source.

Note

This draft PR needs human review before merging.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants