# 050 — Home

Status: approved 2026-09-30. Built in F2.

> **Amended 2026-10-08:** Home is Milionář-only; every Estuary item in the §2 tables (Filmy/Seriály/Videa/Doplňky
> and the default-off ones) and its widget group is removed, "Doplňky" is not offered by the skin.
> See `900-decisions.md`.

## 1. How Estuary Home works (21.3, what we extend)

- Main menu: `list` id **9000** with static `<item>`s; each item has
  `<property name="id">` (e.g. `movies`), `<property name="menu_id">`
  (`$NUMBER[5000]`), an icon `<thumb>`, `onclick`s and a
  `<visible>!Skin.HasSetting(HomeMenuNo…Button)</visible>`.
- Widget area: one `group` per item, `id` = its `menu_id` (5000 movies, 6000
  tv shows, …), visible when
  `String.IsEqual(Container(9000).ListItem.Property(id),<id>)`, containing a
  `grouplist` of widget includes (`WidgetListPoster`, `WidgetListEpisodes`,
  `WidgetListCategories`, …) with params `content_path`, `widget_header`,
  `widget_target`, `list_id`, `sortby`, `onclick_condition`,
  `onclick_action`, `browse_mode`. Empty state: include `ImageWidget`.
- Top bar: `grouplist` id **700** with `IconButton` includes: 804 power
  (`ActivateWindow(shutdownmenu)`), 802 settings (`ActivateWindow(settings)`),
  801 search (`ActivateWindow(1107)`), 803/805 fullscreen when playing.

New items copy this pattern exactly; nothing else in Home changes.

The addon's fullscreen dialogs (MyTV, MyCinema, Continue watching, AI hub)
accept `show_nav_sidebar=1` for their own navigation sidebar; from the skin
they open **without** it (Home is the navigation).

## 2. Main menu order

| # | Item (`property id`) | Label | Default | `onclick` |
|---|----------------------|-------|---------|-----------|
| 1 | `mil_foryou` | Pro tebe | on | `SetFocus(32000)` |
| 2 | `mil_continue` | Pokračovat | on | `SetFocus(24000)` |
| 3 | `mil_mymovies` | Filmy | on | `SetFocus(29000)` |
| 4 | `mil_myseries` | Seriály | on | `SetFocus(30000)` |
| 5 | `mil_mytv` | MyTV | on | `SetFocus(22000)` |
| 6 | `mil_vinyl` | Vinyl | on | `SetFocus(31000)` |
| 7 | `mil_mycinema` | MyCinema | on | `SetFocus(23000)` |
| 8 | `mil_game` | Milionář | on | `SetFocus(25000)` |
| 9 | `mil_ai` | AI doporučení | on | `SetFocus(26000)` |
| 10 | `mil_kraska` | Kraska | off | `SetFocus(27000)` |
| 11 | `mil_tmdb` | TMDb / ČSFD | on | `SetFocus(28000)` |

Amended 2026-10-12: click, Enter/OK and Right all focus the same content group,
with the existing focus/return behavior. Top-bar icons keep their actions.
Filmy, Seriály and Vinyl retain their classic listings through their movable
action widgets only. The sidebar context opens the widget manager directly;
there are no fixed classic-list buttons. The widget is appended last once,
without changing existing widgets, UIDs, context menus or hero layouts; there are
now seven slots. Filmy/Seriály include the native list's existing keyboard/search/add
action, shared through `urls.add_url`; Vinyl keeps the Music catalogue. All widgets
can be moved, removed and added again through the ordinary manager. Other sidebar
sections do not offer a classic listing. Existing dialogs and handlers remain available.

- Milionář items: `<visible>System.AddonIsEnabled(plugin.video.milionar) +
  !Skin.HasSetting(HomeMenuNoMil<Name>Button)</visible>`.
- Kraska and AI items are also hidden while the provider is not configured
  (`!String.IsEmpty(Window(Home).Property(milionar.provider.kraska))`,
  `…ai`), set by the service at startup and after settings change.
- Default-off Estuary items: Home `<onload>` runs once
  `Skin.SetBool(HomeMenuNoMusicButton)` … for each of them and then
  `Skin.SetBool(MilionarDefaultsV1)`, guarded by
  `!Skin.HasSetting(MilionarDefaultsV1)`; the user can re-enable them in skin
  settings with Estuary's own switches.
