# Home menu manager

2026-10-29: menu ordering/visibility uses the same `MenuManager` controller and
`DialogMilionarContextManager.xml` as the widget context/hero editors. The
Appearance settings section opens this manager; individual section toggles and
widget shortcuts are no longer duplicated in a flat settings list.

- Move up/down within the enabled or hidden group, show/hide, open that item's
  existing widget manager, restore default order, Save/Cancel.
- Default order preserves draft visibility. Widget edits remain in their own
  existing transaction; returning restores the menu draft and selected item.
- Save/Cancel, dirty state and reorder logic are shared with the existing editor.
  Unavailable moves and unchanged Save are disabled; focus has one primary state.
- Store stable IDs in hidden text `skin_menu_order` (never reset by numeric/bool
  defaults). Existing visibility flags remain the only source of hidden state.
- Compose the ordered static Home through `modular.plan(order=...)`, both on Save
  and installation/style changes. Only changed Home.xml is replaced atomically
  on Save, with one ReloadSkin. Home has no plugin request, polling or new network
  work; widget data/UIDs/settings are never rewritten by menu ordering.
- Normalize invalid/duplicate/removed IDs and append newly introduced entries.
  Per-item actions, icons, IDs, visibility conditions and navigation stay intact.

Verification: `test_home_menu.py`, `test_navigation.py`, `test_shared_context.py`,
`test_picker.py`, `test_modular.py` and installer tests; real Kodi covers save,
discard, show/hide, child widget manager return, restart persistence and the four
presentation combinations. Evidence: `docs/design/home-menu-manager/`.

The development addon was never installed/updated from a release package.

Acceptance: 200 targeted checks passed. Real Kodi preserved all 925 persistent
widget values and restored all 11 original visibility flags after testing.
Right-arrow navigation targets the first enabled action, including list limits.
The Appearance dialog has an explicit Close button and a visible default focus;
the shared editor has a safe Cancel fallback before its dynamic list fills.
All four combinations have native screenshots; no deployment was requested for
this iteration. The development sync command also retains installed item order.

Final focus acceptance: three consecutive real Kodi open/category/menu/close
cycles passed without focus, XML or Python errors. List focus is queued after
Kodi binds its dynamic items; no timer or polling was added. Runtime ZIP XML
validation passed and the temporary verification helper was removed.
