7.7 KiB
7.7 KiB
phase, plan, type, wave, depends_on, files_modified, autonomous, requirements, must_haves
| phase | plan | type | wave | depends_on | files_modified | autonomous | requirements | must_haves | |||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 12-branding-ui-views | 02 | execute | 2 |
|
|
true |
|
|
Purpose: Allows administrators to see the current MSP logo and manage it directly from the Settings tab.
Output: Updated SettingsView.xaml with a logo section that binds to existing ViewModel commands and properties.
<execution_context> @C:/Users/dev/.claude/get-shit-done/workflows/execute-plan.md @C:/Users/dev/.claude/get-shit-done/templates/summary.md </execution_context>
@.planning/PROJECT.md @.planning/ROADMAP.md @.planning/STATE.md @.planning/phases/12-branding-ui-views/12-RESEARCH.mdFrom SharepointToolbox/ViewModels/Tabs/SettingsViewModel.cs:
public string? MspLogoPreview { get; } // data URI string or null
public IAsyncRelayCommand BrowseMspLogoCommand { get; }
public IAsyncRelayCommand ClearMspLogoCommand { get; }
public string StatusMessage { get; set; } // inherited from FeatureViewModelBase
From SharepointToolbox/Views/Tabs/SettingsView.xaml:
<UserControl ...
xmlns:loc="clr-namespace:SharepointToolbox.Localization">
<StackPanel Margin="16">
<!-- Language section -->
<Label Content="{Binding Source=..., Path=[settings.language]}" />
<ComboBox ... />
<Separator Margin="0,12" />
<!-- Data folder section -->
<Label Content="{Binding Source=..., Path=[settings.folder]}" />
<DockPanel>
<Button DockPanel.Dock="Right" ... Command="{Binding BrowseFolderCommand}" />
<TextBox Text="{Binding DataFolder, ...}" />
</DockPanel>
</StackPanel>
</UserControl>
{StaticResource Base64ToImageConverter}— converts data URI string to BitmapImage (added in 12-01){StaticResource StringToVisibilityConverter}— returns Visible if string non-empty, else Collapsed
```xml
<Separator Margin="0,12" />
<!-- MSP Logo -->
<Label Content="{Binding Source={x:Static loc:TranslationSource.Instance}, Path=[settings.logo.title]}" />
<Border BorderBrush="#DDDDDD" BorderThickness="1" Padding="8" CornerRadius="4"
HorizontalAlignment="Left" MinWidth="200" MinHeight="60" Margin="0,4,0,0">
<Grid>
<Image Source="{Binding MspLogoPreview, Converter={StaticResource Base64ToImageConverter}}"
MaxHeight="80" MaxWidth="240" Stretch="Uniform" HorizontalAlignment="Left"
Visibility="{Binding MspLogoPreview, Converter={StaticResource StringToVisibilityConverter}}" />
<TextBlock Text="{Binding Source={x:Static loc:TranslationSource.Instance}, Path=[settings.logo.nopreview]}"
VerticalAlignment="Center" HorizontalAlignment="Center"
Foreground="#999999" FontStyle="Italic">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Visibility" Value="Visible" />
<Style.Triggers>
<DataTrigger Binding="{Binding MspLogoPreview, Converter={StaticResource StringToVisibilityConverter}}" Value="Visible">
<Setter Property="Visibility" Value="Collapsed" />
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
</Grid>
</Border>
<StackPanel Orientation="Horizontal" Margin="0,6,0,0">
<Button Content="{Binding Source={x:Static loc:TranslationSource.Instance}, Path=[settings.logo.browse]}"
Command="{Binding BrowseMspLogoCommand}" Width="80" Margin="0,0,8,0" />
<Button Content="{Binding Source={x:Static loc:TranslationSource.Instance}, Path=[settings.logo.clear]}"
Command="{Binding ClearMspLogoCommand}" Width="80" />
</StackPanel>
<TextBlock Text="{Binding StatusMessage}" Foreground="#CC0000" FontSize="11" Margin="0,4,0,0"
Visibility="{Binding StatusMessage, Converter={StaticResource StringToVisibilityConverter}}" />
```
Key decisions:
- Border with light gray outline creates a visual container for the logo preview
- Grid overlays Image and placeholder TextBlock — only one visible at a time
- DataTrigger hides placeholder when StringToVisibilityConverter returns Visible
- MaxHeight="80" and MaxWidth="240" keep the preview small but readable
- Stretch="Uniform" preserves aspect ratio
- StatusMessage in red only shows when non-empty (error feedback from import failures)
dotnet build --no-restore -warnaserror
SettingsView shows MSP logo section with live preview, Import/Clear buttons, and error message area. Build passes.
```bash
dotnet build --no-restore -warnaserror
```
Build must pass with zero failures. Visual verification requires manual testing.
<success_criteria>
- SettingsView.xaml has a visible MSP Logo section below the data folder
- Image binds to MspLogoPreview via Base64ToImageConverter
- Placeholder text shows when no logo is configured
- Import and Clear buttons bind to existing ViewModel commands
- StatusMessage displays in red when set
- Build passes with zero warnings </success_criteria>