Dashboard: Parameters page follow-ups - clickable set value, warning badge, filter by resource#16117
Dashboard: Parameters page follow-ups - clickable set value, warning badge, filter by resource#16117adamint wants to merge 4 commits intomicrosoft:mainfrom
Conversation
…r by resource, graph improvements - Feature 1: Make 'Value not set' a clickable link that triggers the SetParameterCommand - Feature 2: Add warning badge on Parameters tab showing count of unresolved parameters - Feature 3: 'View parameters (N)' menu item on resources with parameter relationships - Filters parameters by related resource with toolbar indicator and clear button - Direct in-page callback for instant tab switching (no URL navigation delay) - Graph: Hide endpoints for parameter nodes and center the icon - Graph: Fix null endpoint text crash in trimText function - Filter: Hide resource types filter section on Parameters tab - Dialog: Add autocomplete=off to prevent browser suggestions in parameter input - Stress AppHost: Add api-key and db-connection-string parameters for testing - Tests: Add ResourceGraphMapper and ResourceMenuBuilder tests - Skill: Update dashboard E2E testing skill to store evidence outside repo Fixes microsoft#13430
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 16117Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 16117" |
There was a problem hiding this comment.
Pull request overview
This PR adds follow-up UX improvements to the Aspire Dashboard Parameters experience by enabling in-grid value setting for unresolved parameters, adding a resource-scoped parameters filter (including a “View parameters (N)” menu entry), and refining resource-graph rendering for parameter nodes.
Changes:
- Add a “View parameters (N)” action for resources that reference parameter resources, and wire it to filter the Parameters view to a single resource.
- Make “Value not set” clickable (when supported) to launch the parameter set command; disable browser autofill in the parameter dialog input.
- Hide endpoint text for parameter nodes in the resource graph and adjust icon positioning accordingly.
Reviewed changes
Copilot reviewed 41 out of 43 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Aspire.Dashboard.Tests/Model/ResourceMenuBuilderTests.cs | Adds unit coverage for the new “View parameters” menu item visibility logic. |
| tests/Aspire.Dashboard.Tests/Model/ResourceGraphMapperTests.cs | Adds unit coverage that parameter nodes have no endpoint text/url in the graph DTO. |
| src/Aspire.Dashboard/wwwroot/js/app-resourcegraph.js | Hides endpoint UI when endpointText is absent and recenters the icon. |
| src/Aspire.Dashboard/Resources/xlf/Resources.zh-Hant.xlf | Adds new localized string entries for parameter filter clear + view-related-parameters. |
| src/Aspire.Dashboard/Resources/xlf/Resources.zh-Hans.xlf | Adds new localized string entries for parameter filter clear + view-related-parameters. |
| src/Aspire.Dashboard/Resources/xlf/Resources.tr.xlf | Adds new localized string entries for parameter filter clear + view-related-parameters. |
| src/Aspire.Dashboard/Resources/xlf/Resources.ru.xlf | Adds new localized string entries for parameter filter clear + view-related-parameters. |
| src/Aspire.Dashboard/Resources/xlf/Resources.pt-BR.xlf | Adds new localized string entries for parameter filter clear + view-related-parameters. |
| src/Aspire.Dashboard/Resources/xlf/Resources.pl.xlf | Adds new localized string entries for parameter filter clear + view-related-parameters. |
| src/Aspire.Dashboard/Resources/xlf/Resources.ko.xlf | Adds new localized string entries for parameter filter clear + view-related-parameters. |
| src/Aspire.Dashboard/Resources/xlf/Resources.ja.xlf | Adds new localized string entries for parameter filter clear + view-related-parameters. |
| src/Aspire.Dashboard/Resources/xlf/Resources.it.xlf | Adds new localized string entries for parameter filter clear + view-related-parameters. |
| src/Aspire.Dashboard/Resources/xlf/Resources.fr.xlf | Adds new localized string entries for parameter filter clear + view-related-parameters. |
| src/Aspire.Dashboard/Resources/xlf/Resources.es.xlf | Adds new localized string entries for parameter filter clear + view-related-parameters. |
| src/Aspire.Dashboard/Resources/xlf/Resources.de.xlf | Adds new localized string entries for parameter filter clear + view-related-parameters. |
| src/Aspire.Dashboard/Resources/xlf/Resources.cs.xlf | Adds new localized string entries for parameter filter clear + view-related-parameters. |
| src/Aspire.Dashboard/Resources/xlf/ControlsStrings.zh-Hant.xlf | Adds localized tooltip/action text for the “click to set parameter value” affordance. |
| src/Aspire.Dashboard/Resources/xlf/ControlsStrings.zh-Hans.xlf | Adds localized tooltip/action text for the “click to set parameter value” affordance. |
| src/Aspire.Dashboard/Resources/xlf/ControlsStrings.tr.xlf | Adds localized tooltip/action text for the “click to set parameter value” affordance. |
| src/Aspire.Dashboard/Resources/xlf/ControlsStrings.ru.xlf | Adds localized tooltip/action text for the “click to set parameter value” affordance. |
| src/Aspire.Dashboard/Resources/xlf/ControlsStrings.pt-BR.xlf | Adds localized tooltip/action text for the “click to set parameter value” affordance. |
| src/Aspire.Dashboard/Resources/xlf/ControlsStrings.pl.xlf | Adds localized tooltip/action text for the “click to set parameter value” affordance. |
| src/Aspire.Dashboard/Resources/xlf/ControlsStrings.ko.xlf | Adds localized tooltip/action text for the “click to set parameter value” affordance. |
| src/Aspire.Dashboard/Resources/xlf/ControlsStrings.ja.xlf | Adds localized tooltip/action text for the “click to set parameter value” affordance. |
| src/Aspire.Dashboard/Resources/xlf/ControlsStrings.it.xlf | Adds localized tooltip/action text for the “click to set parameter value” affordance. |
| src/Aspire.Dashboard/Resources/xlf/ControlsStrings.fr.xlf | Adds localized tooltip/action text for the “click to set parameter value” affordance. |
| src/Aspire.Dashboard/Resources/xlf/ControlsStrings.es.xlf | Adds localized tooltip/action text for the “click to set parameter value” affordance. |
| src/Aspire.Dashboard/Resources/xlf/ControlsStrings.de.xlf | Adds localized tooltip/action text for the “click to set parameter value” affordance. |
| src/Aspire.Dashboard/Resources/xlf/ControlsStrings.cs.xlf | Adds localized tooltip/action text for the “click to set parameter value” affordance. |
| src/Aspire.Dashboard/Resources/Resources.resx | Adds the new resource strings for filter clear + “View parameters (N)”. |
| src/Aspire.Dashboard/Resources/Resources.Designer.cs | Regenerates strongly-typed accessors for the new resource strings. |
| src/Aspire.Dashboard/Resources/ControlsStrings.resx | Adds the new control string for the “click to set parameter value” tooltip. |
| src/Aspire.Dashboard/Resources/ControlsStrings.Designer.cs | Regenerates strongly-typed accessors for the new control string. |
| src/Aspire.Dashboard/Model/ResourceMenuBuilder.cs | Adds “View parameters (N)” menu item and optional callback wiring. |
| src/Aspire.Dashboard/Model/ResourceGraph/ResourceGraphMapper.cs | Suppresses endpoint URL/text for parameter nodes in graph DTOs. |
| src/Aspire.Dashboard/Components/Pages/Resources.razor.cs | Implements parameter filtering by related resource and URL/state persistence changes. |
| src/Aspire.Dashboard/Components/Pages/Resources.razor | Adds filter indicator/clear button and clickable “Value not set” affordance. |
| src/Aspire.Dashboard/Components/Dialogs/InteractionsInputDialog.razor | Disables browser autocomplete for dialog input. |
| src/Aspire.Dashboard/Components/Controls/ResourceFilters.razor | Adds a flag to hide the resource-type filter section on Parameters view. |
| src/Aspire.Dashboard/Components/Controls/ResourceActions.razor.cs | Plumbs “View related parameters” callback into resource action menus. |
| playground/Stress/Stress.AppHost/AppHost.cs | Adds parameters and env var wiring to exercise the feature in Stress playground. |
| .vscode/launch.json | Adds Aspire launch configurations for TestShop and Stress playground AppHosts. |
| .github/skills/dashboard-e2e-testing/SKILL.md | Adds a Playwright CLI workflow doc for interactive dashboard E2E validation. |
Files not reviewed (2)
- src/Aspire.Dashboard/Resources/ControlsStrings.Designer.cs: Language not supported
- src/Aspire.Dashboard/Resources/Resources.Designer.cs: Language not supported
| @@ -0,0 +1,254 @@ | |||
| --- | |||
| name: dashboard-e2e-testing | |||
| if (setCommand is not null) | ||
| { | ||
| <span class="cellText" @onclick:stopPropagation="true"> | ||
| <button type="button" | ||
| class="value-not-set-link" | ||
| @onclick="@(() => ExecuteResourceCommandAsync(context.Resource, setCommand))" | ||
| title="@ControlsStringsLoc[nameof(ControlsStrings.ParameterSetValueAction)]"> | ||
| @ControlsStringsLoc[nameof(ControlsStrings.ParameterValueNotSet)] | ||
| </button> | ||
| </span> | ||
| } | ||
| else | ||
| { | ||
| <span class="cellText">@ControlsStringsLoc[nameof(ControlsStrings.ParameterValueNotSet)]</span> | ||
| } |
| // Add "View parameters" for non-parameter resources that reference parameters | ||
| var parameterCount = CountParameterRelationships(resource, resourceByName); | ||
| if (!resource.IsParameter && parameterCount > 0) | ||
| { | ||
| var capturedResource = resource; | ||
| menuItems.Add(new MenuButtonItem | ||
| { | ||
| Text = string.Format(CultureInfo.CurrentCulture, _loc[nameof(Resources.Resources.ResourcesViewRelatedParameters)], parameterCount), | ||
| Icon = s_keyIcon, | ||
| OnClick = onViewRelatedParameters is not null | ||
| ? () => onViewRelatedParameters(capturedResource) | ||
| : () => | ||
| { | ||
| _navigationManager.NavigateTo(DashboardUrls.ResourcesUrl( | ||
| view: "Parameters", | ||
| resource: capturedResource.Name)); | ||
| return Task.CompletedTask; | ||
| } | ||
| }); | ||
| } |
There was a problem hiding this comment.
I'd prefer not to add this to the context menu. There are a lot of menu options already. I don't think this makes the cut.
Instead people can view the resource detail, see the parameter in the relationships and click on View to open it.
| { | ||
| foreach (var command in resource.Commands) | ||
| { | ||
| if (string.Equals(command.Name, "parameter-set", StringComparison.Ordinal)) |
There was a problem hiding this comment.
There should be a known command name type with "parameter-set" on it. Also I think there is a command name comparison.
| private async Task ClearRelatedResourceFilterAsync() | ||
| { | ||
| ResourceName = null; | ||
| await this.AfterViewModelChangedAsync(_contentLayout, waitToApplyMobileChange: false); | ||
| await _dataGrid.SafeRefreshDataAsync(); | ||
| } | ||
|
|
||
| private async Task ViewRelatedParametersAsync(ResourceViewModel resource) | ||
| { | ||
| ResourceName = resource.Name; | ||
| if (PageViewModel.SelectedViewKind == ResourceViewKind.Parameters) | ||
| { | ||
| // Already on the Parameters tab, just refresh the grid with the new filter | ||
| await _dataGrid.SafeRefreshDataAsync(); | ||
| await InvokeAsync(StateHasChanged); | ||
| } | ||
| else | ||
| { | ||
| await OnViewChangedAsync(ResourceViewKind.Parameters); | ||
| } | ||
| } |
There was a problem hiding this comment.
I think remove all of this. You can view parameters for a resource in the related resource section inside resource details. I don't want to add a new way to view related resources that's specific to parameters.
| public required IDictionary<string, bool> ResourceTypesToVisibility { get; set; } | ||
| public required IDictionary<string, bool> ResourceStatesToVisibility { get; set; } | ||
| public required IDictionary<string, bool> ResourceHealthStatusesToVisibility { get; set; } | ||
| public string? Resource { get; set; } |
| public string GetUrlFromSerializableViewModel(ResourcesPageState serializable) | ||
| { | ||
| return DashboardUrls.ResourcesUrl( | ||
| resource: serializable.Resource, |
| ResourceStatesToVisibility = PageViewModel.ResourceStatesToVisibility, | ||
| ResourceHealthStatusesToVisibility = PageViewModel.ResourceHealthStatusesToVisibility | ||
| ResourceHealthStatusesToVisibility = PageViewModel.ResourceHealthStatusesToVisibility, | ||
| Resource = PageViewModel.SelectedViewKind == ResourceViewKind.Parameters ? ResourceName : null |
| <button type="button" | ||
| class="value-not-set-link" | ||
| @onclick="@(() => ExecuteResourceCommandAsync(context.Resource, setCommand))" | ||
| title="@ControlsStringsLoc[nameof(ControlsStrings.ParameterSetValueAction)]"> | ||
| @ControlsStringsLoc[nameof(ControlsStrings.ParameterValueNotSet)] | ||
| </button> |
There was a problem hiding this comment.
setCommand could be disabled. disabled on button if the command is disabled.
JamesNK
left a comment
There was a problem hiding this comment.
2 comments on the GetSetParameterCommand method.
| } | ||
| } | ||
| return null; | ||
| } |
There was a problem hiding this comment.
GetSetParameterCommand returns the command regardless of its State. If the command is CommandViewModelState.Hidden, the clickable "Value not set" button will still render. Consider filtering: e.g. only return the command when command.State != CommandViewModelState.Hidden.
| { | ||
| foreach (var command in resource.Commands) | ||
| { | ||
| if (string.Equals(command.Name, "parameter-set", StringComparison.Ordinal)) |
There was a problem hiding this comment.
The Dashboard mirrors known command name strings as constants on CommandViewModel (see StartCommand, StopCommand, RestartCommand). Add a SetParameterCommand constant there and use it here instead of the "parameter-set" string literal.

Description
Follow-up improvements to the Parameters page in the Aspire Dashboard, addressing items from issue #13430.
Changes
Feature 1: Clickable "Value not set" to set parameter values
<button>for proper keyboard accessibility (Enter and Space activation)@onclick:stopPropagationto prevent opening the resource details viewFeature 2: Filter parameters by resource ("View parameters")
resourcequery parameter for deep-linking when combined withview=ParametersGraph improvements
trimTextnull crash when endpoint text is nullOther improvements
autocomplete="off"on text input in parameter dialog to prevent browser autofill suggestionsapi-keyanddb-connection-stringparameters wired tostress-apiservicefor testingFixes #13430
Checklist