# 070 — Home: menu, widget slots, rows, skin settings

## 1. Main menu

(Menu items, hidden Kodi items, skin toggles and strings were built early in L3, 2026-10-01; slot rows below are still L4.)

Order (new items in bold): Pokračovat, **Moje filmy**, **Moje seriály**, MyTV,
MyCinema, Milionář, AI doporučení, (Kraska), TMDb / ČSFD, Filmy (Kodi),
Seriály (Kodi), Videa, Doplňky.

Built menu ids follow the skin plan (`050-home` §6: menu ids 22000-28000, rows at `<menu id>+100/200/300`); the two new items take the next free ids in that scheme, slot rows `<menu id>+100…+600`.

| Item | `property id` | Icon (Estuary) | `onclick` | Default |
|------|---------------|----------------|-----------|---------|
| Moje filmy | `mil_mymovies` | `icons/sidemenu/movies.png` | `ActivateWindow(Videos,plugin://plugin.video.milionar/?action=mlist&kind=movies,return)` | on |
| Moje seriály | `mil_myseries` | `icons/sidemenu/tv.png` | `…kind=series…` | on |
| Filmy, Seriály (Kodi library) | `movies`, `tvshows` | Estuary | Estuary | **off**: Home `<onload>` guarded by `!Skin.HasSetting(MilionarDefaultsV3)` sets `HomeMenuNoMovieButton`, `HomeMenuNoTVShowButton`, then `MilionarDefaultsV3` |

Skin bools `HomeMenuNoMilMyMoviesButton`, `HomeMenuNoMilMySeriesButton`
(default unset = shown) in the skin settings "Milionář" section like the
other items.

## 2. Slot system

Every Milionář section (Pokračovat, Moje filmy, Moje seriály, MyTV,
MyCinema, Milionář, AI, Kraska, TMDb / ČSFD) has **6 slots**. Per slot, skin
strings:

| Skin string | Values | Meaning |
|-------------|--------|---------|
| `mil.<sec>.<n>.type` | a row id from §3 or `off` | what the slot shows |
| `mil.<sec>.<n>.limit` | 10 / 20 / 30 / 50 | items |
| `mil.<sec>.<n>.sort` | row-specific (§3) | order |
| `mil.<sec>.<n>.style` | `poster` / `landscape` / `episode` | `WidgetListPoster`, `WidgetListPoster` with landscape art, `WidgetListEpisodes` |

Per-section behaviour bools: `mil.<sec>.hidewatched` (Moje filmy, Moje
seriály rows), `mil.<sec>.upcoming` (show unaired next episodes with date;
Pokračovat and Moje seriály; default **on**, decision 10).

