-
Notifications
You must be signed in to change notification settings - Fork 696
Add quotation marks in dashboard around arguments with spaces in them #10404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add quotation marks in dashboard around arguments with spaces in them #10404
Conversation
There was a problem hiding this 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) | ||
{ |
There was a problem hiding this comment.
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.
src/Aspire.Dashboard/Components/ResourcesGridColumns/SourceColumnDisplay.razor
Outdated
Show resolved
Hide resolved
<span class="subtext">@FormatValue(launchArgument.Value)</span> | ||
|
||
static string FormatValue(string value) | ||
{ | ||
return " " + (value.Contains(' ') ? $"\"{value}\"" : value); |
There was a problem hiding this comment.
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.
<span class="subtext">@FormatValue(launchArgument.Value)</span> | |
static string FormatValue(string value) | |
{ | |
return " " + (value.Contains(' ') ? $"\"{value}\"" : value); | |
<span class="subtext"> @FormatValue(launchArgument.Value)</span> | |
static string FormatValue(string value) | |
{ | |
return (value.Contains(' ') ? $"\"{value}\"" : value); |
Description
Before:

After:

Fixes #10048
Checklist
<remarks />
and<code />
elements on your triple slash comments?doc-idea
templatebreaking-change
templatediagnostic
template