# UI Integration Wiring — Critical Pitfall

## The Pattern

Building new UI files is **not** the same as integrating them. After creating new composables, you MUST explicitly wire them into:

1. **NavHost** — Update `UnspooledNavHost.kt` to call the new screen composable instead of the old one
2. **Parent screens** — If a shared component (sidebar, card, scaffold) was rebuilt, update all screens that embed the old version
3. **Route mapping** — Verify sidebar `onNavigate` routes match Screen sealed class routes

## Session Example (June 2026)

33 new Kotlin files were created (FocusRegistry, UnifiedSidebar, PremiumContentCard, UnspooledHomeScreen, etc.) and compiled clean. But the app looked identical because:

- `UnspooledNavHost.kt` still imported and called `NetflixHomeScreen` (not `UnspooledHomeScreen`)
- `CatalogBrowserScreen.kt` still used `NavigationRailWrapper`/`NetflixSideNavigation` (not `UnifiedChromeScaffold`)
- `CatalogRowSection` still used `NetflixMediaCard` (not `PremiumContentCard`)

## Fix Checklist

After building new UI components, before claiming done:

- [ ] Grep for old component names in NavHost (`NetflixHomeScreen`, `NavigationRailWrapper`, etc.)
- [ ] Verify new screen is the composable called at its route in NavHost
- [ ] Verify new sidebar/scaffold is the one used in catalog browser screens
- [ ] Verify new card component replaces old card component in row sections
- [ ] Run `./gradlew :app:assembleDebug` — zero errors
- [ ] Check `git diff --stat` shows import changes + composable call changes, not just new files

## Scraper Wiring Verification

The scraper is wired through these layers — verify all are present:

```
SystemAddonCatalog.kt  →  defines nexstream_scraper system addon
                         →  manifestUrl = BuildConfig.NEXSTREAM_SCRAPER_URL + "/manifest.json"
ProviderRegistry.kt     →  maps "stream-scraper" → ScraperProvider (debrid-dependent)
ScraperProvider.kt      →  calls StreamScraperEngine.scrape(type, id, scrapers=addons)
StreamScraperEngine.kt  →  HTTP client → scraper service (port 3091)
```

Quick check:
```bash
curl -s http://192.168.1.50:3091/health
curl -s http://192.168.1.50:3091/manifest.json | jq '.id'
```