- Skin XML: per section one widget group; per slot three widget variants
  (one per style), each `<visible>` on
  `!String.IsEqual(Skin.String(mil.<sec>.<n>.type),off) +
  String.IsEqual(Skin.String(mil.<sec>.<n>.style),<style>)` (visibility, not
  include conditions, so changes apply without reloading the skin), content
  `plugin://plugin.video.milionar/?action=widget_row&row=$INFO[Skin.String(mil.<sec>.<n>.type)]&limit=…&sort=…&hw=…&up=…&reload=$INFO[Window(Home).Property(milionar.widgets.token)]`,
  header from a `$VAR` that maps the row id to its string. Hidden variants
  do not load content (verify the cost in L4: Home ready time within +10 %
  of today's).
- `widget_row` goes through the `main.py` fast path and reads only the store
  and the metadata cache (no network).
- Defaults are written once by Home `<onload>` guarded by
  `!Skin.HasSetting(MilionarSlotsV1)` (§3 "Default"); "Obnovit výchozí widgety"
  per section resets them. Existing user choices from the old fixed rows are
  not migrated (the slots start with the defaults, which reproduce today's
  rows for MyTV, MyCinema, Milionář, AI, Kraska, TMDb / ČSFD).

## 3. Row catalogue

| Section | Row id | Content | Sorts | Default slot (limit 20) |
|---------|--------|---------|-------|--------------------------|
| Pokračovat | `cont_movies` | in-progress movies (050 §3) | activity | 1, landscape |
| | `cont_series` | series next-up / in-progress / upcoming (050 §3) | activity | 2, episode |
| | `recent_played` | `play_log` latest distinct titles | time | 3, poster |
| | `widget_mytv_next`, `widget_mytv_channels` | the MyTV widgets "Další epizody" / "Moje kanály" (user, 2026-10-02: MyTV is a second "continue" line); offered only in the manager, never a default; fixed style as in MyTV | - | - |
| Moje filmy | `my_movies_progress` | in-progress movies in the list | activity | 1, landscape |
| | `my_movies_added` | list by `list_added_at` | added | 2, poster |
| | `my_movies_unwatched` | never played | added / title / rating / random | 3, poster |
| | `my_movies_genres` | genres of list movies → filtered listing | name | 4, categories |
| | `my_movies_watched` | watched, newest first | time | — |
| | `my_movies_all` | whole list | title / year / rating / added | — |
| Moje seriály | `my_series_next` | next-up episode of each list series | activity | 1, episode |
| | `my_series_new` | list series with an episode aired in the last 14 days and unwatched | air date | 2, episode |
| | `my_series_added` | list by `list_added_at` | added | 3, poster |
| | `my_series_unwatched` | list series never started | added / title / rating | 4, poster |
| | `my_series_genres` | genres → filtered listing | name | 5, categories |
| | `my_series_upcoming` | next unaired episode per list series with date | air date | — |
| | `my_series_all` | whole list | title / year / added | — |
| MyTV, MyCinema, Milionář, AI, Kraska, TMDb / ČSFD | the existing rows (`docs/plan/skin-milionar/050` §3, `060` §5) as row ids | as today | as today | today's rows in today's order |

Genre rows use `WidgetListCategories` (style ignored); their items open
`mlist&kind=movies|series&genre=<tmdb genre id>`.

## 4. Clicks

**Update 2026-10-01 (user: Netflix / Apple TV like):** rows of films in progress and Continue rows resume at once (as
below); browse rows (Nedávno přidané, Nezhlédnuté, Zhlédnuté, Všechny, and the "V Filmy" search rows) open our details
dialog, where Play is the first button; series items open their seasons; the lists keep `default_movie_action`.

- Continue rows: `skin_run` → `mplay_req` with `src=last`, `from=resume`
  (decision 4); upcoming items → notification with the air date.
- Rows of My movies / My series: movie and episode items are the canonical
  playable URLs (Kodi's own select behaviour, including its resume prompt);
  series items open the seasons listing.

## 5. Skin settings UI

- Section "Milionář": per section a button "- Widgety" opening the widget manager (window `Custom_1123_MilionarRows.xml`,
  details below, "Update 2026-10-02").
- Strings cs/sk/en from the next free skin id after the existing #319xx.

## 6. Result

Built 2026-10-01 (awaiting the user's test, **not yet accepted**):

- **Rows** (`wcs/library2/rows.py`, `main.py` fast path `action=widget_row&row=<id>&limit&sort&style&hw&up`): the whole
  catalogue of §3 for Pokračovat / Moje filmy / Moje seriály from the store and `meta` (no network, no Kodi library
  data); the other sections' rows are the old `widget_*` builders addressed by the same parameter. Clicks as §4: Continue
  items `skin_run` -> `mplay_req src=last` (resume or start), unaired -> notification, movies / episodes canonical URLs,
  series -> seasons listing, genre rows -> `mlist&kind=...&genre=<id>` (the filtered listing has no buttons on top).
  Series posters carry the watched / total counters (the Estuary badge), landscape style puts the backdrop into the
  poster slot. Times: 40-120 ms per row.
- **Defaults and names (user, 2026-10-01):** at most 3 rows per section by default (Filmy: Rozkoukané, Nedávno přidané,
  Žánry; Seriály: Další díly, Nové díly, Žánry; Pokračovat unchanged), the editor still offers every row and 6 slots
  (defaults re-applied once through `MilionarSlotsV2`). The Home menu items are named **Filmy** and **Seriály** like Kodi's
  own (skin strings 31916 / 31917); Kodi's Filmy / Seriály are hidden by default (and were hidden again for the user).
  Menu order: Pokračovat, Filmy, Seriály, MyTV, MyCinema, Milionář, AI doporučení, TMDb / ČSFD, Videa, Doplňky.
- **Slots** (`scripts/skin_harness/gen_slots.py` -> `Includes_MilionarSlots.xml`, 9 sections x 6 slots x 3 variants): at
  most one variant per slot is active (include condition on the slot's skin strings `mil.<sec>.<n>.type|style`); content,
  header, limit, sort come from the strings. The generated file is checked by a unit test.
  **Found live:** include conditions are evaluated when the skin loads, so the editor and the defaults finish with
  `ReloadSkin()` (and reopen the editor); an empty row (no items) is hidden by Estuary and is refilled when Home is
  entered again, not while it stays open.
- **Defaults** `wcs/skin/slots.py` (`skin_slots_defaults`, once from Home `<onload>` guarded by `MilionarSlotsV1`): the
  table of §3; the old rows of MyTV, MyCinema, Milionář, AI, Kraska, TMDb / ČSFD are their slots with their old styles.
  Upcoming switch on for Pokračovat and Moje seriály (decision 10).
- **Widget manager (user, 2026-10-02; replaces the first editor):** the user-visible word is "widget" (not "řádek"). Window 1123
  = the active widgets of one section as a numbered table on a dark card (left; header "Aktivní widgety · 3 / 6" and the column
  title "Počet · Řazení · Styl", "count · sort · style" on the right of each row) + a column of buttons
  (right, in three captioned groups): "Vybraný widget" (Nahoru, Dolů, Upravit, Odebrat), "Sekce" ("Skrýt zhlédnuté" / "Zobrazit
  nevyšlé díly" only where the section has them, "Obnovit výchozí widgety"), then Uložit, Zrušit; the last list row "+ Přidat widget" (max 6, hidden when full, a content is used
  once per section). Everything goes into a draft (`Window(Home).Property(milionar.wm)`, mirrored to skin strings
  `mil.edit.*` for the labels); **Uložit** writes the slots packed from 1 and runs one `ReloadSkin()`; **Zrušit** and Back ask
  "Zahodit neuložené změny?" only if something changed (Back = invisible button 9200 that hands over to `op=cancel`, because a
  window closes on Back unless a control navigates). "Upravit" (or a click on the row) opens one select window with the
  values "Obsah / Počet položek / Řazení / Styl / Hotovo" (a click changes that value only and returns; the old MyTV / TMDb
  widgets have only "Obsah"). Entry points: skin settings "Milionář" -> "- Widgety"; the context menu of a library item in a Home widget (user, 2026-10-02:
  "Upravit widgety" is the last entry of the "Další…" submenu; the service publishes the section of the selected main menu
  item as `milionar.focus.sec`, `ctx_open&sec=`); and the **Info key** on a Home main menu
  item that owns widgets (`<oninfo>` on control 9000, `skin_menu_item`). Kodi has no context menu on static `<content>`
  lists (`CStaticListProvider` has no `OnContextMenu`, checked in the 21.3 source), so the planned context entry on the
  menu item is not possible. Code: `wcs/skin/slots.py` (`open_manager`, `wm_op`, `edit_widget`, `commit`).
  Addon strings 32300-32372, 32374 and skin strings 31954-31959, 31981-31986.
- Fork: `Includes_Home.xml` `WidgetListPoster` got the param `widget_limit` (default 15, like `WidgetListEpisodes`);
  `baseline.py difftree`: 28 files differ, 0 not allowed.
- Fix after the user's first test: style "Široký obrázek" (`landscape`) uses the wide `WidgetListEpisodes` cards (the poster card only cropped the backdrop); `gen_slots.py` maps `poster` -> `WidgetListPoster`, `episode | landscape` -> `WidgetListEpisodes`.
- **Tests: 141 green** (`test_rows.py` 12, `test_slots.py` 8); after the widget manager 2026-10-02: 166 green (`test_slots.py` 16).
- **Live** (fixture provider for Continue data, removed afterwards): Pokračovat shows "Rozkoukané filmy", "Další díly
  seriálů" and "Naposledy přehrané"; Moje filmy / Moje seriály show their default rows, genre rows and badges; MyTV,
  MyCinema, Milionář, AI, TMDb / ČSFD show the same rows as before (3 / 12, 0 / 0, 8, 11, 20 / 20 / 4 items); editor
  changed slot 6 of Moje seriály to "Připravované díly" and the row appeared after the reload; skin settings section
  captured; defaults re-applied after Skin.Reset(MilionarSlotsV1) with an automatic reload.
- Home ready time (Pokračovat, 3 rows with data): 0.6-0.8 s measured through the harness (poll overhead included);
  no earlier number exists to compare (050-home §6 says it was never measured).
