Skip to content

Add support for markdown formatting in interaction message#10189

Merged
JamesNK merged 6 commits intomainfrom
jamesnk/interaction-markdown-message
Jul 5, 2025
Merged

Add support for markdown formatting in interaction message#10189
JamesNK merged 6 commits intomainfrom
jamesnk/interaction-markdown-message

Conversation

@JamesNK
Copy link
Member

@JamesNK JamesNK commented Jul 2, 2025

Description

Add support for markdown content in the message.

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
  • Does the change require an update in our Aspire docs?

@JamesNK JamesNK added area-dashboard area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication labels Jul 2, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for rendering interaction messages as Markdown throughout the dashboard components.
Key changes include:

  • Introducing a message_as_markdown flag in the proto and propagating it through the hosting service.
  • Adding a new MarkdownHelpers utility 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 Message property to explain that it contains pre-rendered HTML from Markdown.
    public required string Message { get; init; }

@JamesNK JamesNK changed the title Add support for markdown formatting to interaction message Add support for markdown formatting in interaction message Jul 2, 2025
@davidfowl
Copy link
Member

cc @captainsafia

Copy link
Member

@mitchdenny mitchdenny left a comment

Choose a reason for hiding this comment

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

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.

@JamesNK JamesNK requested a review from captainsafia July 5, 2025 01:07
@JamesNK JamesNK force-pushed the jamesnk/interaction-markdown-message branch from 600370b to 8e28830 Compare July 5, 2025 01:30
@JamesNK JamesNK enabled auto-merge (squash) July 5, 2025 01:30
@JamesNK JamesNK merged commit 6377383 into main Jul 5, 2025
496 of 498 checks passed
@JamesNK JamesNK deleted the jamesnk/interaction-markdown-message branch July 5, 2025 05:59
@github-actions github-actions bot locked and limited conversation to collaborators Aug 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication area-dashboard

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants