Add support for markdown formatting in interaction message#10189
Merged
Add support for markdown formatting in interaction message#10189
Conversation
JamesNK
commented
Jul 2, 2025
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for rendering interaction messages as Markdown throughout the dashboard components.
Key changes include:
- Introducing a
message_as_markdownflag in the proto and propagating it through the hosting service. - Adding a new
MarkdownHelpersutility and initializing a pipeline in the Blazor provider to convert Markdown to sanitized HTML. - Extending the public API (
InteractionOptions), component view models, dialogs, and unit tests to cover Markdown scenarios.
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Aspire.Dashboard.Components.Tests/Interactions/InteractionsProviderTests.cs | Add theory-based tests for Markdown vs. plain-text message rendering. |
| src/Aspire.Hosting/Dashboard/proto/dashboard_service.proto | Introduce message_as_markdown field in WatchInteractionsResponseUpdate. |
| src/Aspire.Hosting/Dashboard/DashboardService.cs | Map InteractionOptions.MessageAsMarkdown into the response update. |
| src/Aspire.Hosting/ApplicationModel/IInteractionService.cs | Add nullable MessageAsMarkdown property to InteractionOptions. |
| src/Aspire.Dashboard/Utils/MarkdownHelpers.cs | New helper class to build a Markdig pipeline and convert Markdown. |
| src/Aspire.Dashboard/Model/InteractionsInputsDialogViewModel.cs | Add required Message property for pre-rendered HTML content. |
| src/Aspire.Dashboard/Components/Interactions/InteractionsProvider.cs | Initialize Markdown pipeline, render messages with GetMessageHtml. |
| src/Aspire.Dashboard/Components/Dialogs/InteractionsInputDialog.razor | Render the formatted Message as MarkupString in the dialog. |
| src/Aspire.Dashboard/Aspire.Dashboard.csproj | Reference the Markdig package. |
| playground/Stress/Stress.AppHost/InteractionCommands.cs | Update example commands to demonstrate Markdown usage. |
| eng/Signing.props | Add Markdig.dll to the signing configuration. |
| THIRD-PARTY-NOTICES.TXT | Include license notice for Markdig. |
| Directory.Packages.props | Pin Markdig package version. |
Comments suppressed due to low confidence (2)
src/Aspire.Hosting/ApplicationModel/IInteractionService.cs:329
- Add XML documentation with
<remarks>and<code>sections for this new public API property to match the existing style and fulfill the API review checklist.
public bool? MessageAsMarkdown { get; set; }
src/Aspire.Dashboard/Model/InteractionsInputsDialogViewModel.cs:18
- Consider adding a triple-slash summary comment for the new
Messageproperty to explain that it contains pre-rendered HTML from Markdown.
public required string Message { get; init; }
src/Aspire.Dashboard/Components/Interactions/InteractionsProvider.cs
Outdated
Show resolved
Hide resolved
Member
mitchdenny
approved these changes
Jul 2, 2025
Member
mitchdenny
left a comment
There was a problem hiding this comment.
Tested this out in the codespace and works as advertised. Markdown actually supports HTML which I did try about but I noticed we don't render it :) Understandable given the conversations that we've had in the background. Thanks for doing this.
600370b to
8e28830
Compare
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Description
Add support for markdown content in the message.
Checklist
<remarks />and<code />elements on your triple slash comments?doc-ideatemplatebreaking-changetemplatediagnostictemplate