Files
Sharepoint-Toolbox/.planning/phases/06-global-site-selection/06-02-SUMMARY.md
Dev 95bf9c2eed docs(06-02): complete MainWindowViewModel global site selection plan
- Add 06-02-SUMMARY.md with execution results and dependency graph
- Update STATE.md: progress 20%, decision logged, session recorded
- Update ROADMAP.md: phase 6 in progress (1/5 plans complete)
- Mark SITE-01 requirement complete in REQUIREMENTS.md
2026-04-07 10:04:36 +02:00

4.2 KiB

phase, plan, subsystem, tags, requires, provides, affects, tech-stack, key-files, key-decisions, patterns-established, requirements-completed, duration, completed
phase plan subsystem tags requires provides affects tech-stack key-files key-decisions patterns-established requirements-completed duration completed
06-global-site-selection 02 ui
wpf
mvvm
observable-collection
weak-reference-messenger
community-toolkit
phase provides
06-global-site-selection/06-01 GlobalSitesChangedMessage class in Core/Messages
GlobalSelectedSites ObservableCollection on MainWindowViewModel
OpenGlobalSitePickerCommand (disabled when no profile)
GlobalSitesSelectedLabel computed property for toolbar
WeakReferenceMessenger broadcast on GlobalSelectedSites change
Clear on tenant switch and session clear
06-03 (toolbar XAML binds to these properties)
06-04 (FeatureViewModelBase registers for GlobalSitesChangedMessage)
added patterns
Func<Window>? factory property for dialog opening (keeps Window refs out of VMs)
CollectionChanged subscription to broadcast messenger message and update computed label
ObservableCollection clear in OnSelectedProfileChanged for tenant-scoped state
created modified
SharepointToolbox/ViewModels/MainWindowViewModel.cs
Used using SharepointToolbox.Views.Dialogs in ViewModel for SitePickerDialog cast — acceptable given existing Window reference pattern in this VM
GlobalSitesSelectedLabel uses hardcoded string; plan 06-03 will replace with localized keys
CollectionChanged event subscribes in constructor to trigger both label update and messenger broadcast atomically
OpenGlobalSitePickerDialog: same Func<Window>? factory pattern as OpenProfileManagementDialog
BroadcastGlobalSites(): single helper centralizes messenger send for GlobalSitesChangedMessage
SITE-01
8min 2026-04-07

Phase 06 Plan 02: MainWindowViewModel Global Site Selection Summary

ObservableCollection GlobalSelectedSites with dialog command, computed label, messenger broadcast, and clear-on-tenant-switch added to MainWindowViewModel

Performance

  • Duration: 8 min
  • Started: 2026-04-07T10:10:00Z
  • Completed: 2026-04-07T10:18:00Z
  • Tasks: 1
  • Files modified: 1

Accomplishments

  • Added GlobalSelectedSites and OpenGlobalSitePickerCommand to MainWindowViewModel — toolbar UI (06-03) can bind directly
  • WeakReferenceMessenger broadcasts GlobalSitesChangedMessage on every collection change — all tab VMs receive live updates
  • GlobalSelectedSites cleared on tenant switch and session clear, keeping site selection scoped to the current tenant

Task Commits

Each task was committed atomically:

  1. Task 1: Add global site selection state, command, and broadcast to MainWindowViewModel - a10f03e (feat)

Plan metadata: (docs commit to follow)

Files Created/Modified

  • SharepointToolbox/ViewModels/MainWindowViewModel.cs - Added OpenGlobalSitePickerDialog factory, GlobalSelectedSites, GlobalSitesSelectedLabel, OpenGlobalSitePickerCommand, ExecuteOpenGlobalSitePicker, BroadcastGlobalSites; clear on tenant switch and session clear

Decisions Made

  • Added using SharepointToolbox.Views.Dialogs; to MainWindowViewModel — acceptable because this VM already holds Func<Window>? factory properties that reference the View layer. The cast in ExecuteOpenGlobalSitePicker requires knowing the concrete dialog type.
  • GlobalSitesSelectedLabel uses a hardcoded English string for now; plan 06-03 will replace it with a localized key from Strings.resx once toolbar XAML is added.

Deviations from Plan

None - plan executed exactly as written.

(Note: GlobalSitesChangedMessage.cs was already present from plan 06-01 — no deviation needed.)

Issues Encountered

None.

User Setup Required

None - no external service configuration required.

Next Phase Readiness

  • MainWindowViewModel now exposes all properties and commands needed for the toolbar XAML (plan 06-03)
  • OpenGlobalSitePickerDialog factory property ready to be wired in MainWindow.xaml.cs (plan 06-03)
  • GlobalSitesChangedMessage broadcasting is live; FeatureViewModelBase can register for it (plan 06-04)

Phase: 06-global-site-selection Completed: 2026-04-07