From 7e1b1177de6683318c326fa3d8bfc3cc18be0806 Mon Sep 17 00:00:00 2001 From: mika kuns Date: Thu, 6 Aug 2026 08:22:45 +0200 Subject: [PATCH] feat(installer): add Diagnose section to SettingsWindow Re-runs the environment checks against the installed configuration (worker.config.json + detected install dir) without blocking navigation and without auto-running on window open, only on a "Recheck" click. Extracted the check-row rendering and check-run logic (busy state, summary, Recheck command) out of SystemCheckPage into a shared Checks/CheckListViewModel + Checks/CheckListView, composed by both SystemCheckPage (wizard) and the new DiagnosePage (settings) instead of duplicating it. --- docs/open.md | 18 +-- src/ClaudeDo.Installer/App.xaml.cs | 5 + src/ClaudeDo.Installer/CLAUDE.md | 19 ++- .../Checks/CheckListView.xaml | 91 ++++++++++++ .../Checks/CheckListView.xaml.cs | 8 ++ .../Checks/CheckListViewModel.cs | 133 +++++++++++++++++ .../Pages/DiagnosePage/DiagnosePageView.xaml | 27 ++++ .../DiagnosePage/DiagnosePageView.xaml.cs | 8 ++ .../DiagnosePage/DiagnosePageViewModel.cs | 50 +++++++ .../SystemCheckPage/SystemCheckPageView.xaml | 76 +--------- .../SystemCheckPageViewModel.cs | 135 +++--------------- src/ClaudeDo.Localization/locales/de.json | 4 + src/ClaudeDo.Localization/locales/en.json | 4 + .../PageResolverTests.cs | 31 ++++ .../DiagnosePageViewModelTests.cs | 125 ++++++++++++++++ 15 files changed, 529 insertions(+), 205 deletions(-) create mode 100644 src/ClaudeDo.Installer/Checks/CheckListView.xaml create mode 100644 src/ClaudeDo.Installer/Checks/CheckListView.xaml.cs create mode 100644 src/ClaudeDo.Installer/Checks/CheckListViewModel.cs create mode 100644 src/ClaudeDo.Installer/Pages/DiagnosePage/DiagnosePageView.xaml create mode 100644 src/ClaudeDo.Installer/Pages/DiagnosePage/DiagnosePageView.xaml.cs create mode 100644 src/ClaudeDo.Installer/Pages/DiagnosePage/DiagnosePageViewModel.cs create mode 100644 tests/ClaudeDo.Installer.Tests/Pages/DiagnosePage/DiagnosePageViewModelTests.cs diff --git a/docs/open.md b/docs/open.md index 007b2ecd..7a6500b0 100644 --- a/docs/open.md +++ b/docs/open.md @@ -149,19 +149,21 @@ beider Branches, nicht aus `main` selbst. Details → `installer-preflight` in `docs/explore-notes/README.md` und den neuen Abschnitt „Environment Checks" in `src/ClaudeDo.Installer/CLAUDE.md`. -**Zusätzliche Lücke, unabhängig vom Merge:** die zwei Folge-Tasks „Claude Help Me"-Button -und Diagnose-Sektion (Config-Modus/`SettingsWindow`) sind **nicht implementiert** — beide -liefen ins selbe Merge-Problem und wurden ohne jede Code-Änderung als `Blocked` beendet. Die -folgenden Punkte, die diese zwei Features beträfen, können also noch nicht geprüft werden und -brauchen zuerst eine neue Umsetzungsrunde: +**Update (2026-08-06):** die Diagnose-Sektion (Config-Modus/`SettingsWindow`) ist implementiert +— `Pages/DiagnosePage/` + geteilte `Checks/CheckListViewModel.cs`/`Checks/CheckListView.xaml` +(auch von `SystemCheckPage` genutzt, keine zweite Implementierung). Unit-getestet +(`tests/ClaudeDo.Installer.Tests/Pages/DiagnosePage/DiagnosePageViewModelTests.cs`), **aber +nicht visuell verifiziert** — siehe Punkt unten. Der „Claude Help Me"-Button bleibt offen (sein +Footer-Slot ist in `CheckListView.xaml` reserviert): - [ ] „Claude Help Me" öffnet ein Terminal mit laufender Claude-Session, und die Session hat den Diagnose-Report tatsächlich gelesen — **nicht umsetzbar, Feature existiert nicht.** - [ ] Der Help-Me-Button ist korrekt deaktiviert, wenn `claude` nicht im PATH ist, mit verständlichem Tooltip — **nicht umsetzbar, Feature existiert nicht.** -- [ ] Diagnose-Sektion im Config-Modus zeigt die echten installierten Pfade/Ports, und der - laufende Worker auf 47821 gilt nicht als Konflikt — **nicht umsetzbar, Feature existiert - nicht.** +- [ ] Diagnose-Sektion im Config-Modus: Öffnen von SettingsWindow löst keinen Prüflauf aus, Klick + auf „Erneut prüfen" schon; zeigt die echten installierten Pfade/Ports (nicht die + InstallContext-Defaults), und der laufende Worker auf dem konfigurierten SignalR-Port gilt + nicht als Konflikt — **unit-verifiziert, visueller Durchlauf noch offen.** Sobald die beiden Branches oben gemerged sind, sind folgende Punkte real prüfbar (gebaut + unit-getestet gegen die Scratch-Integration, aber **nicht visuell verifiziert**): diff --git a/src/ClaudeDo.Installer/App.xaml.cs b/src/ClaudeDo.Installer/App.xaml.cs index ef35f7da..7251f103 100644 --- a/src/ClaudeDo.Installer/App.xaml.cs +++ b/src/ClaudeDo.Installer/App.xaml.cs @@ -11,6 +11,7 @@ using ClaudeDo.Installer.Core.Interfaces; using ClaudeDo.Installer.Localization; using ClaudeDo.Localization; using ClaudeDo.Releases; +using ClaudeDo.Installer.Pages.DiagnosePage; using ClaudeDo.Installer.Pages.InstallPage; using ClaudeDo.Installer.Pages.PathsPage; using ClaudeDo.Installer.Pages.ServicePage; @@ -153,6 +154,10 @@ public partial class App : Application sc.AddSingleton(); sc.AddSingleton(); sc.AddSingleton(); + sc.AddSingleton(sp => new DiagnosePageViewModel( + sp.GetRequiredService(), + sp.GetRequiredService>(), + InstallerWorkerConfig.Load)); // Steps — execution order matters for the FreshInstall pipeline (IEnumerable). // Double-registered as both IInstallStep and concrete type so the Update pipeline diff --git a/src/ClaudeDo.Installer/CLAUDE.md b/src/ClaudeDo.Installer/CLAUDE.md index 47a360e5..90de96da 100644 --- a/src/ClaudeDo.Installer/CLAUDE.md +++ b/src/ClaudeDo.Installer/CLAUDE.md @@ -161,6 +161,10 @@ regardless of severity (an indeterminate result — e.g. the CLI not found, so v can't be checked — must not strand the user; the underlying `Error`-severity check for the CLI itself, `ClaudeCliCheck`, is what blocks in that case). +The check-row rendering and the check-run logic (busy state, summary text, Recheck command) live +in one place — `Checks/CheckListViewModel.cs` + `Checks/CheckListView.xaml` — composed by every +page that hosts a check list, not duplicated per page. + `SystemCheckPage` (`Pages/SystemCheckPage/`) hosts the check list in the **FreshInstall** wizard only, registered via `PageResolver` at `Order = 1` (directly after `WelcomePage`); `WizardViewModel` filters it back out in `Update` mode along with Paths/Service/UiSettings. Checks run automatically @@ -169,8 +173,15 @@ on page entry (`LoadAsync`, guarded against double-entry). "Next" is disabled vi subscribes to `PropertyChanged` on the current page so a live recheck can flip it back. A "Recheck" button re-runs `EnvironmentCheckService.RunAllAsync` (disabled while already running). +`DiagnosePage` (`Pages/DiagnosePage/`) hosts the same `CheckListView` in `SettingsWindow` (Config +mode only, `ShowInSettings = true` / `ShowInWizard = false`, `Order = 5` — after UiSettings). +Nothing here blocks navigation and checks do **not** auto-run on load — only on a "Recheck" click. +Unlike the wizard, its `InstallContext` is built from the **installed** configuration +(`InstallerWorkerConfig.Load()` for `ClaudeBin`/`SignalRPort`, the shared `InstallContext` for +`InstallDirectory`/`ExternalMcpPort`), refreshed on every `LoadAsync()` — not the wizard-default +`InstallContext` the DI container hands out, which is only populated once a page's `ApplyAsync` +(i.e. Save) runs. + **Not implemented (see merge-status note above):** a "Claude Help Me" button that launches an -external terminal with a live `claude` session for setup troubleshooting, and a Diagnose section -in `SettingsWindow` (Config mode) that re-runs the same checks against the installed configuration. -Both were speced as follow-up tasks; both blocked before writing any code because their prerequisite -(this section) wasn't on `main` yet. +external terminal with a live `claude` session for setup troubleshooting. Its footer slot is +reserved in `CheckListView.xaml`; still blocked on the same follow-up as before. diff --git a/src/ClaudeDo.Installer/Checks/CheckListView.xaml b/src/ClaudeDo.Installer/Checks/CheckListView.xaml new file mode 100644 index 00000000..7d44db53 --- /dev/null +++ b/src/ClaudeDo.Installer/Checks/CheckListView.xaml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +