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

+38
View File
@@ -462,6 +462,44 @@ test('@stalker PWA hides EPG for ITV channel', async ({ page }) => {
expect(shortEpgRequests).toHaveLength(0);
});
test('@stalker ITV playback survives a category switch', async ({ page }) => {
// Regression: the shell context panel used to clear the selected Stalker
// item on every category click, tearing down the player for a channel the
// user never switched away from. Xtream live (#936) and M3U groups keep
// playing across a category/group switch; Stalker must too.
await addStalkerPortal(page);
await page.getByRole('link', { name: /live|itv/i }).click();
await page.waitForURL(/stalker.*itv/);
const categories = page.locator('.category-item');
await expect(categories.nth(1)).toBeVisible({ timeout: 10_000 });
await categories.nth(1).click();
const sidebar = page.locator('app-stalker-live-stream-layout .sidebar');
const sidebarTitle = sidebar.locator('.category-title');
const channels = page.locator('[data-test-id="channel-item"]');
await expect(channels.first()).toBeVisible({ timeout: 20_000 });
const firstCategoryTitle = (await sidebarTitle.textContent())?.trim() ?? '';
expect(firstCategoryTitle).not.toBe('');
await channels.first().click();
await expect(channels.first()).toHaveClass(/active/, { timeout: 20_000 });
const player = page.locator('app-web-player-view');
await expect(player).toBeVisible({ timeout: 20_000 });
await categories.nth(2).click();
// The sidebar re-filters to the new category (proves the click landed and
// change detection ran)…
await expect(sidebarTitle).not.toHaveText(firstCategoryTitle, {
timeout: 20_000,
});
await expect(channels.first()).toBeVisible({ timeout: 20_000 });
// …while the channel picked from the previous category keeps playing.
await expect(player).toBeVisible();
});
test('@stalker radio — stations use the inline audio player without EPG', async ({
page,
}) => {