From e36c95386533c0519998d139c655a2b2f02de9a8 Mon Sep 17 00:00:00 2001 From: 4gray Date: Sun, 3 May 2026 23:26:52 +0200 Subject: [PATCH] feat(sidebar): implement shared collapse state for live-TV sidebar across components Entire-Checkpoint: f957cd9849e0 --- docs/architecture/iptvnator-ui-guidelines.md | 30 +++++--- .../unified-collection-page.component.ts | 20 ++---- libs/portal/shared/util/src/index.ts | 1 + .../lib/live-layout-sidebar-state.service.ts | 31 ++++++++ .../stalker-live-stream-layout.component.html | 2 +- .../stalker-live-stream-layout.component.ts | 20 ++---- .../live-stream-layout.component.html | 2 +- .../live-stream-layout.component.spec.ts | 27 +++++++ .../live-stream-layout.component.ts | 20 ++---- ...space-shell-context-sidebar.component.html | 1 + ...space-shell-context-sidebar.component.scss | 16 +++++ ...ce-shell-context-sidebar.component.spec.ts | 71 +++++++++++++++++++ ...rkspace-shell-context-sidebar.component.ts | 27 ++++++- 13 files changed, 214 insertions(+), 54 deletions(-) create mode 100644 libs/portal/shared/util/src/lib/live-layout-sidebar-state.service.ts diff --git a/docs/architecture/iptvnator-ui-guidelines.md b/docs/architecture/iptvnator-ui-guidelines.md index ac461ba70..3759ab258 100644 --- a/docs/architecture/iptvnator-ui-guidelines.md +++ b/docs/architecture/iptvnator-ui-guidelines.md @@ -147,20 +147,32 @@ The shared row should be reused instead of rebuilding channel markup per view. - M3U, Xtream, and Stalker live layouts share a single sidebar collapse toggle that hides the channels rail to give the player and EPG full width. -- Collapsed state is persisted in `live-sidebar-state` (helpers in - `@iptvnator/portal/shared/util`); missing or invalid values restore to - expanded. The state is global across all three modules so the user's choice - carries across portals and reloads. +- In Xtream and Stalker live TV, the same toggle also collapses the workspace + shell context sidebar (the "Live Categories" rail rendered by + `WorkspaceShellContextSidebarComponent`), matching M3U's "everything quiets" + behaviour. The shell categories rail only collapses when the active section + is `live` (Xtream) or `itv` (Stalker); movies, series, favorites, and recent + routes leave it untouched. +- Collapsed state is owned by `LiveLayoutSidebarStateService` + (`providedIn: 'root'`) in `@iptvnator/portal/shared/util`. Every surface that + participates injects the service and reads `isCollapsed`; any toggle calls + `service.toggle()`. Persistence delegates to the existing + `live-sidebar-state` helpers, so the localStorage key stays unchanged and + missing/invalid values restore to expanded. - A `mat-icon-button` with `chevron_left` lives in the sidebar header and toggles state. While collapsed, a floating `chevron_right` mini-fab appears - at the left edge of `.content-container` to restore the rail. + at the left edge of `.content-container` to restore the rail (and the + categories rail, in Xtream/Stalker live). - Keyboard shortcut: `Cmd/Ctrl+B`. The handler ignores events that originate inside ``, `