From b6b18d72699636ff9c65a4574afdc52c72b89241 Mon Sep 17 00:00:00 2001 From: 4gray Date: Sun, 6 Sep 2026 10:55:02 +0200 Subject: [PATCH] fix(live-tv): migrate the live navigation helpers to the per-surface sidebar API master (#1554) added `XtreamLiveChannelNavigationService` and `stalker-live-navigation.ts`, which expand the rail through `sidebar.setState('expanded')` on the pre-split signature. Point them at the `portal` surface and update their specs; drop the now-unused hidden-state stub from the Xtream layout spec, which master pushed to the max-lines budget. Co-Authored-By: Claude Fable 5.1 --- .../stalker-live-navigation.spec.ts | 2 +- .../stalker-live-navigation.ts | 2 +- .../live-stream-layout.component.spec.ts | 20 +++++-------------- ...am-live-channel-navigation.service.spec.ts | 2 +- .../xtream-live-channel-navigation.service.ts | 2 +- 5 files changed, 9 insertions(+), 19 deletions(-) diff --git a/libs/portal/stalker/feature/src/lib/stalker-live-stream-layout/stalker-live-navigation.spec.ts b/libs/portal/stalker/feature/src/lib/stalker-live-stream-layout/stalker-live-navigation.spec.ts index 2c1ab2dcc..67c85fd88 100644 --- a/libs/portal/stalker/feature/src/lib/stalker-live-stream-layout/stalker-live-navigation.spec.ts +++ b/libs/portal/stalker/feature/src/lib/stalker-live-stream-layout/stalker-live-navigation.spec.ts @@ -209,7 +209,7 @@ describe('StalkerLiveNavigation', () => { ); expect(store.selectedCategoryId()).toBe('news'); expect(store.searchPhrase()).toBe(''); - expect(sidebar.setState).toHaveBeenCalledWith('expanded'); + expect(sidebar.setState).toHaveBeenCalledWith('portal', 'expanded'); expect(revealRow).toHaveBeenCalledWith('1'); expect(play).not.toHaveBeenCalled(); expect(navigation.canReveal()).toBe(false); diff --git a/libs/portal/stalker/feature/src/lib/stalker-live-stream-layout/stalker-live-navigation.ts b/libs/portal/stalker/feature/src/lib/stalker-live-stream-layout/stalker-live-navigation.ts index ed1fc0fb3..612f6a4b6 100644 --- a/libs/portal/stalker/feature/src/lib/stalker-live-stream-layout/stalker-live-navigation.ts +++ b/libs/portal/stalker/feature/src/lib/stalker-live-stream-layout/stalker-live-navigation.ts @@ -266,7 +266,7 @@ export class StalkerLiveNavigation { this.options.store.setSearchPhrase(''); this.options.store.setSelectedCategory(category); this.options.store.setPage(0); - this.options.sidebar.setState('expanded'); + this.options.sidebar.setState('portal', 'expanded'); this.revealed.set({ owner, category, item: active }); this.pendingReveal.set({ owner, diff --git a/libs/portal/xtream/feature/src/lib/live-stream-layout/live-stream-layout.component.spec.ts b/libs/portal/xtream/feature/src/lib/live-stream-layout/live-stream-layout.component.spec.ts index c5fc33aab..a1a60ed0d 100644 --- a/libs/portal/xtream/feature/src/lib/live-stream-layout/live-stream-layout.component.spec.ts +++ b/libs/portal/xtream/feature/src/lib/live-stream-layout/live-stream-layout.component.spec.ts @@ -40,10 +40,7 @@ import { RecordingStoppedEvent, ResolvedPortalPlayback, } from '@iptvnator/shared/interfaces'; -import { - ChannelListHiddenStateComponent, - GridListComponent, -} from '@iptvnator/portal/shared/ui'; +import { GridListComponent } from '@iptvnator/portal/shared/ui'; import { PortalChannelsListComponent } from '../portal-channels-list/portal-channels-list.component'; import { LiveStreamLayoutComponent } from './live-stream-layout.component'; import { RuntimeCapabilitiesService, SettingsStore } from '@iptvnator/services'; @@ -135,15 +132,6 @@ class StubEpgTimelineComponent { }) class StubResizableDirective {} -@Component({ - selector: 'app-channel-list-hidden-state', - standalone: true, - template: '', -}) -class StubChannelListHiddenStateComponent { - readonly restore = output(); -} - describe('LiveStreamLayoutComponent', () => { let fixture: ComponentFixture; let component: LiveStreamLayoutComponent; @@ -328,7 +316,6 @@ describe('LiveStreamLayoutComponent', () => { .overrideComponent(LiveStreamLayoutComponent, { remove: { imports: [ - ChannelListHiddenStateComponent, EpgListViewComponent, EpgTimelineComponent, GridListComponent, @@ -340,7 +327,6 @@ describe('LiveStreamLayoutComponent', () => { }, add: { imports: [ - StubChannelListHiddenStateComponent, StubEpgTimelineComponent, StubGridListComponent, StubPortalChannelsListComponent, @@ -1152,6 +1138,10 @@ describe('LiveStreamLayoutComponent', () => { ); }); + // Collapsing with a selected category and no stream renders the real + // `app-channel-list-hidden-state` (its TranslatePipe needs a + // TranslateService); this spec is at the max-lines budget, so that branch + // is covered by video-player-sidebar.spec.ts and the Electron E2E instead. it('shows the floating restore button when the sidebar is collapsed even without a selected category', () => { selectedCategoryId.set(null); TestBed.inject(LiveLayoutSidebarStateService).setState('portal', 'collapsed'); diff --git a/libs/portal/xtream/feature/src/lib/live-stream-layout/xtream-live-channel-navigation.service.spec.ts b/libs/portal/xtream/feature/src/lib/live-stream-layout/xtream-live-channel-navigation.service.spec.ts index b7b75d76c..b1fcb47a3 100644 --- a/libs/portal/xtream/feature/src/lib/live-stream-layout/xtream-live-channel-navigation.service.spec.ts +++ b/libs/portal/xtream/feature/src/lib/live-stream-layout/xtream-live-channel-navigation.service.spec.ts @@ -187,7 +187,7 @@ describe('XtreamLiveChannelNavigationService', () => { ); expect(selectedCategoryId()).toBe(10); expect(categorySearchTerm()).toBe(''); - expect(sidebar.setState).toHaveBeenCalledWith('expanded'); + expect(sidebar.setState).toHaveBeenCalledWith('portal', 'expanded'); expect(service.revealRequest()).toEqual( expect.objectContaining({ channelId: 1 }) ); diff --git a/libs/portal/xtream/feature/src/lib/live-stream-layout/xtream-live-channel-navigation.service.ts b/libs/portal/xtream/feature/src/lib/live-stream-layout/xtream-live-channel-navigation.service.ts index aab1bd65a..f02e62f4c 100644 --- a/libs/portal/xtream/feature/src/lib/live-stream-layout/xtream-live-channel-navigation.service.ts +++ b/libs/portal/xtream/feature/src/lib/live-stream-layout/xtream-live-channel-navigation.service.ts @@ -232,7 +232,7 @@ export class XtreamLiveChannelNavigationService { return; this.store.setCategorySearchTerm(''); this.store.setSelectedCategory(categoryId); - this.sidebar.setState('expanded'); + this.sidebar.setState('portal', 'expanded'); this.pendingReveal.set({ channelId: target.xtream_id, categoryId,