docs(13-02): complete User Directory ViewModel plan

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Dev
2026-04-08 16:08:59 +02:00
parent 4ba4de6106
commit df6f4949a8
140 changed files with 2862 additions and 74 deletions

View File

@@ -0,0 +1,54 @@
# Phase 12 Research: Branding UI Views
## What Exists (Phase 11 Deliverables)
### SettingsViewModel (already complete)
- `BrowseMspLogoCommand` (IAsyncRelayCommand) — opens file dialog, imports via IBrandingService, saves, updates preview
- `ClearMspLogoCommand` (IAsyncRelayCommand) — clears via IBrandingService, nulls preview
- `MspLogoPreview` (string?) — data URI format `data:{mime};base64,{b64}`, set on load and after browse/clear
- `StatusMessage` — inherited from FeatureViewModelBase, set on error
### ProfileManagementViewModel (already complete)
- `BrowseClientLogoCommand` — opens file dialog, imports, persists to profile
- `ClearClientLogoCommand` — nulls ClientLogo, persists
- `AutoPullClientLogoCommand` — fetches from Entra branding API, persists
- `ValidationMessage` — set on error or success feedback
- **GAP**: No `ClientLogoPreview` string property — SelectedProfile.ClientLogo is a LogoData object, NOT a data URI string. TenantProfile is not ObservableObject, so binding to SelectedProfile.ClientLogo won't notify UI on change.
### SettingsView.xaml (NO logo UI)
- Current: Language combo + Data folder text+browse — that's it
- Need: Add MSP logo section with Image preview, Browse, Clear buttons
### ProfileManagementDialog.xaml (NO logo UI)
- Current: Profile ListBox, Name/URL/ClientId fields, Add/Rename/Delete/Close buttons
- Window: 500x480, NoResize
- Need: Add client logo section with Image preview, Browse, Clear, Auto-Pull buttons; resize dialog
## Infrastructure Gaps
### No Image Converter
- `MspLogoPreview` is a data URI string — WPF `<Image Source=...>` does NOT natively bind to data URI strings
- Need `Base64ToImageSourceConverter` IValueConverter: parse data URI → decode base64 → create BitmapImage from byte stream
- Register in App.xaml as global resource
### Localization Keys Missing
- No keys for logo UI labels/buttons in Strings.resx / Strings.fr.resx
- Need: `settings.logo.msp`, `settings.logo.browse`, `settings.logo.clear`, `profile.logo.client`, `profile.logo.browse`, `profile.logo.clear`, `profile.logo.autopull`, `logo.nopreview`
## Available Patterns
### Converters
- Live in `SharepointToolbox/Views/Converters/` (IndentConverter.cs has multiple converters)
- Registered in App.xaml under `<Application.Resources>`
- `StringToVisibilityConverter` already exists — can show/hide preview based on non-null string
### XAML Layout
- SettingsView uses `<StackPanel>` with `<Separator>` between sections
- ProfileManagementDialog uses `<Grid>` with row definitions
- Buttons: `<Button Content="{Binding Source=...}" Command="{Binding ...}" Width="60" Margin="4,0" />`
## Plan Breakdown
1. **12-01**: Base64ToImageSourceConverter + localization keys + App.xaml registration + ClientLogoPreview ViewModel property
2. **12-02**: SettingsView.xaml MSP logo section
3. **12-03**: ProfileManagementDialog.xaml client logo section + dialog resize