Skip to content

Add quotation marks in dashboard around arguments with spaces in them - #10404

Merged
Adam Ratzman (adamint) merged 2 commits into
microsoft:mainfrom
adamint:dev/adamint/show-escaped-args-in-dashboard
Jul 15, 2025
Merged

Adam Ratzman (adamint) merged 2 commits into
microsoft:mainfrom
adamint:dev/adamint/show-escaped-args-in-dashboard

Conversation

@adamint

Copy link
Copy Markdown
Member

Description

Before:
image

After:
image

Fixes #10048

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, included playground resource examples for this
  • 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?

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.

Pull Request Overview

This PR ensures that dashboard launch arguments containing spaces are displayed with surrounding quotation marks, improving readability. It also removes a duplicate using directive and adds playground examples to cover single and multiple argument scenarios.

  • Wrapped arguments with spaces in quotes in the Razor component
  • Removed redundant @using in SourceColumnDisplay.razor
  • Added playground executables to test argument quoting behavior

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/Aspire.Dashboard/Components/ResourcesGridColumns/SourceColumnDisplay.razor Remove duplicate @using and add conditional logic to quote values with spaces
playground/Stress/Stress.AppHost/Program.cs Add example executables for testing arguments with and without spaces
Comments suppressed due to low confidence (1)

src/Aspire.Dashboard/Components/ResourcesGridColumns/SourceColumnDisplay.razor:23

  • Consider adding unit tests to verify that arguments with spaces are correctly wrapped in quotes and that single-word arguments remain unquoted.
                    if (launchArgument.Value.Contains(' '))

@@ -21,7 +20,14 @@
{
if (launchArgument.IsShown)
{

Copilot AI Jul 15, 2025

Copy link

Choose a reason for hiding this comment

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

[nitpick] The nested if-else duplicates the <span> markup; consider extracting the display value into a variable (e.g., displayValue) and rendering a single <span> for cleaner, DRY code.

Copilot uses AI. Check for mistakes.
@adamint
Adam Ratzman (adamint) enabled auto-merge (squash) July 15, 2025 02:52
Comment on lines +23 to +27
<span class="subtext">@FormatValue(launchArgument.Value)</span>

static string FormatValue(string value)
{
return " " + (value.Contains(' ') ? $"\"{value}\"" : value);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think a space turns into a non-breaking space. Double check before/after that args are still properly spaced.

Suggested change
<span class="subtext">@FormatValue(launchArgument.Value)</span>
static string FormatValue(string value)
{
return " " + (value.Contains(' ') ? $"\"{value}\"" : value);
<span class="subtext">&nbsp;@FormatValue(launchArgument.Value)</span>
static string FormatValue(string value)
{
return (value.Contains(' ') ? $"\"{value}\"" : value);

@adamint
Adam Ratzman (adamint) merged commit 37d5759 into microsoft:main Jul 15, 2025
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 14, 2025
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.

Dashboard should visually differentiate when args are escaped

4 participants