# Settings Master-Detail Pattern (2026-05-28)

## Pattern
NuvioTV-style single-screen master-detail. Left rail (280dp, scrollable LazyColumn of categories) + right content panel (weight(1f), verticalScroll).
All settings render INLINE — no separate navigation pushes for sub-screens.

## File
`ui/screens/settings/SettingsScreen.kt` — full rewrite (17 categories, ~500 lines)

## Architecture
```kotlin
// Categories enum — add new settings sections here
enum class SettingsCategory {
    DASHBOARD, THEME, DEBRID, TRAKT, PLAYBACK,
    SOURCE_PREFS, ADDONS, PROFILES, CATALOG_ORDER,
    SUBTITLES, TMDB, NETWORK, APPEARANCE, SKIP_INTRO,
    DEBUG, LICENSES, ABOUT,
}

// Rail item: label + emoji icon + category
data class SettingsRailItem(label: String, icon: String, category: SettingsCategory)
```

## Key Design Decisions
- **Emoji icons** instead of Material Icons — consistent with TV readability, same as onboarding
- **Focus**: `onFocusChanged` + `focusable()` + `onPreviewKeyEvent` for `Key.DirectionCenter || Key.Enter`
- **Theme panel**: Each theme chip has `selected` local state (not from ViewModel — avoids coupling)
- **Debrid/Trakt panels**: Render inline with provider cards. "Set up →" always visible
- **Playback/SourcePrefs**: Toggle rows with `SettingToggleRow(label, initialValue)` using local state
- **Unimplemented panels**: Placeholder text "coming soon inline" — prevents crashes, shows migration progress

## What Changed from Before
| Before | After |
|--------|-------|
| 19 separate `composable()` routes in NavHost, each full-screen push | ONE composable with 17 inline panels |
| Sidebar items called `navController.navigate()` | All content renders in right panel |
| Only Theme rendered inline; everything else said "tap sidebar" | 5 panels have real content (Dashboard, Theme, Debrid, Trakt, Playback, SourcePrefs) |
| No consistent focus handling between screens | Single focus pattern shared across all panels |

## How to Add a New Setting Section
1. Add entry to `SettingsCategory` enum
2. Add rail item to `railItems` list in `SettingsScreen()`
3. Add `when` branch in the content panel area
4. Create private composable `SettingsXxxPanel()` — keep it inline, don't navigate away
