feat(installer): add SystemCheckPage with blocking-error gating

Adds a new wizard page (positioned right after Welcome, FreshInstall only)
that auto-runs EnvironmentCheckService on entry and shows one row per check
with status icon, localized title/message, and hint+help-link on
failure/unknown. A "Recheck" button re-runs it, guarded against re-entrancy.

IInstallerPage gets a BlocksNavigation default member; WizardViewModel's
Next button now binds to CanGoNext, which the current page can veto (used
here while a check run is in flight or a blocking Error+Failed result is
present — Warnings and Unknown results never block). The summary line names
the blocking checks so a disabled Next is self-explanatory.

Wires up DI for the check pipeline (IProcessRunner, IPortOwnerResolver,
per-run ClaudeCliLookup) and adds the checks.* / installer.systemCheck.*
locale keys in en.json + de.json.

Visual appearance is NOT verified — needs a manual pass in the running
installer.
This commit is contained in:
mika kuns
2026-08-05 20:09:52 +02:00
parent 05be07b28c
commit 5cc1ec98c0
17 changed files with 717 additions and 3 deletions
@@ -0,0 +1,53 @@
using ClaudeDo.Installer.Core;
using ClaudeDo.Installer.Pages.InstallPage;
using ClaudeDo.Installer.Pages.PathsPage;
using ClaudeDo.Installer.Pages.ServicePage;
using ClaudeDo.Installer.Pages.SystemCheckPage;
using ClaudeDo.Installer.Pages.UiSettingsPage;
using ClaudeDo.Installer.Pages.WelcomePage;
using ClaudeDo.Installer.Views;
using Microsoft.Extensions.DependencyInjection;
namespace ClaudeDo.Installer.Tests;
public class WizardViewModelTests
{
private static IReadOnlyList<IInstallerPage> BuildAllPages(InstallContext context)
{
var emptyServiceProvider = new ServiceCollection().BuildServiceProvider();
return new IInstallerPage[]
{
new WelcomePageViewModel(context),
new SystemCheckPageViewModel(context, () => throw new InvalidOperationException("not needed for this test")),
new PathsPageViewModel(context),
new ServicePageViewModel(context),
new UiSettingsPageViewModel(context),
new InstallPageViewModel(context, emptyServiceProvider),
};
}
[Fact]
public void FreshInstall_includes_SystemCheckPage_directly_after_welcome()
{
var context = new InstallContext { Mode = InstallerMode.FreshInstall };
var resolver = new PageResolver(BuildAllPages(context));
var vm = new WizardViewModel(resolver, context, new FakeLocalizer());
var pages = vm.Pages.ToList();
var welcomeIndex = pages.FindIndex(p => p is WelcomePageViewModel);
var systemCheckIndex = pages.FindIndex(p => p is SystemCheckPageViewModel);
Assert.NotEqual(-1, welcomeIndex);
Assert.Equal(welcomeIndex + 1, systemCheckIndex);
}
[Fact]
public void Update_mode_does_not_show_SystemCheckPage()
{
var context = new InstallContext { Mode = InstallerMode.Update };
var resolver = new PageResolver(BuildAllPages(context));
var vm = new WizardViewModel(resolver, context, new FakeLocalizer());
Assert.DoesNotContain(vm.Pages, p => p is SystemCheckPageViewModel);
}
}