| 1 | # Frontend .NET Playbook v1 |
| 2 | |
| 3 | ## Purpose |
| 4 | Unified frontend engineering playbook for .NET UI stacks: |
| 5 | - Blazor |
| 6 | - Avalonia |
| 7 | - XAML-based UI patterns |
| 8 | |
| 9 | ## Scope |
| 10 | - Architecture and state boundaries |
| 11 | - Rendering performance and responsiveness |
| 12 | - UX consistency and accessibility |
| 13 | - Test strategy for UI behavior |
| 14 | |
| 15 | ## Evidence-Based Working Format |
| 16 | - Fact: capture observable issue or outcome (latency, rerender loop, state drift, UX friction). |
| 17 | - Hypothesis: define the expected improvement and mechanism. |
| 18 | - Check: implement a minimal change and verify with focused measurement. |
| 19 | - Decision criterion: predefine keep/rollback/escalate threshold. |
| 20 | - Confidence mark: tag confidence separately from preference. |
| 21 | |
| 22 | ## Architecture Baseline |
| 23 | - Keep domain and application logic outside UI components. |
| 24 | - Separate state ownership from rendering concerns. |
| 25 | - Prefer explicit data flow over implicit coupling. |
| 26 | - Treat navigation and component lifecycle as first-class contracts. |
| 27 | |
| 28 | ## Blazor Track |
| 29 | - Component boundaries and parameter design. |
| 30 | - Rendering discipline (`ShouldRender`, memoization, event frequency control). |
| 31 | - State containers and async data loading patterns. |
| 32 | - WASM vs Server tradeoffs and failure modes. |
| 33 | |
| 34 | ## Avalonia and XAML Track |
| 35 | |
| 36 | **CascadeIDE / Dock / дизайн-имплементация:** полная цепочка **status → playbook → kb** — `status-avalonia-cascade-ide-ui-v1.md`, `playbook-avalonia-dock-ui-v1.md`, `kb-avalonia-ui-dock-fundamentals-v1.md`; маршрутизатор индекса: секция `router-avalonia-ui` в `index-knowledge-router-v1.md`. |
| 37 | |
| 38 | - MVVM boundaries and command/state flow. |
| 39 | - Resource dictionaries, styling, and theme consistency. |
| 40 | - Visual tree cost control and virtualization strategy. |
| 41 | - Cross-platform behavior and input parity checks. |
| 42 | |
| 43 | ## UI Quality Contracts |
| 44 | - One primary action per context. |
| 45 | - Explicit loading/empty/error states. |
| 46 | - Keyboard-first support for critical workflows. |
| 47 | - Deterministic back navigation and preserved context. |
| 48 | |
| 49 | ## Testing Contracts |
| 50 | - Component-level behavior tests for key interactions. |
| 51 | - Integration tests for critical user journeys. |
| 52 | - Snapshot testing only as a supplement, not as sole confidence source. |
| 53 | - Regression checklist for high-risk UI flows. |
| 54 | |
| 55 | ## Metrics |
| 56 | - Time-to-interactive for critical screens. |
| 57 | - Rerender frequency in hot paths. |
| 58 | - UI error/retry rate. |
| 59 | - Flow completion rate for primary tasks. |
| 60 | |
| 61 | ## Revisit Triggers |
| 62 | - Growing UI latency or input lag. |
| 63 | - Repeat regressions in the same flows. |
| 64 | - Support feedback about navigation confusion. |
| 65 | - Increased divergence between UI stacks (Blazor/Avalonia/XAML). |
| 66 | |
| 67 | |