From 9b299a410d610ead272559165ed59806d42f4021 Mon Sep 17 00:00:00 2001 From: Jo Palac Date: Mon, 7 Sep 2026 17:13:27 +1000 Subject: [PATCH] show the "add instance" screen if no instances are installed when running SCMU --- .../UI/NoInstances/NoInstancesView.xaml | 2 +- .../UI/Shell/ShellViewModel.cs | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/ServiceControl.Config/UI/NoInstances/NoInstancesView.xaml b/src/ServiceControl.Config/UI/NoInstances/NoInstancesView.xaml index 6721feccc1..fc08c41d67 100644 --- a/src/ServiceControl.Config/UI/NoInstances/NoInstancesView.xaml +++ b/src/ServiceControl.Config/UI/NoInstances/NoInstancesView.xaml @@ -12,6 +12,6 @@ VerticalAlignment="Center" FontSize="20" Foreground="{StaticResource Gray60Brush}" - Text="No service instances installed" /> + Text="Add an instance to get started" /> diff --git a/src/ServiceControl.Config/UI/Shell/ShellViewModel.cs b/src/ServiceControl.Config/UI/Shell/ShellViewModel.cs index 8e051a585d..658c3c7984 100644 --- a/src/ServiceControl.Config/UI/Shell/ShellViewModel.cs +++ b/src/ServiceControl.Config/UI/Shell/ShellViewModel.cs @@ -102,6 +102,21 @@ protected override async Task OnActivate(CancellationToken cancellationToken = d BeginCheckForUpdates(); } + protected override void OnViewLoaded(object view) + { + base.OnViewLoaded(view); + + // First run: nothing is installed yet, so open the "choose a setup scenario" + // popup immediately instead of leaving the user on the empty instance list. + // OnViewLoaded fires once, so alt-tabbing back or hitting refresh (both of + // which re-run RefreshInstances) won't re-trigger it, and dismissing the + // popup leaves the user on the NoInstances view. + if (!HasInstances) + { + ShowingMenuOverlay = true; + } + } + public async Task RefreshInstances(CancellationToken cancellationToken = default) { HasInstances = InstanceFinder.AllInstances().Any();