fix(stalker): keep live playback when switching the ITV/radio category (#1517)

Switching the Live TV or radio category in the shell context panel tore
down the Stalker player: `onStalkerCategoryClicked` cleared the selected
item for every section, and the live layout gates its player on
`selectedItem`. Xtream live (#936) and M3U groups already keep the channel
playing across a category/group switch.

- Context panel: return before `clearSelectedItem()` for `itv`/`radio`;
  VOD/series clicks still drop the open detail before navigating.
- Live layout: the category-change reset effect no longer wipes the
  playing channel's short-EPG fallback or cancels a fallback load in
  flight; only a section change (itv <-> radio) does that now.
- Regression coverage in the context panel spec, the live layout spec and
  a new web E2E scenario; docs and a `.changes/` note added.

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
4grayandClaude Fable 5.1 authored and GitHub committed 2026-09-03 21:42:50 +02:00
1 parent 308ed9cb41
commit 2fc1bd5601
9 files changed
+258 -3

No files matched your search

+6
View File
@@ -310,6 +310,12 @@ therefore falls back to `get_short_epg` when:
The fallback is merged with the bulk list rather than replacing it, so the
panel shows "now" from the short EPG and the days ahead from the bulk guide.
The fallback is keyed to the selected channel, not to the category: a category
switch in the sidebar leaves the channel playing and keeps its fallback (and a
fallback load still in flight) intact. It is dropped when the selection moves
to another channel or when the view leaves ITV for radio, where the route
session clears the selection.
The stored fallback is tagged with the channel it was fetched for and the
merge only applies while that channel is still selected — a channel switch
moves the selection synchronously, while the old fallback is replaced only
+14
View File
@@ -1251,6 +1251,20 @@ The Stalker live route and radio route intentionally share
- Some Stalker portals do not expose radio categories. Radio category loading
falls back to a synthetic `PORTALS.ALL_RADIO` category with
`category_id: '*'` so the station list can still be loaded.
- A category click in the shell context panel only re-filters the channel
sidebar; the selected channel or station keeps playing (Xtream live #936 and
M3U group parity). `onStalkerCategoryClicked` therefore must NOT
`clearSelectedItem()` for `itv`/`radio` — the layout gates its player on
`selectedItem` — while VOD/series clicks still drop the open detail before
navigating to the list route. The layout's category-change reset effect
clears only list state (channels on the legacy paged flow, page, row EPG
previews); the active channel's short-EPG fallback and a fallback load still
in flight belong to the selection and survive the switch. Only a section
change (`itv` ↔ `radio`, where the route session clears the selection)
invalidates that request and drops the fallback. A playing channel outside
the newly selected category simply has no highlighted row, and remote
channel up/down finds no neighbour until a channel from the visible list is
played.
## Full ITV Channel List Cache
+8
View File
@@ -146,6 +146,14 @@ default. The panel header exposes a sort menu next to category search with
synthetic "all categories" entries stay pinned before sorted provider
categories.
A category click in a LIVE section (Xtream `live`, Stalker `itv` and `radio`)
changes only the selected category: the live layouts gate their player on the
store's selected item, so the handler must not clear it — the channel the user
is watching keeps playing while the sidebar re-filters (Xtream: #936; Stalker:
`onStalkerCategoryClicked` returns before `clearSelectedItem()`). VOD and
series category clicks do drop the open detail (`setSelectedItem(null)` /
`clearSelectedItem()`) because they navigate to a list route.
## Search And Navigation Rules
Search is shell-owned and route-aware: