From eeb9a3bcd1a945ad6d804ce447c8f4fe4efb8b19 Mon Sep 17 00:00:00 2001 From: Dev Date: Thu, 2 Apr 2026 11:44:54 +0200 Subject: [PATCH] fix(01-foundation): revise plans based on checker feedback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 01-03: wave 2 → wave 3 (depends on 01-02 which is also wave 2; must be wave 3) - 01-06: add ProgressUpdatedMessage.cs to files_modified; add third StatusBarItem (progress %) to XAML per locked CONTEXT.md decision; add ProgressUpdatedMessage subscription in MainWindowViewModel.OnActivated() - 01-08: add comment to empty element (auto task with no file output) Co-Authored-By: Claude Sonnet 4.6 --- .planning/phases/01-foundation/01-03-PLAN.md | 2 +- .planning/phases/01-foundation/01-06-PLAN.md | 37 +++++++++++++++++--- .planning/phases/01-foundation/01-08-PLAN.md | 2 +- 3 files changed, 35 insertions(+), 6 deletions(-) diff --git a/.planning/phases/01-foundation/01-03-PLAN.md b/.planning/phases/01-foundation/01-03-PLAN.md index 551f645..b5854d2 100644 --- a/.planning/phases/01-foundation/01-03-PLAN.md +++ b/.planning/phases/01-foundation/01-03-PLAN.md @@ -2,7 +2,7 @@ phase: 01-foundation plan: 03 type: execute -wave: 2 +wave: 3 depends_on: - 01-01 - 01-02 diff --git a/.planning/phases/01-foundation/01-06-PLAN.md b/.planning/phases/01-foundation/01-06-PLAN.md index 0bb47fc..44f68c6 100644 --- a/.planning/phases/01-foundation/01-06-PLAN.md +++ b/.planning/phases/01-foundation/01-06-PLAN.md @@ -8,6 +8,7 @@ depends_on: - 01-04 - 01-05 files_modified: + - SharepointToolbox/Core/Messages/ProgressUpdatedMessage.cs - SharepointToolbox/ViewModels/FeatureViewModelBase.cs - SharepointToolbox/ViewModels/MainWindowViewModel.cs - SharepointToolbox/ViewModels/ProfileManagementViewModel.cs @@ -53,6 +54,10 @@ must_haves: to: "SharepointToolbox/Core/Messages/TenantSwitchedMessage.cs" via: "WeakReferenceMessenger.Default.Send on ComboBox selection change" pattern: "TenantSwitchedMessage" + - from: "SharepointToolbox/ViewModels/MainWindowViewModel.cs" + to: "SharepointToolbox/Core/Messages/ProgressUpdatedMessage.cs" + via: "Messenger.Register in OnActivated — updates StatusBar observable properties" + pattern: "ProgressUpdatedMessage" --- @@ -113,6 +118,7 @@ public sealed class LanguageChangedMessage : ValueChangedMessage Task 1: FeatureViewModelBase + unit tests + SharepointToolbox/Core/Messages/ProgressUpdatedMessage.cs, SharepointToolbox/ViewModels/FeatureViewModelBase.cs, SharepointToolbox.Tests/ViewModels/FeatureViewModelBaseTests.cs @@ -248,6 +254,8 @@ public sealed class LanguageChangedMessage : ValueChangedMessage ```csharp [ObservableProperty] private TenantProfile? _selectedProfile; [ObservableProperty] private string _connectionStatus = "Not connected"; + [ObservableProperty] private string _progressStatus = string.Empty; + [ObservableProperty] private int _progressPercentage; public ObservableCollection TenantProfiles { get; } = new(); // ConnectCommand: calls SessionManager.GetOrCreateContextAsync(SelectedProfile) @@ -257,6 +265,22 @@ public sealed class LanguageChangedMessage : ValueChangedMessage // LoadProfilesAsync: called on startup, loads from ProfileService ``` + Override `OnActivated()` to register for `ProgressUpdatedMessage` from any active feature ViewModel: + ```csharp + protected override void OnActivated() + { + base.OnActivated(); + Messenger.Register(this, (r, m) => + { + r.ProgressStatus = m.Value.Message; + r.ProgressPercentage = m.Value.Total > 0 + ? (int)(100.0 * m.Value.Current / m.Value.Total) + : 0; + }); + } + ``` + This wires the StatusBar operation text and progress % to live updates from any running feature operation. + **ProfileManagementViewModel.cs**: Wraps ProfileService for dialog binding. - `ObservableCollection Profiles` - `AddCommand`, `RenameCommand`, `DeleteCommand` @@ -269,7 +293,8 @@ public sealed class LanguageChangedMessage : ValueChangedMessage - On language change: updates `TranslationSource.Instance.CurrentCulture` + calls `SettingsService.SetLanguageAsync` - `RunOperationAsync`: not applicable — stub throws `NotSupportedException` (Settings tab has no long-running operation) - **MainWindow.xaml** — Full shell layout as locked in CONTEXT.md: + **MainWindow.xaml** — Full shell layout as locked in CONTEXT.md. + StatusBar MUST have three fields per the locked decision (tenant name | operation status text | progress percentage): ```xml @@ -288,11 +313,13 @@ public sealed class LanguageChangedMessage : ValueChangedMessage Command="{Binding ClearSessionCommand}" /> - + + + @@ -370,7 +397,7 @@ public sealed class LanguageChangedMessage : ValueChangedMessage cd "C:\Users\dev\Documents\projets\Sharepoint" && dotnet build SharepointToolbox/SharepointToolbox.csproj 2>&1 | tail -5 - Build succeeds with 0 errors. MainWindow.xaml contains RichTextBox x:Name="LogPanel". All 8 tab headers use TranslationSource bindings. Global exception handlers registered in App.xaml.cs. + Build succeeds with 0 errors. MainWindow.xaml contains RichTextBox x:Name="LogPanel". StatusBar has three StatusBarItems (tenant name, connection status, progress %). All 8 tab headers use TranslationSource bindings. Global exception handlers registered in App.xaml.cs. @@ -379,13 +406,15 @@ public sealed class LanguageChangedMessage : ValueChangedMessage - `dotnet build SharepointToolbox.sln` passes with 0 errors - `dotnet test --filter "Category=Unit"` all pass - MainWindow.xaml contains `x:Name="LogPanel"` RichTextBox +- MainWindow.xaml StatusBar has three StatusBarItems: SelectedProfile.Name | ConnectionStatus | ProgressPercentage% - App.xaml.cs registers `DispatcherUnhandledException` and `TaskScheduler.UnobservedTaskException` - FeatureViewModelBase contains no `async void` methods (anti-pattern violation) - ObservableCollection is never modified from Task.Run (pattern 7 compliance) +- MainWindowViewModel.OnActivated() subscribes to ProgressUpdatedMessage and updates ProgressStatus + ProgressPercentage -Application compiles and launches to a visible WPF shell. FeatureViewModelBase tests green. All ViewModels registered in DI. Log panel wired to Serilog. +Application compiles and launches to a visible WPF shell. FeatureViewModelBase tests green. All ViewModels registered in DI. Log panel wired to Serilog. StatusBar shows all three fields including live progress percentage. diff --git a/.planning/phases/01-foundation/01-08-PLAN.md b/.planning/phases/01-foundation/01-08-PLAN.md index 1b48c26..9c35d96 100644 --- a/.planning/phases/01-foundation/01-08-PLAN.md +++ b/.planning/phases/01-foundation/01-08-PLAN.md @@ -62,7 +62,7 @@ Output: Confirmed working foundation. Green light for Phase 2. Task 1: Run full test suite and verify zero failures - + Run the complete test suite: ```