diff --git a/libs/portal/stalker/feature/src/lib/stalker-live-stream-layout/stalker-live-stream-layout.component.spec.ts b/libs/portal/stalker/feature/src/lib/stalker-live-stream-layout/stalker-live-stream-layout.component.spec.ts index 0a78fb557..3070f72ac 100644 --- a/libs/portal/stalker/feature/src/lib/stalker-live-stream-layout/stalker-live-stream-layout.component.spec.ts +++ b/libs/portal/stalker/feature/src/lib/stalker-live-stream-layout/stalker-live-stream-layout.component.spec.ts @@ -782,7 +782,7 @@ describe('StalkerLiveStreamLayoutComponent', () => { ).toEqual([]); }); - it('grows the render window to include a channel selected beyond it (remote/numeric nav)', async () => { + it.each([true, false])('grows the render window for remote/numeric selection (cached=%s)', async (cached) => { const full = Array.from({ length: 250 }, (_, index) => ({ id: `ch-${index}`, cmd: `ffrt4://itv/${index}`, @@ -791,9 +791,10 @@ describe('StalkerLiveStreamLayoutComponent', () => { logo: '', })); itvFullListActive.set(true); - itvSelectedCategoryFromCache.set(true); + itvSelectedCategoryFromCache.set(cached); itvChannels.set(full); - itvFullChannelList.set(full); + itvFullChannelList.set(cached ? full : []); + searchPhrase.set('channel'); fixture.detectChanges(); expect(component.visibleChannels()).toHaveLength(100); diff --git a/libs/portal/stalker/feature/src/lib/stalker-live-stream-layout/stalker-live-stream-layout.component.ts b/libs/portal/stalker/feature/src/lib/stalker-live-stream-layout/stalker-live-stream-layout.component.ts index e0a460783..b6188c2cf 100644 --- a/libs/portal/stalker/feature/src/lib/stalker-live-stream-layout/stalker-live-stream-layout.component.ts +++ b/libs/portal/stalker/feature/src/lib/stalker-live-stream-layout/stalker-live-stream-layout.component.ts @@ -1020,13 +1020,13 @@ export class StalkerLiveStreamLayoutComponent } /** - * In full-list mode the rendered list is windowed to `renderLimit`. When a + * Cached categories and search results are windowed to `renderLimit`. When a * channel beyond that window is selected (remote channel-up/down, numeric * select), grow the window so the selection is actually in the DOM and can * be highlighted/scrolled to instead of drifting off-window. */ private ensureChannelWithinRenderWindow(channelId: string): void { - if (!this.isCategoryFromCache()) { + if (this.visibleChannels().length === this.filteredChannels().length) { return; }