Skip to content

Fix FluentSelect/FluentCombobox value binding when options change#16315

Merged
JamesNK merged 5 commits intomainfrom
fix/fluent-select-options-binding
Apr 20, 2026
Merged

Fix FluentSelect/FluentCombobox value binding when options change#16315
JamesNK merged 5 commits intomainfrom
fix/fluent-select-options-binding

Conversation

@JamesNK
Copy link
Copy Markdown
Member

@JamesNK JamesNK commented Apr 20, 2026

Description

Fix an issue where FluentSelect and FluentCombobox inputs in InteractionsInputDialog sometimes lose their bound value when the list of options and value change at the same time. The underlying web component can emit an internal change event during an options rebuild, clearing the bound value before the new one takes effect.

Changes:

  1. InputViewModel.ChoiceVersion — Added a counter that increments only when SelectOptions actually change. Used as a @key on FluentSelect and FluentCombobox in the dialog so Blazor destroys and recreates the component when options change, initializing it fresh with the correct options and value together. Skips increment when the new options match the existing ones.

  2. Azure provisioning API call cachingRunModeProvisioningContextProvider dynamic loading callbacks now cache results using ConcurrentDictionary<string, Task<T>> (keyed by tenant/subscription ID) to avoid redundant Azure API calls. The biggest win is the Location callback, which previously re-fetched resource groups and locations on every resource group change.

  3. Stress playground — Added an "Azure provisioning simulation" command to the Stress AppHost that exercises the full cascading dynamic inputs pattern (Tenant → Subscription → ResourceGroup → Location) with pretend data, for manual testing of the interaction dialog.

Fixes https://youtu.be/0s64lPsr6oM?t=13143

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
      • 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?

- Add ChoiceVersion counter to InputViewModel, incremented only when
  options actually differ, used as @key on FluentSelect and FluentCombobox
  to force component recreation and avoid the web component clearing the
  bound value during an options refresh.
- Cache Azure API calls in RunModeProvisioningContextProvider dynamic
  loading callbacks using ConcurrentDictionary to avoid redundant fetches.
- Add Azure provisioning simulation command to Stress playground.
Copilot AI review requested due to automatic review settings April 20, 2026 00:55
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 20, 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 -- 16315

Or

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

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

Fixes flaky value binding for choice inputs in the Dashboard interaction dialog when options/value change simultaneously, and reduces repeated Azure ARM lookups during run-mode provisioning prompts. Adds a stress-playground command to manually exercise cascading dynamic inputs.

Changes:

  • Add InputViewModel.ChoiceVersion and use it to force re-creation of choice components when options change.
  • Cache ARM-backed dynamic-loading callbacks in RunModeProvisioningContextProvider to avoid redundant API calls.
  • Add a stress playground command that simulates the Azure provisioning cascading input flow.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
tests/Aspire.Dashboard.Components.Tests/Model/InputViewModelTests.cs Adds unit tests covering ChoiceVersion increment behavior.
src/Aspire.Hosting.Azure/Provisioning/Internal/RunModeProvisioningContextProvider.cs Adds per-tenant/subscription caches for dynamic-loading callbacks.
src/Aspire.Dashboard/Model/Interaction/InputViewModel.cs Introduces ChoiceVersion and option equality logic to control re-creation.
src/Aspire.Dashboard/Components/Dialogs/InteractionsInputDialog.razor.cs Minor whitespace cleanup.
src/Aspire.Dashboard/Components/Dialogs/InteractionsInputDialog.razor Adds @key to choice components to recreate on option changes.
playground/Stress/Stress.AppHost/InteractionCommands.cs Adds “azure-provisioning-simulation” command and reformats existing code.

Comment thread src/Aspire.Dashboard/Model/Interaction/InputViewModel.cs Outdated
Comment thread src/Aspire.Dashboard/Model/Interaction/InputViewModel.cs Outdated
Comment thread tests/Aspire.Dashboard.Tests/Model/InputViewModelTests.cs
Comment thread playground/Stress/Stress.AppHost/InteractionCommands.cs Outdated
Comment thread playground/Stress/Stress.AppHost/InteractionCommands.cs
Comment thread src/Aspire.Dashboard/Components/Dialogs/InteractionsInputDialog.razor Outdated
@github-actions
Copy link
Copy Markdown
Contributor

🎬 CLI E2E Test Recordings — 72 recordings uploaded (commit 621e4f3)

