Version: 1.0.0
Date: 2026-05-21
Status: ✅ Implementation complete — validation tasks remaining
Governed by: .specify/memory/constitution-v2.md (to be created in Phase 0)
Project: Som3a Add-in 2026 - UI Foundation & Theme Engine
Platform: Excel VSTO Add-in (.NET Framework 4.8, WPF)
Transform the current Excel VSTO Add-in into a Windows 11 Fluent Enterprise Platform optimized for:
- Excel VSTO hosting
- Long-running enterprise workflows
- Modular future expansion
- Runtime theming
- Unified navigation
- Stability-first rendering
- Enterprise-grade UX consistency
Priority: Stability → Performance → Visual Polish
| Area | Decision |
|---|---|
| Platform | Excel VSTO only |
| Framework | .NET Framework 4.8 |
| UI Direction | Windows 11 Native Feeling |
| Architecture | Full MVVM + Modular |
| Theme System | Full Token-Based Design System |
| Navigation | Unified Shell Architecture (new windows only) |
| Future Readiness | Plugin-ready |
| Settings Storage | Local only |
| Accessibility | Keyboard navigation + screen reader preparation |
| Localization | Architecture-ready for future localization |
| Rendering Strategy | Hybrid Excel-safe rendering |
| Governance | Mandatory review after every phase |
| Git Strategy | One branch per phase |
| QA Strategy | GitHub + CodeRabbit mandatory review gates |
main
↑
develop
↑
feature/phase-NN-name
NO direct merge to main
feature branch
↓
GitHub PR
↓
CodeRabbit Review
↓
Manual Review
↓
develop
↓
integration validation
↓
main
feature/phase-00-governance-foundation
feature/phase-01-design-system-core
feature/phase-02-rendering-infrastructure
feature/phase-03-theme-engine-v2
feature/phase-04-control-standardization
feature/phase-05-navigation-shell
feature/phase-06-mvvm-cleanup
feature/phase-07-settings-ux
feature/phase-08-diagnostics
feature/phase-09-plugin-platform
feature/phase-10-enterprise-polish
feature/phase-11-legacy-migration
Before ANY phase implementation begins, AI agents MUST review:
- All existing Theme files
- Current WPF architecture
- Existing Design Tokens
- Current ThemeManager implementation
- Current Popup/Shadow implementation
- ResourceDictionary loading order
- Existing Spec Kit structure
- Existing OpenCode plans
- Existing architecture constitution
- Detect reusable components before creating new ones
Status: Phase 0 pre-review COMPLETED on 2026-05-21.
| Finding | Impact | Phase Addressed |
|---|---|---|
| Constitution has active Git merge conflicts | BLOCKING | P0-T000 |
| Inline colors in ButtonStyles, DataGridStyles, MainWindow | Violation | P1-T006 |
| Hardcoded radius in ComboBoxStyles | Violation | P1-T006 |
| Significant existing implementation overlap | Reuse opportunity | P0, P1, P2 |
| ModernWindow, ThemeManager, WindowRenderModeDetector functional | Extend, don't replace | P2 |
| All 3 themes (Dark/Light/Custom) exist | Refactor tokens | P1 |
| SettingsWindow has theme cards and accent swatches | Extend UX | P7 |
| Missing Elevation, Motion, ZIndex, Opacity tokens | Gap-fill | P1 |
| No Docs/Architecture/ folder | Create | P0 |
| No DI container, event bus, module registry | Create | P6 |
- Inspect current implementation
- Reuse existing structures
- Extend existing systems
- Avoid duplicate architecture
- Inline colors
- Inline shadows
- Inline margins
- Inline font sizes
- Direct control styling
- Duplicate styles
- Hardcoded spacing
- Business logic in code-behind
- Direct service creation in views
- DynamicResource for themeable properties
- Semantic tokens
- MVVM separation
- Centralized effects (Effects/*.xaml)
- Excel-safe rendering
- Accessibility-ready controls
- Review before merge
A phase CANNOT continue unless:
| Requirement | Mandatory |
|---|---|
| Build passes | YES |
| Excel host test passes | YES |
| PR approved | YES |
| CodeRabbit clean | YES |
| Architecture review passed | YES |
| No rendering regressions | YES |
| No popup regressions | YES |
| No theme regressions | YES |
Each phase MUST STOP after completion. Then:
- Excel host testing
- DPI testing (100%, 125%, 150%)
- Popup testing
- Rendering testing
- Architecture review
- Style review
- Performance review
- Code smells
- Performance issues
- MVVM violations
- Memory issues
- Resource leaks
- Duplicate logic
- Inline values
- Token usage consistency
- Naming consistency
- DynamicResource usage
- No inline colors
- No inline shadows
- No duplicate styles
Establish all architectural governance before implementation begins. Resolve blocking issues.
feature/phase-00-governance-foundation
Priority: Critical
File: .specify/memory/constitution.md
The constitution has active Git merge conflicts (<<<<<<< HEAD, =======, >>>>>>>) across ~30 lines. No governance document can reference a conflicted constitution.
Steps:
- Identify conflicting sections (duplicated principle blocks with merge markers)
- Reconcile into single coherent constitution v1.2.0
- Remove duplicate principle blocks
- Preserve all 16 principles (I–XVI) in final order
- Update version header:
1.2.0 | Ratified: 2026-05-21 - Verify no merge markers remain
Acceptance Criteria:
grep -c "<<<<<<<" .specify/memory/constitution.mdreturns 0- All 16 principles present exactly once
- Version line reads
1.2.0
Priority: High
Deliverable: Docs/Architecture/AUDIT_REPORT.md
Scope:
- Map all existing theme files against Master Plan architecture
- Identify inline colors, inline shadows, hardcoded spacing, hardcoded radius
- Catalog DynamicResource vs StaticResource usage
- Identify duplicate or missing tokens
Key findings from pre-review:
| Violation | Location |
|---|---|
Inline color #2FFFFFFF |
ButtonStyles.xaml BaseButton Background |
Inline color #3FFFFFFF |
ButtonStyles.xaml hover Background |
Inline color #22FFFFFF |
ButtonStyles.xaml pressed Background |
Inline color #0AFFFFFF |
DataGridStyles.xaml AlternatingRowBackground |
Inline color #15FFFFFF |
DataGridStyles.xaml row hover |
Inline color #333A86FF |
DataGridStyles.xaml row selected |
Inline color #22000000 |
MainWindow.xaml progress background |
Hardcoded CornerRadius="10" |
ComboBoxStyles.xaml |
| Hardcoded margins/sizes | ModernWindow.xaml, MainWindow.xaml |
Priority: High
Deliverable: Service audit report in AUDIT_REPORT.md
Findings:
ThemeManager.csalready has singleton, debounce timer, accent application, persistence, eventsThemeSettings.csis a stub (no serialization implemented)WindowRenderModeDetector.cshas VSTO detection, DPI detection, render test- All three services are functional and align with architecture goals
Gaps:
- No accent variant generation (hover, pressed, glow, border, subtle)
- No runtime validation of resource integrity
- No fallback recovery beyond try/catch
Priority: High
Deliverable: Popup audit report in AUDIT_REPORT.md
Findings:
ComboBoxStyles.xamlusesAllowsTransparency="False"(compliant)- Uses
Placement="Bottom"(compliant) PlacementTargetbound correctly (compliant)- Uses centralized
Effect="{DynamicResource Shadow.Popup}"(compliant)
Gaps:
ComboBoxItemStyles.xamlneeds full review for inline issues- No popup diagnostics or clipping detection
Priority: High
Deliverable: Effects audit report in AUDIT_REPORT.md
Findings:
Shadows.xamlhas 7 centralized DropShadowEffect definitions (compliant)Glow.xamlhas 6 glow effects usingAccentColorValue(compliant)- No inline DropShadowEffect in reviewed files (compliant)
Gaps:
- No
Elevation.xaml(elevation tokens per Master Plan) - No safe-mode shadow variants for FallbackSafe rendering
Priority: High
File: .specify/memory/constitution-v2.md
Content:
- Import reconciled v1.2.0 as baseline
- Add new sections from Master Plan:
- AI Execution Rules (reuse-first mandate)
- Branch Naming Standards
- Token Naming Standards (formalize
Primitive.*,Brush.*,Spacing.*,Radius.*,Elevation.*,Motion.*,Component.*) - Review Gate Requirements (build, Excel host, PR, CodeRabbit, architecture)
- Phase 11: Legacy Window Migration
Priority: High
| File | Purpose |
|---|---|
Docs/Architecture/AGENT_RULES.md |
AI execution rules: inspect before creating, reuse before duplicating |
Docs/Architecture/UI_GUIDELINES.md |
Windows 11 Fluent design rules, token usage, DynamicResource mandate |
Docs/Architecture/PERFORMANCE_RULES.md |
≤200ms animations, virtualization, no nested shadows, no BlurEffect on scrollables |
Docs/Architecture/TOKEN_RULES.md |
Naming conventions, layer rules, primitive vs semantic vs component |
Docs/Architecture/SHADOW_SYSTEM.md |
Centralized effects, no inline, glow dynamic behavior |
Docs/Architecture/POPUP_ARCHITECTURE.md |
AllowsTransparency rules, Placement rules, Excel-safe popup guidelines |
Docs/Architecture/EXCEL_RENDERING_RULES.md |
Safe mode detection, fallback behavior, DPI handling |
Docs/Architecture/MVVM_RULES.md |
Service/ViewModel separation, no code-behind business logic |
Docs/Architecture/ACCESSIBILITY_RULES.md |
Keyboard nav, focus visibility, screen reader prep |
Docs/Architecture/REVIEW_CHECKLIST.md |
Mandatory gates per phase (local test, GitHub PR, CodeRabbit, architecture review) |
Note: Markdown versions created now. Word/PDF conversion requires Pandoc or manual conversion after stabilization.
Priority: High
File: Docs/Architecture/REVIEW_CHECKLIST.md
Mandatory gates per phase:
- Local Manual Testing (Excel host, DPI, popup, rendering)
- GitHub PR Review (architecture, style, performance)
- CodeRabbit Review (smells, performance, MVVM, memory, leaks, duplicates)
- Manual Architectural Review (tokens, DynamicResource, no inline colors/shadows)
Priority: High
File: Included in Docs/Architecture/AGENT_RULES.md
Key rules:
- Before creating ANY new token/control/dictionary: inspect current implementation
- Reuse existing structures; extend existing systems
- Avoid duplicate architecture
- No inline colors, inline shadows, inline margins, inline font sizes
- MUST use DynamicResource, semantic tokens, centralized effects, shared control templates
Priority: High
File: Included in Docs/Architecture/TOKEN_RULES.md
Layers:
Primitive Tokens → Primitive.<Color>.<Shade> (e.g., Primitive.Blue.500)
Semantic Tokens → Brush.<Category>.<State> (e.g., Brush.Background.Primary)
Spacing Tokens → Spacing.<Name> (e.g., Spacing.Medium)
Radius Tokens → Radius.<Size> (e.g., Radius.Medium)
Elevation Tokens → Elevation.<Level> (e.g., Elevation.Card)
Motion Tokens → Motion.<Type>.<Property> (e.g., Motion.Fade.Duration)
Component Tokens → Component.<Control>.<Part>.<State>
Priority: High
File: Included in Docs/Architecture/AGENT_RULES.md
Pattern: feature/phase-<NN>-<short-name>
Examples:
feature/phase-00-governance-foundationfeature/phase-01-design-system-corefeature/phase-02-rendering-infrastructure
Priority: Medium
File: AGENTS.md
Update with:
- Phase 0–2 file paths
- Build command (
msbuild WpfApp2\Som3a_WPF_UI.csproj /p:Configuration=Debug) - Spec Kit references
- Constitution v2 reference
- Constitution merge conflicts resolved (P0-T000)
- Audit report created (P0-T001 through P0-T004)
- Constitution v2 created (P0-T005)
- All governance documents created (P0-T006)
- Review checklist created (P0-T007)
- AI execution rules documented (P0-T008)
- Token naming standards documented (P0-T009)
- Branch naming standards documented (P0-T010)
- AGENTS.md updated (P0-T011)
- GitHub PR created and approved
- CodeRabbit review clean
- Manual architecture review passed
Convert current styling into enterprise token architecture. Fix all inline violations found in P0-T001.
feature/phase-01-design-system-core
Primitive Tokens
↓
Semantic Tokens
↓
Component Tokens
↓
Control Templates
Priority: High
Deliverable: Token inventory in AUDIT_REPORT.md
Scope:
Theme/Base/Colors.xaml(primitive + semantic)Theme/Base/Typography.xamlTheme/Base/Spacing.xamlTheme/Base/Radius.xaml
Inventory includes:
- Current key names
- Type (primitive/semantic/legacy-flat)
- Used by which control styles
- Missing semantic equivalents for legacy flat keys
Priority: High
Deliverable: Deduplication report
Method:
- Regex search all
.xamlfor duplicate color hex values - Identify semantic tokens that resolve to same color but have different names
- Identify legacy flat keys that shadow semantic tokens
Key duplicates found in pre-review:
#0E1720appears in Colors.xaml, DarkColors.xaml, CustomColors.xaml, MainWindow.xaml#33FFFFFFappears in multiple stroke/fill tokens
Priority: High
File: Theme/Base/Colors.xaml — refactor primitive section
Strategy: Add new Primitive.* Color resources. Alias existing flat keys (Blue500, Slate900) to them. No breaking changes.
<!-- New primitives -->
<Color x:Key="Primitive.Blue.500">#3A86FF</Color>
<Color x:Key="Primitive.Slate.900">#0E1720</Color>
<Color x:Key="Primitive.Slate.800">#1C2B3A</Color>
<Color x:Key="Primitive.Slate.700">#15202B</Color>
<Color x:Key="Primitive.White.95">#F2FFFFFF</Color>
<Color x:Key="Primitive.White.75">#BFFFFFFF</Color>
<Color x:Key="Primitive.White.40">#66FFFFFF</Color>
<Color x:Key="Primitive.White.20">#33FFFFFF</Color>
<Color x:Key="Primitive.White.10">#1AFFFFFF</Color>
<Color x:Key="Primitive.White.5">#0DFFFFFF</Color>
<Color x:Key="Primitive.Green.500">#2ED573</Color>
<Color x:Key="Primitive.Orange.500">#FFA502</Color>
<Color x:Key="Primitive.Red.500">#FF4757</Color>
<Color x:Key="Primitive.Blue.600">#1E90FF</Color>
<!-- Existing flat key preserved as alias -->
<SolidColorBrush x:Key="Blue500" Color="{StaticResource Primitive.Blue.500}"/>
<SolidColorBrush x:Key="Slate900" Color="{StaticResource Primitive.Slate.900}"/>Priority: High
File: Theme/Base/Colors.xaml — refactor semantic section
Strategy:
- Ensure all semantic
Brush.*tokens reference primitive colors (not hardcoded hex) - Add missing semantic tokens for inline colors found in audit
<!-- Background -->
<SolidColorBrush x:Key="Brush.Background.Primary" Color="{StaticResource Primitive.Slate.900}"/>
<SolidColorBrush x:Key="Brush.Background.Secondary" Color="{StaticResource Primitive.Slate.800}"/>
<SolidColorBrush x:Key="Brush.Background.Card" Color="{StaticResource Primitive.Slate.700}"/>
<!-- Text -->
<SolidColorBrush x:Key="Brush.Text.Primary" Color="{StaticResource Primitive.White.95}"/>
<SolidColorBrush x:Key="Brush.Text.Secondary" Color="{StaticResource Primitive.White.75}"/>
<SolidColorBrush x:Key="Brush.Text.Disabled" Color="{StaticResource Primitive.White.40}"/>
<!-- Accent -->
<SolidColorBrush x:Key="Brush.Accent.Primary" Color="{StaticResource Primitive.Blue.500}"/>
<!-- New tokens for inline color replacement -->
<SolidColorBrush x:Key="Brush.Button.Background" Color="#2FFFFFFF"/>
<SolidColorBrush x:Key="Brush.Button.HoverBackground" Color="#3FFFFFFF"/>
<SolidColorBrush x:Key="Brush.Button.PressedBackground" Color="#22FFFFFF"/>
<SolidColorBrush x:Key="Brush.DataGrid.AlternatingRow" Color="#0AFFFFFF"/>
<SolidColorBrush x:Key="Brush.DataGrid.HoverRow" Color="#15FFFFFF"/>
<SolidColorBrush x:Key="Brush.DataGrid.SelectedRow" Color="#333A86FF"/>
<SolidColorBrush x:Key="Brush.Progress.Background" Color="#22000000"/>Priority: High
New file: Theme/Base/ComponentTokens.xaml
Content: Component-specific tokens that reference semantic/spacing tokens:
<Thickness x:Key="Component.Button.Padding" Value="{DynamicResource ButtonPadding}"/>
<CornerRadius x:Key="Component.Button.Radius" Value="{DynamicResource MediumRadius}"/>
<sys:Double x:Key="Component.ComboBox.CornerRadius" Value="{DynamicResource MediumRadius}"/>
<Thickness x:Key="Component.Card.Padding" Value="{DynamicResource CardPadding}"/>
<CornerRadius x:Key="Component.Card.Radius" Value="{DynamicResource CardRadius}"/>Rationale: Isolates component styling from direct semantic token consumption, enabling per-component theming.
Priority: High
Files to refactor:
| File | Action |
|---|---|
ButtonStyles.xaml |
Replace #2FFFFFFF with Brush.Button.Background; replace #3FFFFFFF hover with Brush.Button.HoverBackground; replace #22FFFFFF pressed with Brush.Button.PressedBackground |
DataGridStyles.xaml |
Replace #0AFFFFFF with Brush.DataGrid.AlternatingRow; replace #15FFFFFF with Brush.DataGrid.HoverRow; replace #333A86FF with Brush.DataGrid.SelectedRow |
ComboBoxStyles.xaml |
Replace CornerRadius="10" with {DynamicResource MediumRadius} |
MainWindow.xaml |
Replace Background="#22000000" with {DynamicResource Brush.Progress.Background} |
Priority: Medium
Deliverable: Validation report
Method: Search all .xaml for inline DropShadowEffect definitions.
Acceptance: Zero inline shadows outside Effects/Shadows.xaml and Effects/Glow.xaml.
Priority: Medium
File: Theme/Base/Spacing.xaml — extend
Additions:
<sys:Double x:Key="Spacing.XSmall">4</sys:Double>
<sys:Double x:Key="Spacing.Small">8</sys:Double>
<sys:Double x:Key="Spacing.Medium">12</sys:Double>
<sys:Double x:Key="Spacing.Large">16</sys:Double>
<sys:Double x:Key="Spacing.XLarge">20</sys:Double>
<sys:Double x:Key="Spacing.XXLarge">24</sys:Double>
<Thickness x:Key="Padding.XSmall">4</Thickness>
<Thickness x:Key="Padding.Small">8,6</Thickness>
<Thickness x:Key="Padding.Medium">12,8</Thickness>
<Thickness x:Key="Padding.Large">16,12</Thickness>
<Thickness x:Key="Padding.XLarge">20,16</Thickness>Priority: Medium
File: Theme/Base/Typography.xaml — extend
Additions:
<Style x:Key="Style.Text.Title" TargetType="TextBlock">
<Setter Property="FontFamily" Value="{DynamicResource FontFamilyPrimary}"/>
<Setter Property="FontSize" Value="{DynamicResource TitleFontSize}"/>
<Setter Property="FontWeight" Value="{DynamicResource FontWeightBold}"/>
<Setter Property="Foreground" Value="{DynamicResource Brush.Text.Primary}"/>
</Style>
<Style x:Key="Style.Text.Subtitle" TargetType="TextBlock">
<Setter Property="FontFamily" Value="{DynamicResource FontFamilyPrimary}"/>
<Setter Property="FontSize" Value="{DynamicResource HeaderFontSize}"/>
<Setter Property="FontWeight" Value="{DynamicResource FontWeightMedium}"/>
<Setter Property="Foreground" Value="{DynamicResource Brush.Text.Primary}"/>
</Style>
<Style x:Key="Style.Text.Body" TargetType="TextBlock">
<Setter Property="FontFamily" Value="{DynamicResource FontFamilyPrimary}"/>
<Setter Property="FontSize" Value="{DynamicResource BodyFontSize}"/>
<Setter Property="FontWeight" Value="{DynamicResource FontWeightNormal}"/>
<Setter Property="Foreground" Value="{DynamicResource Brush.Text.Primary}"/>
</Style>
<Style x:Key="Style.Text.Caption" TargetType="TextBlock">
<Setter Property="FontFamily" Value="{DynamicResource FontFamilyPrimary}"/>
<Setter Property="FontSize" Value="{DynamicResource CaptionFontSize}"/>
<Setter Property="FontWeight" Value="{DynamicResource FontWeightNormal}"/>
<Setter Property="Foreground" Value="{DynamicResource Brush.Text.Secondary}"/>
</Style>
<Style x:Key="Style.Text.Button" TargetType="TextBlock">
<Setter Property="FontFamily" Value="{DynamicResource FontFamilyPrimary}"/>
<Setter Property="FontSize" Value="{DynamicResource BodyFontSize}"/>
<Setter Property="FontWeight" Value="{DynamicResource FontWeightMedium}"/>
<Setter Property="Foreground" Value="{DynamicResource Brush.Text.OnAccent}"/>
</Style>Priority: High
Deliverable: Validation report
Method:
- Regex search all
.xamlfor hardcoded color values (Color="#......"orColor="White"outside primitive definitions) - Regex search for
StaticResourceused on themeable properties (brushes, colors, borders) - Ensure all control
Background,Foreground,BorderBrushuseDynamicResource
Priority: Medium
| New File | Content |
|---|---|
Theme/Base/Elevation.xaml |
Elevation tokens: Elevation.Card, Elevation.Popup, Elevation.Window, Elevation.Small, Elevation.Medium, Elevation.Large — each mapping to shadow effect keys |
Theme/Base/Motion.xaml |
Motion tokens: Motion.Fade.Duration, Motion.Hover.Duration, Motion.Press.Duration, Motion.ThemeSwitch.Duration, Motion.Easing.Default |
Theme/Base/ZIndex.xaml |
Z-index constants for layering (popup, tooltip, overlay, dialog) |
Theme/Base/Opacity.xaml |
Standard opacity values: Opacity.Disabled, Opacity.Hover, Opacity.Pressed, Opacity.Subtle |
Priority: High
File: Theme/ThemeResources.xaml
Add new base files to MergedDictionaries in correct order:
1. Base/Colors.xaml
2. Base/Typography.xaml
3. Base/Spacing.xaml
4. Base/Radius.xaml
5. Base/Elevation.xaml (NEW)
6. Base/Motion.xaml (NEW)
7. Base/ZIndex.xaml (NEW)
8. Base/Opacity.xaml (NEW)
9. Base/ComponentTokens.xaml (NEW)
10. Effects/Shadows.xaml
11. Effects/Glow.xaml
12. Effects/Animations.xaml
13. Controls/... (existing)
14. ModernWindow.xaml
15. WindowAnimations.xaml
- All existing tokens reviewed and inventoried (P1-T001)
- Duplicate colors detected and documented (P1-T002)
- Primitive token system created with aliases (P1-T003)
- Semantic token system created, all referencing primitives (P1-T004)
- Component token system created (P1-T005)
- All inline colors replaced with tokens (P1-T006)
- Zero inline shadows outside Effects/ folder (P1-T007)
- Spacing standardized (P1-T008)
- Typography standardized (P1-T009)
- DynamicResource validation passed (P1-T010)
- New token files created (P1-T011)
- ThemeResources.xaml updated with correct loading order (P1-T012)
- Build passes
- GitHub PR created and approved
- CodeRabbit review clean
- Manual architecture review passed
Create Excel-safe rendering architecture. Extend existing ModernWindow, WindowRenderModeDetector with new services.
feature/phase-02-rendering-infrastructure
Priority: High
Deliverable: Window audit report
Scope: Review all 14 .xaml window files:
MainWindow.xamlSettingsWindow.xamlFloat_path.xamlAssignTradeCodesWindow.xamlFixpiecolors.xamlLinksManagerWindow.xamlStyleSelectorWindow.xamlSubDailyReportWindow.xamlUnmergeFillDownWindow.xamlXerEditorWindow.xamlProjectAnalysisWindow.xamlPrimaveraCompareWindow.xamlPrimaveraResultsWindow.xamlToastWindow.xaml
Check per window:
- Inherits from
ModernWindow? (If not, flag for Phase 11 migration) - Uses
AllowsTransparency? (Should beFalsefor Excel-safe) - Uses inline background/border/effects?
- Has
SnapsToDevicePixelsandUseLayoutRounding?
Priority: High
File: Controls/ModernWindow.cs — extend
Current state: Already exists with:
WindowRenderModeDetectorintegrationThemeManager.LoadThemeFromSettings()on init- Fade-in/out animations
- Commands for min/max/close
CloseOnEscapeDP
Extensions needed:
- Add
RenderModeDP (exposes current mode for diagnostics) - Add
IsSafeModeDP (read-only, bound toWindowRenderModeDetector) - Add
WindowBackdropDP (solid, gradient, image options for Phase 3) - Add
DpiScaleDP (for DPI-aware layout) - Refactor
InitializeWindow()to support future backdrop injection - Ensure all new DPs use
DefaultValuethat matches current behavior
Priority: High
File: Theme/Effects/Shadows.xaml — extend
Current state: 7 shadow effects + 1 progress glow
Additions:
Shadow.Window.Safe— lower opacity/blur for FallbackSafe modeShadow.Card.SafeShadow.Popup.Safe- Document safe-mode variants in
SHADOW_SYSTEM.md
Priority: High
New file: Services/RenderModeService.cs
Responsibilities:
- Wrap and extend
WindowRenderModeDetector - Cache render mode per session
- Provide
IsSafeModeRequired()API - Detect GPU availability
- Detect transparency support
- Expose
RenderModeChangedevent
Priority: High
Files: Services/RenderModeService.cs + Controls/ModernWindow.cs
Behavior:
- If
RenderModeServicereturnsFallbackSafe:- Disable fade animations on ModernWindow
- Use
Shadow.*.Safevariants - Disable backdrop effects
- Force
AllowsTransparency="False"
- If
WindowChromemode:- Use full shadows, animations, backdrops
Priority: High
Scope: Apply ModernWindow template and safe-mode settings to all audited windows.
Per-window changes:
- Ensure
WindowStyle="None"+ ModernWindow chrome (already done for some) - Replace inline backgrounds with
{DynamicResource Brush.Background.Root} - Replace inline borders with
{DynamicResource CardStrokeBrush} - Add
SnapsToDevicePixels="True"andUseLayoutRounding="True"where missing - Do NOT convert to Pages yet (Phase 5 scope restriction)
Priority: Medium
File: Helpers/DpiHelper.cs — extend
Current state: Exists but needs review.
Additions:
GetCurrentDpiScale()— returns scale factor for current windowScaleValue(double value)— scales a value by current DPIIsHighDpi()— returns true if scale ≥ 1.5- Integrate with
ModernWindowfor automatic scaling awareness
Priority: Medium
Deliverable: Accessibility checklist
Per-control requirements:
FocusVisualStyleusingGlow.FocuseffectAutomationProperties.Nameon all interactive elementsAutomationProperties.HelpTexton complex controls- Keyboard navigation (Tab order, Enter/Space activation)
- High contrast awareness (use system colors when high contrast is active)
Priority: Medium
File: Theme/WindowAnimations.xaml — extend
Current state: Already exists but needs review.
Requirements:
- All window open animations ≤ 200ms
- All window close animations ≤ 150ms
- Use
Motion.*tokens for durations - Safe mode: skip animations entirely
Priority: High
Deliverable: Docs/Architecture/EXCEL_TEST_CHECKLIST.md
Manual test checklist for you to execute:
- Open each window from Excel VSTO host
- Verify no black window rendering
- Verify ComboBox popup opens and renders correctly
- Verify DPI scaling at 100%, 125%, 150%
- Verify no transparency artifacts
- Verify window can be moved, minimized, closed without Excel freezing
- Verify theme switching works inside Excel host
- Verify safe mode activates correctly on problematic systems
- All windows audited (P2-T001)
- ModernWindow v2 with new DPs (P2-T002)
- Safe-mode shadow variants created (P2-T003)
- RenderModeService created (P2-T004)
- Fallback rendering implemented (P2-T005)
- All windows refactored for safe mode (P2-T006)
- DPI infrastructure extended (P2-T007)
- Accessibility checklist created (P2-T008)
- Window animations standardized (P2-T009)
- Excel stability test checklist created (P2-T010)
- Build passes
- GitHub PR created and approved
- CodeRabbit review clean
- Manual architecture review passed
Status: ✅ Implementation complete — validation tasks remaining
Branch: 002-fluent-theme-engine (merged)
Build a production-grade Fluent Runtime Theme Engine with Dark/Light/Custom theme switching, accent color system, centralized effects, DPI-aware controls, and Excel VSTO-safe rendering.
Phase 3 was delivered via two coordinated workstreams:
| Workstream | Spec | Focus |
|---|---|---|
| WS-A | 001-fluent-theme-engine |
Theme engine, effects library, control standardization, DPI, accessibility |
| WS-B | 002-themes-manager |
ThemeManager bug fixes, hardcoded color elimination, crash-risk removal |
- T001 Create
Theme/Effects/Shadows.xaml— centralized DropShadowEffect definitions (Shadow.Window, Shadow.Popup, Shadow.Card, 7 variants) - T002 Create
Theme/Effects/Glow.xaml— centralized glow effects (Glow.Focus, Glow.ButtonHover, Glow.Primary, Glow.Selection, Glow.Accent, Glow.ThemeCard.Selected) - T003 Create
Theme/Effects/Animations.xaml— HoverEnter/Exit, FocusEnter/Exit, PopupOpen/Close, FadeIn/Out, all ≤200ms with CubicEase - T004 Create
Properties/Settings.settings— SelectedTheme + AccentColor user-scoped - T005 Create
Settings.Designer.csaccessor
- T006 Create
Theme/Dark/DarkColors.xaml— Dark theme semantic overrides - T007 Create
Theme/Light/LightColors.xaml— Light theme semantic overrides - T008 Create
Theme/Custom/CustomColors.xaml— Custom theme overrides + 8 accent presets - T009 Create
Theme/Dark/DarkTheme.xaml— merged dictionary - T010 Create
Theme/Light/LightTheme.xaml— merged dictionary - T011 Create
Theme/Custom/CustomTheme.xaml— merged dictionary with accent token - T012 Create
Services/ThemeManager.cs— singleton with ApplyTheme(), LoadThemeFromSettings(), SaveCurrentTheme(), ThemeChanged event - T013 Integrate ThemeManager into
Controls/ModernWindow.cs— LoadThemeFromSettings() on startup
- T014 Create
Theme/Controls/ThemeCardStyles.xaml— glow + scale animations - T015 Create
Theme/Controls/AccentSwatchStyles.xaml— clickable swatch circles - T016 Refactor
Views/SettingsWindow.xaml— replace ComboBox with 3 theme cards - T017 Add 8 accent swatch circles to Custom theme card
- T018 Wire card clicks → ThemeManager.ApplyTheme()
- T019 Wire swatch clicks → ThemeManager.ApplyTheme("Custom", hex)
- T020 Initial selection state on load
- T021 Glow effect on selected card
- T022 Validate: theme switch < 1s, persistence across restarts, all windows update simultaneously
- T023 Refactor
ButtonStyles.xaml— VSM states (Normal/Hover/Pressed/Focused/Disabled) with glow - T024 Refactor
ComboBoxStyles.xaml— AllowsTransparency=False, PlacementTarget, Shadow.Popup - T025 Create
CheckBoxStyles.xaml— VSM states + custom checkmark - T026 Create
RadioButtonStyles.xaml— VSM states + dot indicator - T027 Create
ToggleButtonStyles.xaml— VSM states + slide animation - T028 Refactor
TextBoxStyles.xaml— VSM states with accent border transitions - T029 Refactor
DataGridStyles.xaml— EnableRowVirtualization, hover/selection via DynamicResource - T030 Create
ScrollViewerStyles.xaml— thin scrollbar (4px track, 8px thumb) - T031 Verify all states render correctly in Dark + Light
- T032 Verify ComboBox popup renders above content with shadow, no clipping
- T033 Audit XAML for hardcoded pixel values — all templates use DynamicResource
- T034 Audit SnapsToDevicePixels/UseLayoutRounding — present on all controls
- T035 DPI-aware ComboBox popup sizing
- T036 DPI-aware theme card preview sizing
- T037 DPI-aware accent swatch sizing
- T038 Validate DPI at 100%, 125%, 150%, 200% — no clipping/overflow
- T039 Audit nested DropShadowEffect — found 4 inline, documented
- T040 Audit BlurEffect — zero found ✅
- T041 Create
WindowRenderModeDetector.cs— VSTO/DPI detection - T042 Integrate detector into ModernWindow startup
- T043 Validate DataGrid scrolling with 1000+ rows
- T044 Validate rapid theme switching (10x) inside Excel
- T045 Audit Tab order in SettingsWindow — all elements Focusable/IsTabStop
- T046 Add AutomationProperties.Name to cards + swatches
- T047 Verify Enter/Space activation on all cards + swatches
- T048 Verify focus indicators (Glow.Focus) visible on all interactive elements
- T049 Validate WCAG 2.1 AA contrast (4.5:1) in Dark + Light
- T050 Validate ComboBox keyboard navigation (Tab → Arrows → Escape)
- T051 8-gate validation checklist — Dark theme
- T052 8-gate validation checklist — Light theme
- T053 8-gate validation checklist — Custom theme (2+ accent variations)
- T054 Document resource loading order in
ThemeResources.xaml - T055 Remove hardcoded colors from control templates
- T056 Remove inline DropShadowEffect — 1 documented exception
- T057 Update
AGENTS.md - T058 Build validation —
msbuildsucceeds (warnings only)
- T001 Verify
msbuildcompiles before changes
- T002 Fix accent persistence in
ThemeManager.cs— preserve_currentAccentColorwhen null - T003 Fix early-return logic — reorder
_currentThemeupdate - T004 Implement safe dictionary fallback — try/catch around removal/addition
- T005 Add
ThemeChangedthread safety —Dispatcher.InvokeAsync() - T006 Add theme switch debouncing — ~150ms coalesce window
- T007 Define
Brush.Background.Root(LinearGradientBrush) in Colors.xaml - T008 Define
Brush.Accent.ProgressFill(LinearGradientBrush) - T009 Define
Brush.Stroke.Info(SolidColorBrush) - T010 Define
Brush.Stroke.Status(SolidColorBrush) - T011 Define
Brush.Fill.Info(SolidColorBrush) - T012 Define
Brush.Fill.Status(SolidColorBrush) - T013 Dark overrides for all new tokens
- T014 Light overrides for all new tokens
- T015 Custom overrides for all new tokens
- T016 Add
ProgressGlowDropShadowEffect to Shadows.xaml
- T017 Remove duplicate converters from App.xaml
- T018 Remove duplicate dictionary loads from SettingsWindow.xaml
- T019 Remove orphaned FluentWhite.xaml from csproj
- T020 Remove orphaned FluentEffects.xaml + references
- T021 Remove commented-out legacy theme imports from App.xaml
- T022–T033 Replace root background gradient with
{DynamicResource Brush.Background.Root}across all 12 windows
- T034–T038 Replace progress bar gradients with
{DynamicResource Brush.Accent.ProgressFill}across 5 windows - T039 Fix ModernWindow.xaml hardcoded
Background="White"/Foreground="Black" - T040 Replace inline DropShadowEffect on WindowBorder with
Shadow.Window - T041 Fix TreeView hover/selected colors in Float_path.xaml
- T042–T045 Replace
Foreground="White"withTextOnAccentBrushon progress percent text - T046–T047 Replace inline DropShadowEffect on progress bars with
ProgressGlow
- T048 Add missing
Foregroundto PrimaveraResultsWindow TextBlock - T049 Add missing
Foregroundto SettingsWindow TextBlock - T050 Replace
Foreground="LimeGreen"withSuccessBrush - T051 Replace close button hover
#22FF4757withDangerBrush13% - T052 Replace
#12FFFFFFfills/strokes withBrush.Fill.Info/Brush.Stroke.Info - T053 Replace
#18FFFFFFfills/strokes withBrush.Fill.Status/Brush.Stroke.Status - T054 Replace
#1FFFFFFFfills/strokes with per-theme tokens - T055 Replace
#22FFFFFFfills/strokes with per-theme tokens
- T056 Build verification — zero errors
- T057 Runtime check: Excel VSTO — all windows update
- T058 Runtime check: accent → glow + progress bar
- T059 Runtime check: rapid switching (10x) — no crash
- T060 Regression: progress bar in all 7 windows
- T061 Regression: TreeView hover in Float_path
- T062 Regression: close button hover color
- T063 Grep audit — zero
#HEXin window .xaml files - T064 Constitution compliance review
| File | Purpose |
|---|---|
Theme/Effects/Shadows.xaml |
Centralized DropShadowEffect (7 variants + safe-mode variants) |
Theme/Effects/Glow.xaml |
Centralized glow effects (6 variants) |
Theme/Effects/Animations.xaml |
Control state + popup storyboards (all ≤200ms) |
Theme/Controls/CheckBoxStyles.xaml |
VSM states + custom checkmark |
Theme/Controls/RadioButtonStyles.xaml |
VSM states + dot indicator |
Theme/Controls/ToggleButtonStyles.xaml |
VSM states + slide animation |
Theme/Controls/ScrollViewerStyles.xaml |
Modern thin scrollbar |
Theme/Controls/ThemeCardStyles.xaml |
Theme card with glow + scale animations |
Theme/Controls/AccentSwatchStyles.xaml |
Accent swatch circles |
Services/RenderModeService.cs |
Render mode detection |
Docs/Architecture/EXCEL_TEST_CHECKLIST.md |
VSTO test scenarios |
- WS-A: Validate theme switch (T022), control states (T031), popup rendering (T032), DPI (T038), DataGrid performance (T043), rapid switching (T044), focus indicators (T048), contrast ratios (T049), keyboard nav (T050)
- WS-B: Excel VSTO runtime checks (T057–T062)
Standardize ALL WPF controls.
feature/phase-04-control-standardization
Must solve:
- width mismatch
- clipping
- shadow inconsistency
- Excel rendering issues
- TextBox
- ComboBox
- PasswordBox
- DataGrid
- ListView
- TreeView
- Tabs
- Sidebar
- Dialogs
- Toasts
All controls MUST:
- use semantic tokens
- use centralized shadows
- support keyboard navigation
- support reduced motion
| ID | Task |
|---|---|
| P4-T001 | Audit all control templates |
| P4-T002 | Refactor ComboBox popup |
| P4-T003 | Standardize TextBox |
| P4-T004 | Standardize DataGrid |
| P4-T005 | Standardize ListView |
| P4-T006 | Add virtualization |
| P4-T007 | Add smooth scrolling |
| P4-T008 | Add accessibility states |
| P4-T009 | Remove duplicate styles |
| P4-T010 | Validate popup rendering |
Transform app into unified workspace shell.
feature/phase-05-navigation-shell
Shell applies to NEW windows only. Existing windows remain standalone until Phase 11.
Shell
├── Sidebar
├── Workspace (Frame with Pages)
├── StatusBar
├── CommandPalette
└── Navigation Pages
Ribbon becomes: launcher layer
Shell becomes: workspace layer
Example:
NewFeatureWindow.xaml
↓
Pages/NewFeaturePage.xaml
| ID | Task |
|---|---|
| P5-T001 | Create shell architecture |
| P5-T002 | Create navigation service |
| P5-T003 | Create sidebar |
| P5-T004 | Create page host |
| P5-T005 | Convert NEW feature windows to Pages |
| P5-T006 | Create command palette |
| P5-T007 | Create workspace restore |
| P5-T008 | Add navigation animations |
| P5-T009 | Integrate ribbon launching |
| P5-T010 | Validate shell performance |
Clean architecture completely.
feature/phase-06-mvvm-cleanup
Package: Microsoft.Extensions.DependencyInjection (NuGet)
Install-Package Microsoft.Extensions.DependencyInjection- Event bus
- Command registry
- Module registry
- remove logic from code-behind
- relocate misplaced ViewModels
- isolate services
- reduce coupling
| ID | Task |
|---|---|
| P6-T001 | Audit MVVM violations |
| P6-T002 | Introduce DI container |
| P6-T003 | Create module registry |
| P6-T004 | Create event bus |
| P6-T005 | Refactor services |
| P6-T006 | Move ViewModels |
| P6-T007 | Remove business logic from views |
| P6-T008 | Standardize commands |
| P6-T009 | Reduce coupling |
| P6-T010 | Validate architecture |
Build Windows 11 personalization experience.
feature/phase-07-settings-ux
- Appearance
- Performance
- Accessibility
- Diagnostics
- Excel
- Plugins
- live preview
- accent picker
- background picker
- animation controls
- density controls
| ID | Task |
|---|---|
| P7-T001 | Audit current settings UI |
| P7-T002 | Create settings navigation |
| P7-T003 | Create accent picker |
| P7-T004 | Create background picker |
| P7-T005 | Create live preview |
| P7-T006 | Create performance settings |
| P7-T007 | Create accessibility settings |
| P7-T008 | Create diagnostics settings |
| P7-T009 | Create import/export settings |
| P7-T010 | Validate UX consistency |
Prevent WPF/Excel rendering failures.
feature/phase-08-diagnostics
- render mode
- GPU mode
- active theme
- memory usage
- popup diagnostics
Detect:
- missing tokens
- inline colors
- invalid resources
- duplicate styles
| ID | Task |
|---|---|
| P8-T001 | Create diagnostics service |
| P8-T002 | Create logging infrastructure |
| P8-T003 | Create validation engine |
| P8-T004 | Create render diagnostics |
| P8-T005 | Create popup diagnostics |
| P8-T006 | Create memory diagnostics |
| P8-T007 | Create theme validator |
| P8-T008 | Create fallback recovery |
| P8-T009 | Add crash-safe loading |
| P8-T010 | Validate stability |
Prepare future extensibility.
feature/phase-09-plugin-platform
Features register:
- pages
- commands
- ribbon actions
Load modules only when needed.
| ID | Task |
|---|---|
| P9-T001 | Create module contracts |
| P9-T002 | Create plugin loader |
| P9-T003 | Create module registration |
| P9-T004 | Create lazy loading |
| P9-T005 | Create feature isolation |
| P9-T006 | Create navigation registration |
| P9-T007 | Create ribbon registration |
| P9-T008 | Create plugin diagnostics |
| P9-T009 | Create plugin validation |
| P9-T010 | Validate module stability |
Production-grade optimization — validate, harden, and polish every aspect of the application for enterprise deployment. Address all remaining validation gaps from prior phases, eliminate technical debt, and produce auditable proof of quality across performance, accessibility, DPI, stability, and resource management.
feature/phase-10-enterprise-polish
Before Phase 10 work begins, the following must be confirmed complete:
| Dependency | Why |
|---|---|
| Phase 4 (Control Standardization) | All control templates must be standardized before final polish |
| Phase 3 remaining validation (15 tasks) | Unchecked WS-A tasks (T022, T031, T032, T038, T043, T044, T048, T049, T050) and WS-B tasks (T057–T062) must be resolved |
| Phase 5 (Navigation Shell) | Shell must be stable for Page-level polish |
| Phase 6 (MVVM Cleanup) | Architecture must be clean before final audit |
| Phase 9 (Plugin Platform) | Module system must be stable before final diagnostics |
- Memory profiling and leak detection
- Rendering path optimization (layout passes, visual tree depth)
- Virtualization tuning (DataGrid, ListView, TreeView)
- Animation budget compliance (all ≤200ms, no jank)
- Startup time optimization (cold start, background initialization)
- Resource dictionary merging optimization (eliminate duplicate loads)
- Freezable optimization (Freeze() on all frozen brushes, pens, transforms)
- BitmapScalingMode and RenderOptions optimization for all images/icons
- ClearType/font rendering consistency across all DPIs
- Full keyboard navigation audit (Tab order, arrow keys, Enter/Space activation, Escape close)
- Focus visual audit (Glow.Focus visible on every interactive element)
- Screen reader preparation (AutomationProperties.Name, HelpText, LabeledBy on all controls)
- WCAG 2.1 AA contrast validation (4.5:1 minimum) in Dark, Light, and all Custom themes
- Reduced motion support (respects system "Reduce motion" setting)
- High contrast mode awareness (fall back to system colors when active)
- Focus trap detection and prevention
- Accessibility compliance report generation
- DPI scaling validation at 100%, 125%, 150%, 200% — no clipping, overflow, or misalignment
- Multi-monitor validation across mixed DPI configurations
- Per-monitor DPI awareness (WPF PerMonitorDPI scaling)
- DPI-aware popup positioning (ComboBox, context menus)
- DPI-aware window sizing and layout
- DPI-aware font scaling consistency
- DPI regression checklist documented
- All 15 remaining Phase 3 validation tasks closed
- Full Excel VSTO host test pass across all 14 windows
- Rapid theme switching validation (10+ switches, no crash, no leak)
- DataGrid virtualization stress test (10,000+ rows)
- Popup rendering validation in Excel host (no clipping, no black rectangles)
- Safe mode activation/deactivation validation
- Memory stability during extended Excel session (2+ hours)
- Crash-safe loading under low-memory conditions
- ToastWindow.xaml migration from plain
<Window>tocontrols:ModernWindow - Final hardcoded-value grep sweep — zero
#HEX, zero inline effects, zero hardcoded margins in all .xaml files outside Theme/Base/ - ValidationEngine TODO resolved — implement proper XAML/dictionary resource resolver
- MVVM_COMPLIANCE.md per-file audit table filled (all 10 files)
- Dispose pattern audit — ensure IDisposable implementations on all services with unmanaged resources
- Event handler unsubscription audit — prevent memory leaks from lingering subscriptions
- Static event cleanup — identify and remove any static event handlers on services
- ResourceDictionary cleanup — remove orphaned/unreferenced dictionaries from MergedDictionaries
- DiagnosticsService snapshot coverage audit (all windows, all render modes)
- LoggingService rotation validation (5MB rollover, 3-file rotation, AppData path)
- ValidationEngine inline color scan across ALL .xaml files (not just known locations)
- Missing token detection coverage (validate all 70+ tokens expected by control templates)
- Diagnostics panel UX polish (loading states, error states, empty states)
- Plugin diagnostics integration (module state, version, memory in diagnostics panel)
- Performance counters or lightweight telemetry for long-running sessions
- Crash recovery validation (corrupt theme settings, missing resource dictionaries)
Docs/Architecture/PERFORMANCE_AUDIT_REPORT.md— perf findings, measurements, optimizations appliedDocs/Architecture/ACCESSIBILITY_AUDIT_REPORT.md— keyboard nav, focus, contrast, screen reader resultsDocs/Architecture/DPI_AUDIT_REPORT.md— scaling validation at all DPIs, multi-monitor resultsDocs/Architecture/EXCEL_STABILITY_REPORT.md— host test pass, stress test, memory stability resultsDocs/Architecture/LOCALIZATION_READINESS.md— document architecture readiness for future i18nDocs/Architecture/ENTERPRISE_POLISH_CHECKLIST.md— Phase 10 validation checklist- Update
AGENTS.mdwith Phase 10 paths, build commands, audit references
| ID | Task | Workstream |
|---|---|---|
| P10-T001 | Run comprehensive performance audit — profile memory, rendering, layout passes, visual tree depth | WS-A |
| P10-T002 | Optimize rendering — reduce layout passes, simplify visual trees, optimize bindings | WS-A |
| P10-T003 | Optimize memory — implement Freeze() on all freezable resources, fix leaks, add disposal patterns | WS-A |
| P10-T004 | Optimize animations — validate all storyboards ≤200ms, no jank, reduced-motion support | WS-A |
| P10-T005 | Optimize startup — cold-start timing, background initialization, lazy resource loading | WS-A |
| P10-T006 | Optimize resource dictionaries — deduplicate MergedDictionaries, remove orphans | WS-A |
| P10-T007 | Run full accessibility audit — keyboard nav, focus visuals, automation properties, contrast | WS-B |
| P10-T008 | Fix all accessibility violations found in audit — focus traps, missing labels, contrast failures | WS-B |
| P10-T009 | Implement screen reader preparation — AutomationProperties on all interactive elements | WS-B |
| P10-T010 | Validate reduced motion and high contrast mode across all themes | WS-B |
| P10-T011 | Run DPI audit — 100%, 125%, 150%, 200% — clipping, overflow, alignment | WS-C |
| P10-T012 | Implement per-monitor DPI awareness — popup positioning, window sizing, font scaling | WS-C |
| P10-T013 | Validate multi-monitor mixed DPI configurations | WS-C |
| P10-T014 | Document DPI regression checklist | WS-C |
| P10-T015 | Close all 15 remaining Phase 3 validation tasks (WS-A T022/T031/T032/T038/T043/T044/T048/T049/T050; WS-B T057–T062) | WS-D |
| P10-T016 | Run full Excel VSTO host test pass — all 14 windows, theme switching, popups, safe mode | WS-D |
| P10-T017 | Run DataGrid virtualization stress test (10,000+ rows) in Excel host | WS-D |
| P10-T018 | Validate memory stability during extended Excel session (2+ hours) | WS-D |
| P10-T019 | Migrate ToastWindow.xaml from plain <Window> to controls:ModernWindow | WS-E |
| P10-T020 | Run final hardcoded-value grep sweep — zero #HEX, zero inline effects, zero hardcoded margins outside Theme/Base/ | WS-E |
| P10-T021 | Fix ValidationEngine TODO — implement proper XAML/dictionary resource resolver | WS-E |
| P10-T022 | Fill MVVM_COMPLIANCE.md per-file audit table with pass/fail for all 10 files | WS-E |
| P10-T023 | Run dispose pattern audit — IDisposable on all services with unmanaged resources | WS-E |
| P10-T024 | Run event handler unsubscription audit — prevent memory leaks from lingering subscriptions | WS-E |
| P10-T025 | Validate DiagnosticsService snapshot coverage — all windows, all render modes | WS-F |
| P10-T026 | Validate LoggingService — rotation, path, rollover behavior | WS-F |
| P10-T027 | Extend ValidationEngine — inline color scan across ALL .xaml files, 70+ token coverage | WS-F |
| P10-T028 | Polish diagnostics panel UX — loading, error, and empty states | WS-F |
| P10-T029 | Validate crash recovery — corrupt theme settings, missing dictionaries | WS-F |
| P10-T030 | Create PERFORMANCE_AUDIT_REPORT.md | WS-G |
| P10-T031 | Create ACCESSIBILITY_AUDIT_REPORT.md | WS-G |
| P10-T032 | Create DPI_AUDIT_REPORT.md | WS-G |
| P10-T033 | Create EXCEL_STABILITY_REPORT.md | WS-G |
| P10-T034 | Create LOCALIZATION_READINESS.md | WS-G |
| P10-T035 | Create ENTERPRISE_POLISH_CHECKLIST.md | WS-G |
| P10-T036 | Update AGENTS.md with Phase 10 paths and audit references | WS-G |
| P10-T037 | Production validation — build passes, Excel host test, all checklists green | ALL |
- Performance audit complete with report (P10-T001 through P10-T006)
- All animations within 200ms budget, reduced motion supported (P10-T004)
- All freezable resources frozen, no resource leaks detected (P10-T003)
- Startup time measured and optimized (P10-T005)
- Accessibility audit complete with report (P10-T007 through P10-T010)
- WCAG 2.1 AA contrast (4.5:1) met in Dark, Light, all Custom themes
- All interactive elements have AutomationProperties.Name, keyboard navigable, visible focus indicators
- DPI audit complete, multi-monitor mixed DPI validated (P10-T011 through P10-T014)
- All 15 Phase 3 validation tasks closed (P10-T015)
- Excel VSTO test pass green across all 14 windows (P10-T016, P10-T017, P10-T018)
- ToastWindow.xaml migrated to ModernWindow (P10-T019)
- Zero hardcoded #HEX, inline effects, or hardcoded margins outside Theme/Base/ (P10-T020)
- ValidationEngine TODO resolved (P10-T021)
- MVVM_COMPLIANCE.md fully populated (P10-T022)
- Dispose pattern and event handler audits clean (P10-T023, P10-T024)
- All diagnostic services validated, panels polished (P10-T025 through P10-T029)
- All 6 audit/report documents created (P10-T030 through P10-T035)
- AGENTS.md updated (P10-T036)
- Production validation green — build, host, all checklists (P10-T037)
- GitHub PR created and approved
- CodeRabbit review clean
- Manual architecture review passed
Migrate existing standalone windows to Shell/Page architecture gradually.
feature/phase-11-legacy-migration
- Each existing window becomes a candidate for migration
- Create
Pages/folder for migrated windows - Original
.xamlpreserved until migration is validated - Ribbon launcher updated to open Page in Shell instead of standalone window
- Migrate most-used windows first
| ID | Task |
|---|---|
| P11-T001 | Identify migration priority (most-used windows first) |
| P11-T002 | Create Pages/ folder structure |
| P11-T003 | Migrate MainWindow to Page |
| P11-T004 | Migrate SettingsWindow to Page |
| P11-T005 | Migrate remaining feature windows |
| P11-T006 | Update ribbon launchers |
| P11-T007 | Validate each migrated window in Excel |
| P11-T008 | Remove original standalone XAML after validation |
| P11-T009 | Document migration patterns |
| P11-T010 | Final migration audit |
Created in Phase 0:
Docs/Architecture/
├── UI_GUIDELINES.md
├── TOKEN_RULES.md
├── POPUP_ARCHITECTURE.md
├── SHADOW_SYSTEM.md
├── ACCESSIBILITY_RULES.md
├── EXCEL_RENDERING_RULES.md
├── MVVM_RULES.md
├── REVIEW_CHECKLIST.md
├── AGENT_RULES.md
├── PERFORMANCE_RULES.md
├── AUDIT_REPORT.md
└── EXCEL_TEST_CHECKLIST.md
- inline colors
- inline shadows
- duplicate styles
- hardcoded spacing
- direct service creation in views
- business logic in code-behind
- DynamicResource
- semantic tokens
- MVVM
- centralized effects
- Excel-safe rendering
- accessibility-ready controls
- review before merge
Phase 0
↓
Phase 1
↓
Phase 2
↓
Phase 3
↓
Phase 4
↓
Phase 5
↓
Phase 6
↓
Phase 7
↓
Phase 8
↓
Phase 9
↓
Phase 10
↓
Phase 11
DO NOT start Shell before:
- Design System (Phase 1)
- Rendering Infrastructure (Phase 2)
- Theme Engine (Phase 3)
- Control Standardization (Phase 4)
are stable.
User will create Spec Kit folders using speckit commands. Each phase maps to:
specs/
├── 003-design-system-core/
│ ├── plan.md
│ ├── spec.md
│ ├── tasks.md
│ ├── checklists/
│ │ └── requirements.md
│ └── contracts/
│ └── token-api.md
├── 004-rendering-infrastructure/
│ ├── plan.md
│ ├── spec.md
│ ├── tasks.md
│ ├── checklists/
│ │ └── requirements.md
│ └── contracts/
│ └── window-api.md
└── ... (one folder per phase)
WpfApp2/Theme/
├── Base/
│ ├── Colors.xaml
│ ├── Typography.xaml
│ ├── Spacing.xaml
│ └── Radius.xaml
├── Dark/
│ ├── DarkColors.xaml
│ └── DarkTheme.xaml
├── Light/
│ ├── LightColors.xaml
│ └── LightTheme.xaml
├── Custom/
│ ├── CustomColors.xaml
│ └── CustomTheme.xaml
├── Controls/
│ ├── ButtonStyles.xaml
│ ├── ComboBoxStyles.xaml
│ ├── ComboBoxItemStyles.xaml
│ ├── DataGridStyles.xaml
│ ├── TextBoxStyles.xaml
│ ├── ListViewStyles.xaml
│ ├── ListViewItemStyles.xaml
│ ├── ScrollBarStyles.xaml
│ ├── CheckBoxStyles.xaml
│ ├── RadioButtonStyles.xaml
│ ├── ToggleButtonStyles.xaml
│ ├── ScrollViewerStyles.xaml
│ ├── WindowStyles.xaml
│ ├── WindowButtonStyles.xaml
│ ├── GroupBoxStyles.xaml
│ ├── LabelStyles.xaml
│ ├── ProgressBarStyles.xaml
│ ├── ThemeCardStyles.xaml
│ └── AccentSwatchStyles.xaml
├── Effects/
│ ├── Shadows.xaml
│ ├── Glow.xaml
│ └── Animations.xaml
├── ModernWindow.xaml
├── ThemeResources.xaml
└── WindowAnimations.xaml
WpfApp2/Services/
├── ThemeManager.cs
├── ThemeSettings.cs
├── WindowRenderModeDetector.cs
├── DialogService.cs
├── ToastService.cs
└── ExcelProjectAnalysisService.cs
WpfApp2/Controls/
├── ModernWindow.cs
├── LoadingOverlay.xaml
├── LoadingOverlay.xaml.cs
└── Toast/
├── ToastWindow.xaml
├── ToastWindow.xaml.cs
└── ToastModel.cs
WpfApp2/
├── MainWindow.xaml
├── MainWindow.xaml.cs
├── Float_path.xaml
├── Float_path.xaml.cs
├── AssignTradeCodesWindow.xaml
├── AssignTradeCodesWindow.xaml.cs
├── Fixpiecolors.xaml
├── Fixpiecolors.xaml.cs
├── LinksManagerWindow.xaml
├── LinksManagerWindow.xaml.cs
├── StyleSelectorWindow.xaml
├── StyleSelectorWindow.xaml.cs
├── SubDailyReportWindow.xaml
├── SubDailyReportWindow.xaml.cs
├── UnmergeFillDownWindow.xaml
├── UnmergeFillDownWindow.xaml.cs
├── XerEditorWindow.xaml
├── XerEditorWindow.xaml.cs
├── Views/
│ ├── SettingsWindow.xaml
│ └── SettingsWindow.xaml.cs
└── Windows/
└── PrimaveraComparison/
├── PrimaveraCompareWindow.xaml
├── PrimaveraCompareWindow.xaml.cs
├── PrimaveraResultsWindow.xaml
└── PrimaveraResultsWindow.xaml.cs
Primitive Tokens
Primitive.Blue.500 → #3A86FF
Primitive.Slate.900 → #0E1720
Primitive.White.95 → #F2FFFFFF
...
↓ (referenced by)
Semantic Tokens
Brush.Background.Primary → Primitive.Slate.900
Brush.Text.Primary → Primitive.White.95
Brush.Accent.Primary → Primitive.Blue.500
...
↓ (referenced by)
Component Tokens
Component.Button.Padding → Spacing.Medium
Component.Button.Radius → Radius.Medium
...
↓ (used by)
Control Templates
ButtonStyles.xaml
ComboBoxStyles.xaml
...
1. Primitive Tokens → Base/Colors.xaml
2. Semantic Tokens → Base/Colors.xaml (continued)
3. Typography → Base/Typography.xaml
4. Spacing → Base/Spacing.xaml
5. Radius → Base/Radius.xaml
6. Elevation → Base/Elevation.xaml
7. Motion → Base/Motion.xaml
8. ZIndex → Base/ZIndex.xaml
9. Opacity → Base/Opacity.xaml
10. Component Tokens → Base/ComponentTokens.xaml
11. Effects → Effects/Shadows.xaml, Glow.xaml, Animations.xaml
12. Controls → All control styles
13. Window Styles → ModernWindow.xaml, WindowAnimations.xaml
14. Theme Overrides → Dark/Light/Custom (swapped at runtime)
15. Runtime Overrides → Generated brushes, accent variants
Plan Version: 1.0.0
Approved by: User (2026-05-21)
Next Step: User creates Spec Kit branches and folders, then signals to begin Phase 0 execution.