Skip to content

Dashboard: Parameters page follow-ups - clickable set value, warning badge, filter by resource#16117

Open
adamint wants to merge 4 commits intomicrosoft:mainfrom
adamint:dev/adamint/parameters-tab-improvements
Open

Dashboard: Parameters page follow-ups - clickable set value, warning badge, filter by resource#16117
adamint wants to merge 4 commits intomicrosoft:mainfrom
adamint:dev/adamint/parameters-tab-improvements

Conversation

@adamint
Copy link
Copy Markdown
Member

@adamint adamint commented Apr 13, 2026

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

  • Unresolved parameters show "Value not set" as a clickable button (styled as inline link) that triggers the SetParameterCommand dialog
  • Uses a native <button> for proper keyboard accessibility (Enter and Space activation)
  • Uses @onclick:stopPropagation to prevent opening the resource details view

Feature 2: Filter parameters by resource ("View parameters")

  • "View parameters (N)" menu item on resources that have parameter relationships, showing the count
  • Available in both the Actions column menu and right-click context menu
  • Clicking instantly switches to the Parameters tab filtered to only that resource's parameters
  • Uses direct in-page state change for instant tab switching
  • Filter indicator button in the toolbar showing the resource name with a dismiss (×) icon
  • Reuses the existing resource query parameter for deep-linking when combined with view=Parameters
  • Resource type filter section hidden on Parameters tab (irrelevant since all entries are type "Parameter")

Graph improvements

  • Parameter nodes no longer show "No endpoints" text
  • Icon centered vertically in the circle bubble when no endpoint text is present
  • Fixed trimText null crash when endpoint text is null

Other improvements

  • autocomplete="off" on text input in parameter dialog to prevent browser autofill suggestions
  • Stress AppHost: Added api-key and db-connection-string parameters wired to stress-apiservice for testing

Fixes #13430

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
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
    • No
  • Does the change require an update in our Aspire docs?
    • Yes
    • No

…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
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 13, 2026

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 16117

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 16117"

@adamint adamint marked this pull request as ready for review April 13, 2026 15:35
@adamint adamint requested a review from JamesNK as a code owner April 13, 2026 15:35
Copilot AI review requested due to automatic review settings April 13, 2026 15:35
Copy link
Copy Markdown
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 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

Comment thread src/Aspire.Dashboard/Components/Pages/Resources.razor Outdated
Comment thread src/Aspire.Dashboard/Components/Pages/Resources.razor.cs
Comment thread src/Aspire.Dashboard/Components/Pages/Resources.razor.cs
@@ -0,0 +1,254 @@
---
name: dashboard-e2e-testing
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.

Move this to a different PR

Comment on lines +214 to +228
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>
}
Copy link
Copy Markdown
Member

@JamesNK JamesNK Apr 14, 2026

Choose a reason for hiding this comment

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

This should also display in the property grid:

Image

There is functionality for displaying custom content in this grid. Might want to have a control that can be used in both places

Comment on lines +171 to +190
// 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;
}
});
}
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'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))
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.

There should be a known command name type with "parameter-set" on it. Also I think there is a command name comparison.

Comment on lines +822 to +842
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);
}
}
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 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; }
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.

remove

public string GetUrlFromSerializableViewModel(ResourcesPageState serializable)
{
return DashboardUrls.ResourcesUrl(
resource: serializable.Resource,
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.

remove

ResourceStatesToVisibility = PageViewModel.ResourceStatesToVisibility,
ResourceHealthStatusesToVisibility = PageViewModel.ResourceHealthStatusesToVisibility
ResourceHealthStatusesToVisibility = PageViewModel.ResourceHealthStatusesToVisibility,
Resource = PageViewModel.SelectedViewKind == ResourceViewKind.Parameters ? ResourceName : null
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.

remove

Comment on lines +217 to +222
<button type="button"
class="value-not-set-link"
@onclick="@(() => ExecuteResourceCommandAsync(context.Resource, setCommand))"
title="@ControlsStringsLoc[nameof(ControlsStrings.ParameterSetValueAction)]">
@ControlsStringsLoc[nameof(ControlsStrings.ParameterValueNotSet)]
</button>
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.

setCommand could be disabled. disabled on button if the command is disabled.

Copy link
Copy Markdown
Member

@JamesNK JamesNK left a comment

Choose a reason for hiding this comment

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

2 comments on the GetSetParameterCommand method.

}
}
return null;
}
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.

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))
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.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Follow up on parameters page

3 participants