View recordings
Test Recording
AddPackageInteractiveWhileAppHostRunningDetached ▶️ View Recording
AddPackageWhileAppHostRunningDetached ▶️ View Recording
AgentCommands_AllHelpOutputs_AreCorrect ▶️ View Recording
AgentInitCommand_DefaultSelection_InstallsSkillOnly ▶️ View Recording
AgentInitCommand_MigratesDeprecatedConfig ▶️ View Recording
AspireAddPackageVersionToDirectoryPackagesProps ▶️ View Recording
AspireUpdateRemovesAppHostPackageVersionFromDirectoryPackagesProps ▶️ View Recording
Banner_DisplayedOnFirstRun ▶️ View Recording
Banner_DisplayedWithExplicitFlag ▶️ View Recording
Banner_NotDisplayedWithNoLogoFlag ▶️ View Recording
CertificatesClean_RemovesCertificates ▶️ View Recording
CertificatesTrust_WithNoCert_CreatesAndTrustsCertificate ▶️ View Recording
CertificatesTrust_WithUntrustedCert_TrustsCertificate ▶️ View Recording
ConfigSetGet_CreatesNestedJsonFormat ▶️ View Recording
CreateAndRunAspireStarterProject ▶️ View Recording
CreateAndRunAspireStarterProjectWithBundle ▶️ View Recording
CreateAndRunEmptyAppHostProject ▶️ View Recording
CreateAndRunJavaEmptyAppHostProject ▶️ View Recording
CreateAndRunJsReactProject ▶️ View Recording
CreateAndRunPythonReactProject ▶️ View Recording
CreateAndRunTypeScriptEmptyAppHostProject ▶️ View Recording
CreateAndRunTypeScriptStarterProject ▶️ View Recording
CreateJavaAppHostWithViteApp ▶️ View Recording
CreateTypeScriptAppHostWithViteApp ▶️ View Recording
DashboardRunWithOtelTracesReturnsNoTraces ▶️ View Recording
DeployK8sBasicApiService ▶️ View Recording
DeployK8sWithGarnet ▶️ View Recording
DeployK8sWithMongoDB ▶️ View Recording
DeployK8sWithMySql ▶️ View Recording
DeployK8sWithPostgres ▶️ View Recording
DeployK8sWithRabbitMQ ▶️ View Recording
DeployK8sWithRedis ▶️ View Recording
DeployK8sWithSqlServer ▶️ View Recording
DeployK8sWithValkey ▶️ View Recording
DeployTypeScriptAppToKubernetes ▶️ View Recording
DescribeCommandResolvesReplicaNames ▶️ View Recording
DescribeCommandShowsRunningResources ▶️ View Recording
DetachFormatJsonProducesValidJson ▶️ View Recording
DetachFormatJsonProducesValidJsonWhenRestartingExistingInstance ▶️ View Recording
DoListStepsShowsPipelineSteps ▶️ View Recording
DoctorCommand_DetectsDeprecatedAgentConfig ▶️ View Recording
DoctorCommand_WithSslCertDir_ShowsTrusted ▶️ View Recording
DoctorCommand_WithoutSslCertDir_ShowsPartiallyTrusted ▶️ View Recording
GlobalMigration_HandlesCommentsAndTrailingCommas ▶️ View Recording
GlobalMigration_HandlesMalformedLegacyJson ▶️ View Recording
GlobalMigration_PreservesAllValueTypes ▶️ View Recording
GlobalMigration_SkipsWhenNewConfigExists ▶️ View Recording
GlobalSettings_MigratedFromLegacyFormat ▶️ View Recording
InitTypeScriptAppHost_AugmentsExistingViteRepoAtRoot ▶️ View Recording
InvalidAppHostPathWithComments_IsHealedOnRun ▶️ View Recording
LegacySettingsMigration_AdjustsRelativeAppHostPath ▶️ View Recording
LogsCommandShowsResourceLogs ▶️ View Recording
OtelLogsReturnsStructuredLogsFromStarterApp ▶️ View Recording
PsCommandListsRunningAppHost ▶️ View Recording
PsFormatJsonOutputsOnlyJsonToStdout ▶️ View Recording
PublishWithConfigureEnvFileUpdatesEnvOutput ▶️ View Recording
PublishWithDockerComposeServiceCallbackSucceeds ▶️ View Recording
PublishWithoutOutputPathUsesAppHostDirectoryDefault ▶️ View Recording
RestoreGeneratesSdkFiles ▶️ View Recording
RestoreRefreshesGeneratedSdkAfterAddingIntegration ▶️ View Recording
RestoreSupportsConfigOnlyHelperPackageAndCrossPackageTypes ▶️ View Recording
RunFromParentDirectory_UsesExistingConfigNearAppHost ▶️ View Recording
SecretCrudOnDotNetAppHost ▶️ View Recording
SecretCrudOnTypeScriptAppHost ▶️ View Recording
StagingChannel_ConfigureAndVerifySettings_ThenSwitchChannels ▶️ View Recording
StartAndWaitForTypeScriptSqlServerAppHostWithNativeAssets ▶️ View Recording
StopAllAppHostsFromAppHostDirectory ▶️ View Recording
StopAllAppHostsFromUnrelatedDirectory ▶️ View Recording
StopNonInteractiveMultipleAppHostsShowsError ▶️ View Recording
StopNonInteractiveSingleAppHost ▶️ View Recording
StopWithNoRunningAppHostExitsSuccessfully ▶️ View Recording
UnAwaitedChainsCompileWithAutoResolvePromises ▶️ View Recording

📹 Recordings uploaded automatically from CI run #24644281093

@JamesNK JamesNK merged commit b60bcea into main Apr 20, 2026
284 checks passed
@github-actions github-actions Bot added this to the 13.3 milestone Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants