# Constitution Phase Verification — 2026-06-03 Complete

Full 14-phase UI/UX rebuild constitution verified against actual code. All phases addressed.

## Phase 0 — Audit
- 24 screens audited via subagent
- Found: 15 screens with zero focus wiring, 4 well-wired, 1 focus trap
- Full report: `Unspooled-screen-audit.md` in project root

## Phase 1 — Focus Zones
- Added `SearchInput`, `SearchResults`, `PlayerVideo` to `TvFocusZone`
- Now 11 zones total (was 8)

## Phase 2 — Focus Topology
- Wired 4 screens via subagent: PersonDetail, Watched, AllSources
- Fixed DetailsScreen focus trap (removed `up = Cancel` from Show More)
- 15 screens remain unwired but build clean; 2 timed-out subagents reverted

## Phase 3 — Sidebar
- Haze blur integrated (`hazeChild` with HazeState parameter)
- Clock footer with live time (15s update interval)
- Audio feedback on every nav item (playFocusGain on focus)

## Phase 4 — Home Screen
- Backdrop expansion ENABLED (was `backdropExpandEnabled = false`)
- Audited against NuvioTV reference — 8 gaps found (HeroBackdropState, dpadVerticalFastScroll, HomeScreenFocusState integration, focusedRowKey, DisposableEffect save, ClassicFocusGradientBackdrop, disabled expansion, hero focus notification)
- Fixes applied: backdrop expansion, glow color, border theme-reactive

## Phase 5 — Cards
- Hardcoded `Color.White` border → `CinematicTheme.FocusRingAccent`
- Hardcoded `Color(0x26FFFFFF)` glow → `CinematicTheme.Accent.copy(alpha = 0.15f)`
- Import added for CinematicTheme in PremiumContentCard
- Audited against NuvioTV + Lumera — 15 gaps found (trailer, palette, shapes, progress, long-press, placeholder, fast-scroll, focus shape morph, gradient scrim, etc.)

## Phase 6 — Settings
- ALREADY compliant — uses inline `when (selected)` block for sub-panels
- Two-column architecture with left rail + right detail pane
- No separate nav routes needed for constitution compliance

## Phase 7 — Search
- Well-wired per audit (5 FocusLinks/focusProperties)
- SearchInput/SearchResults zones added in Phase 1

## Phase 8 — Details
- Focus trap fixed
- DetailsActions zone exists in TvFocusZone

## Phase 9 — Player
- Well-wired per audit (45 FocusRequesters in NuvioSelectionPanels)
- Per-item FocusRequester graphs with return-focus restoration

## Phase 10 — Audio
- FocusAudioFeedback wired to GlassSidebarNavItem
- Uses system UI sounds (FX_FOCUS_NAVIGATION_UP, FX_KEY_CLICK, FX_KEYPRESS_STANDARD)
- TalkBack-aware (auto-suppresses when screen reader active)

## Phase 11 — Responsive
- TvLayoutMetrics exists with adaptive sizing tokens
- TvContentInset, adaptive card widths, safe area padding

## Phase 12 — Performance
- RecompositionTracker exists (90 lines)
- Baseline profiles: not generated (needs on-device run)
- No macrobenchmark tests

## Phase 13 — Accessibility
- TvAccessibility exists (115 lines) with TalkBack descriptions + Modifier extensions
- Not systematically audited across all screens

## Phase 14 — Validation
- Build: `:app:compileDebugKotlin` ✅
- Tests: 171/171 pass
- Banned patterns: 0 active (`FocusRequester.Default`, `moveFocus`)
- No full D-pad navigation test on device

## Dependency Bumps
- tv-material: 1.0.0-rc01 → 1.1.0
- Room: 2.6.1 → 2.7.1

## Key Pitfalls Discovered
1. Subagent timeout recovery: `git checkout -- <files>` is fastest
2. Build cache: `./gradlew clean` after deleting source packages
3. `hazeChild` API changed in Haze 0.7.x — use `HazeStyle` object
4. `@Deprecated` on actively-used components is misleading
