fix(portals): stop live channels sidebar sharing width storage with shell panel (#1114)

The live-layout channels sidebar (Xtream and Stalker) persisted its
width under the shared "sidebar-width" localStorage key — the same key
used by the workspace shell context panel. Unlike the shell panel
variants, which swap in one slot and never coexist, the channels
sidebar is on screen at the same time as the category context panel,
so resizing either one silently overwrote the other's stored width and
both snapped to the same size after a reload.

Give the live channels sidebar its own "live-channels-sidebar-width"
key (shared between Xtream and Stalker, which never coexist), matching
the precedent already set by unified-live-tab-sidebar-width and
m3u-groups-nav-width. The unified key remains in place for the shell
slot panels, where sharing is intentional.

Co-authored-by: Pavel <paveljevstignejev@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
authored and GitHub committed 2026-07-04 16:17:44 +02:00
1 parent 57ba1977a1
commit 342175fe76
4 files changed
+31 -2

No files matched your search

@@ -8,7 +8,7 @@
[minWidth]="250"
[maxWidth]="600"
[defaultWidth]="400"
storageKey="sidebar-width"
storageKey="live-channels-sidebar-width"
>
<div class="sidebar-header category-content-header">
<div class="category-meta">
@@ -621,6 +621,20 @@ describe('StalkerLiveStreamLayoutComponent', () => {
expect(stalkerStore.setItvChannels).not.toHaveBeenCalled();
});
it('persists the channels sidebar width under a dedicated storage key', () => {
// The shell context panel (category sidebar) is visible at the same
// time as this sidebar and persists its width under the shared
// "sidebar-width" key. Reusing that key here makes the two panels
// overwrite each other's stored width across reloads.
fixture.detectChanges();
const sidebar: HTMLElement =
fixture.nativeElement.querySelector('.sidebar');
expect(sidebar.getAttribute('storageKey')).toBe(
'live-channels-sidebar-width'
);
});
it('keeps row previews empty before bulk epg is loaded', async () => {
fixture.detectChanges();
await fixture.whenStable();
@@ -9,7 +9,7 @@
[minWidth]="250"
[maxWidth]="600"
[defaultWidth]="400"
storageKey="sidebar-width"
storageKey="live-channels-sidebar-width"
>
<div class="sidebar-header">
<div class="category-heading">
@@ -1089,6 +1089,21 @@ describe('LiveStreamLayoutComponent', () => {
).toBeNull();
});
it('persists the channels sidebar width under a dedicated storage key', () => {
// The shell context panel (category sidebar) is visible at the same
// time as this sidebar and persists its width under the shared
// "sidebar-width" key. Reusing that key here makes the two panels
// overwrite each other's stored width across reloads.
selectedCategoryId.set(1);
fixture.detectChanges();
const sidebar: HTMLElement =
fixture.nativeElement.querySelector('.sidebar');
expect(sidebar.getAttribute('storageKey')).toBe(
'live-channels-sidebar-width'
);
});
describe('auto-open from Ctrl+F search navigation state', () => {
const searchChannel = {
xtream_id: 202,