fix(stalker): reveal remote selections in uncached search results

This commit is contained in:
4gray committed 2026-09-06 08:22:00 +02:00
1 parent 08415139c5
commit a81a2f8f57
2 files changed
+6 -5

No files matched your search

@@ -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);
@@ -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;
}