Skip to content

Conversation

adamint
Copy link
Member

@adamint adamint commented Jul 15, 2025

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?

@adamint adamint requested review from DamianEdwards and JamesNK July 15, 2025 01:25
@adamint adamint self-assigned this Jul 15, 2025
@Copilot Copilot AI review requested due to automatic review settings July 15, 2025 01:25
Copy link
Contributor

@Copilot 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 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(' '))

foreach (var launchArgument in ContentAfterValue)
{
if (launchArgument.IsShown)
{
Copy link
Preview

Copilot AI Jul 15, 2025

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 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
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 adamint merged commit 37d5759 into dotnet:main Jul 15, 2025
275 of 276 checks passed
@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
3 participants