- **Icons (decided): Estuary's own icons only, nothing is drawn.** The
  sidemenu image control has a fixed size, so icons from other Estuary
  folders scale into it like the originals:

| Item | Icon (texture path relative to the fork's `media/`) |
|------|------------------------------------------------------|
| MyTV | `icons/sidemenu/livetv.png` |
| MyCinema | `icons/sidemenu/musicvideos.png` |
| Pokračovat | `DefaultMusicRecentlyPlayed.png` (Estuary 256 px, framed play symbol; first item) |
| Milionář | `icons/sidemenu/games.png` |
| AI doporučení | `icons/sidemenu/manage.png` |
| Kraska | `icons/sidemenu/download.png` |
| TMDb / ČSFD | `icons/sidemenu/favourites.png` |
| Info dialog button "Milionář" (080 §2) | `icons/infodialogs/extras.png` |

Amended 2026-10-01: **Pokračovat is the first menu item** (then MyTV, MyCinema); all main menu icons come from `icons/sidemenu/` (95x95 like
the Estuary items); icons from other folders are 40-80 px and render at the
wrong size in the menu.

## 3. Widget rows per item (approved table)

| Item | Rows (top → bottom) | Widget include | Content (060) |
|------|---------------------|----------------|---------------|
| MyTV | Moje kanály · Další epizody | `WidgetListPoster` (landscape composites) · `WidgetListEpisodes` | `widget_mytv_channels` · `widget_mytv_next` |
| MyCinema | Moje kina · Doporučené filmy | `WidgetListPoster` · `WidgetListPoster` | `widget_mycinema_channels` · `widget_mycinema_recommended` |
| Pokračovat | Rozkoukané · Naposledy přehrané | `WidgetListEpisodes` · `WidgetListPoster` | `widget_in_progress` (addon + `videodb://inprogress…`) · `widget_recently_played` |
| Filmy / Seriály | Estuary rows 1:1 | Estuary | Estuary |
| Milionář | Hrát o… (recent titles) | `WidgetListPoster` | `widget_game_topics` |
| AI | Poslední doporučení · AI chat (single tile) | `WidgetListPoster` | `widget_ai_recent` |
| Kraska | Kategorie Krásky | `WidgetListCategories` | `widget_kraska_root` |
| TMDb / ČSFD | Populární filmy · Populární seriály · ČSFD žebříčky | `WidgetListPoster` ×2 · `WidgetListCategories` | `widget_tmdb_popular_movies` · `widget_tmdb_popular_series` · `widget_csfd_charts` |

- Every row: `content_path` =
  `plugin://plugin.video.milionar/?action=widget_<name>&reload=$INFO[Window(Home).Property(milionar.widgets.token)]`.
- Each row has its own skin bool `HomeWidgetNoMil<Row>` (default on).
- Empty state per item: Estuary `ImageWidget` with a short text and a button
  that opens the full feature (e.g. "Zatím nemáte žádný kanál" → MyTV).
- Clicking a widget item follows the item's path/`onclick` from the addon
  (060 §3); rows never open a listing the addon cannot handle.

## 4. Top bar

| Button | Estuary | Milionář skin |
|--------|---------|---------------|
| 804 Power | `ActivateWindow(shutdownmenu)` | unchanged |
| 802 Settings | `ActivateWindow(settings)` | `ActivateWindow(1108)` — settings menu |
| 801 Search | `ActivateWindow(1107)` | addon enabled: `RunPlugin(plugin://plugin.video.milionar/?action=skin_search)`; else Estuary `ActivateWindow(1107)` |

`Custom_1108_MilionarSettingsMenu.xml` is a copy of
`Custom_1107_SearchDialog.xml` (same `DialogBackgroundCommons` +
`ButtonMenuList` panel, same size and animation) with header "Nastavení" and
items:

1. Nastavení Kodi → `Dialog.Close(all)`, `ActivateWindow(settings)`
2. Nastavení vzhledu → `Dialog.Close(all)`, `ActivateWindow(skinsettings)`
3. Nastavení Milionáře → `Dialog.Close(all)`,
   `Addon.OpenSettings(plugin.video.milionar)`; visible only when the addon
   is enabled.

## 4a. Milionář topic picker (window 1122)

Decided: clicking the Milionář menu item opens a topic picker.
`Custom_1122_MilionarGame.xml` is the same 1107-pattern menu as 1108 with
header "Milionář" and items:

1. Film z knihovny → `Dialog.Close(all)`,
   `RunPlugin(plugin://plugin.video.milionar/?action=skin_game&topic=movie)`
2. Seriál z knihovny → `…&topic=tvshow`
3. Náhodně → `…&topic=random`

`skin_game` (new router action, `wcs/skin/game.py`):

- `movie` / `tvshow`: JSON-RPC `VideoLibrary.GetMovies` / `GetTVShows`
  (title, year, art, uniqueid, plot), `xbmcgui.Dialog().select(…,
  useDetails=True)` with poster thumbnails, sorted by title; the pick runs
  the existing `play_text_game` with `title`, `tmdb_id`, `media_type`
  (`movie`/`tv`), `plot`, `poster`, `fanart`.
- `random`: one random movie or show from the library (uniform over both),
  then as above without the select.
- Empty library: notification "Knihovna je prázdná"; the user stays on
  Home.
- `tmdb_id` missing on an item: resolved like 080 §1.

The row "Hrát o…" (050 §3) starts the game on its item directly.

## 5. Skin settings

New section "Milionář" in `SkinSettings.xml`, same controls as Estuary's
"Main menu items" section (`radiobutton` with
`<selected>!Skin.HasSetting(X)</selected>` and
`<onclick>Skin.ToggleSetting(X)</onclick>`):

- one switch per Milionář menu item (`HomeMenuNoMil…Button`),
- under each, indented and `<enable>`d by its item, one switch per widget row
  (`HomeWidgetNoMil…`),
- "Přepnout na výchozí rozložení Milionáře" button: resets all Milionář bools
  and re-applies §2 defaults.

Strings from #31900 in cs/sk/en (030 §4).

## 6. Result (F2, 2026-09-30)

Built and verified in the live Kodi (native captures):

- Main menu: MyTV, MyCinema, Pokračovat, Filmy, Seriály, Milionář, AI,
  Kraska, TMDb / ČSFD, Videa, Doplňky; the 8 other Estuary items are hidden
  once by `MilionarDefaultsV1` in Home `<onload>`. Menu ids 22000-28000,
  widget rows `<menu id>+100/200/300`. Icons are Estuary's (mapping above).
- Top bar: settings opens window 1108 (Kodi / skin / Milionář settings),
  search button 806 runs `skin_search` when the addon is enabled (801 is the
  Estuary button for the addon-less case, mutually exclusive by `visible`).
  Until F3 `skin_search` shows the keyboard and opens the addon's universal
  search listing.
- Window 1122 (topic picker) and `skin_game` (library movie / show picker or a
  random title) work; empty library -> notification.
- Skin settings: new category "Milionář" (one switch per item, row switches
  under it, "reset to defaults" button).
- Fixed 060 §3 detail: Estuary's `WidgetListEpisodes` has no
  `onclick_condition` parameter, so every Milionář item that runs an action
  is a *playable plugin URL* `action=skin_run&run=<query>`: Kodi resolves it,
  the handler resolves to nothing and starts the action with `RunPlugin`.
  Same mechanism for all rows, no change to Estuary includes.
- Checked: clicking the 2nd MyTV channel opens MyTV on that channel
  (`channel_id`); Milionář row shows recent + random library titles; TMDb and
  ČSFD rows fill from the service cache; AI row shows "AI chat" + history
  (verified with a hand-written fixture file, removed afterwards).
- Not verified: `lib_resume` (would start playback), "Doporučené filmy"
  (needs films in a cinema), and **Kraska** rows stay empty because the Stream
  Cinema API currently answers 404 for every request (the addon's own Kraska
  browsing fails the same way); the empty state with the open button is shown.
- Home ready time vs Estuary (120 §3) was not measured separately; rows load
  in parallel and each is under 150 ms (060 §7).
- Kraska default-off (2026-10-01): Home `<onload>` sets `HomeMenuNoMilKraskaButton` once under `MilionarDefaultsV2` (so it also applies to skins that already ran V1); the "reset layout" button sets it again. Skin version 1.3.1.
