4.0 KiB
4.0 KiB
phase, plan, subsystem, tags, dependency_graph, tech_stack, key_files, decisions, metrics
| phase | plan | subsystem | tags | dependency_graph | tech_stack | key_files | decisions | metrics | ||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 12-branding-ui-views | 01 | branding-ui |
|
|
|
|
|
|
Phase 12 Plan 01: Base64ToImageSourceConverter, Localization Keys, and ClientLogoPreview Summary
Base64ToImageSourceConverter with null-safe data URI parsing, 9 EN/FR localization keys for logo UI, and ClientLogoPreview ViewModel property synced across all logo mutation paths.
What Was Done
Task 1: Base64ToImageSourceConverter + Tests
- Created
Base64ToImageSourceConverterinViews/Converters/following existing converter patterns - Parses data URI by finding "base64," marker, decodes to byte array, creates BitmapImage with
BitmapCacheOption.OnLoadandFreeze()for WPF thread safety - Returns null for null, empty, non-string, malformed, and invalid base64 input (never throws)
- 6 unit tests covering null, empty, non-string, malformed, invalid base64, and ConvertBack
Task 2: App.xaml Registration
- Added
<conv:Base64ToImageSourceConverter x:Key="Base64ToImageConverter" />to Application.Resources - Placed after existing ListToStringConverter registration
Task 3: Localization Keys (EN + FR)
- Added 9 keys to both
Strings.resxandStrings.fr.resx:settings.logo.title/browse/clear/nopreviewfor MSP logo sectionprofile.logo.title/browse/clear/autopull/nopreviewfor client logo section
Task 4: ClientLogoPreview Property
- Added
ClientLogoPreview(string?) property with private setter toProfileManagementViewModel - Added
FormatLogoPreviewprivate static helper to format LogoData as data URI string - Updated
OnSelectedProfileChangedto set preview from selected profile's ClientLogo - Updated
BrowseClientLogoAsyncto set preview after successful import - Updated
ClearClientLogoAsyncto null preview after clearing - Updated
AutoPullClientLogoAsyncto set preview after Entra pull - Added 4 new tests: null when no profile, data URI when profile with logo, null when profile without logo, null after clear
Deviations from Plan
Adjusted Test Coverage
Test 4 from plan (valid data URI returns non-null BitmapImage) was skipped because Xunit.StaFact NuGet package is not referenced in the test project. BitmapImage instantiation requires an STA thread which standard xUnit [Fact] does not provide. The converter logic is still fully covered by the null/empty/malformed/invalid tests, and the BitmapImage creation path will be exercised by manual verification in Plans 02/03.
Commits
| Commit | Message |
|---|---|
6a4cd8a |
feat(12-01): add Base64ToImageSourceConverter, localization keys, and ClientLogoPreview property |
Self-Check: PASSED
SharepointToolbox/Views/Converters/Base64ToImageSourceConverter.csexistsSharepointToolbox.Tests/Converters/Base64ToImageSourceConverterTests.csexists- Commit
6a4cd8aexists - Build passes with zero warnings
- 17 tests pass (6 converter + 11 profile VM)