Dashboard and remote control flow
The workspace shell gives IPTVnator one frame for source navigation, search, settings, routed content, and playback. The dashboard turns activity from M3U, Xtream, and Stalker sources into return paths and live programme context, while the desktop remote-control web app sends live-playback commands through the Electron process to the active player. The shell also keeps settings discovery aligned with the controls that the current runtime can show. See Dashboard and remote control for the wider feature map.
Workspace shell
The workspace shell is the persistent application frame around the main product views. It keeps shared navigation, search, source actions, playback context, and route content in one place while the active view changes.
Workspace frame
The frame combines the navigation rail, header, optional context panel, routed content, import feedback, server status, and external-playback footer. The content frame expands or contracts beside the context panel instead of making the routed page jump. The shell keeps the content surface separate from its scroller, so its page shape remains stable while routed content moves. libs/…/workspace-shell.component.html assembles these surfaces. The rail uses theme-aware active states and changes from a vertical bar to a horizontally scrollable bar on narrow screens, so the same workspace links remain available across device sizes.
On a phone, the context panel becomes a modal drawer. The shell makes the rail, header, content, and playback footer inert while the drawer is open, traps focus in the drawer, and restores focus to the drawer toggle or the new route when it closes. It also places the drawer above workspace surfaces but below dialogs, and uses a backdrop as a second close path. Native player surfaces are also hidden while this drawer is open. This gives the same context navigation a safe behavior across screen sizes and playback modes.
The shell uses a layout slide for changes that move header controls or the content frame. The slide applies the new layout at once and animates only the visible movement, then records the new positions for the next change. Reduced-motion settings remove the animation without changing the layout result.
The shell warms the web-player resources after the first screen settles and the page is idle. This keeps the initial view light while preparing the first list or portal view that needs playback. If the warm-up fails, the route that needs the player can load it again.
References: libs/…/workspace-shell.component.html• L1-153 libs/…/workspace-shell.component.ts• L94-159 libs/…/workspace-shell.component.scss• L8-264 libs/…/workspace-shell-context-sidebar.component.scss• L87-187 libs/…/layout-slide.directive.ts• L17-30 libs/…/warm-player-chunk.ts• L7-45 libs/…/workspace-shell-rail.component.scss• L187-259
Workspace header
The header is the shell's shared control surface. It presents page back navigation, playlist context, search, command access, source actions, parental-lock state, route actions, and desktop download activity according to the current route and runtime.
The header derives its playlist title and subtitle from the active route context. It exposes playlist information, account information, refresh, global search, recent and favorite views, and downloads only when the current context supports them. Live routes also receive a route-aware channel-list toggle, so the header and the live page operate on the same sidebar state rather than showing competing controls.
The header gives priority to navigation and search as space becomes limited. The playlist switcher yields width before the search field, scope labels hide on phones, and the command-palette entry stays available as a compact icon. This keeps the main workspace actions reachable in narrow browser and frameless desktop windows.
Settings is global, so the header hides playlist-scoped controls there while keeping global search and the add-source action available. Settings search remains available even when no playlist exists. On a phone, the header presents the context-drawer toggle when the current route has panel content. A page back action can use or yield that same leading slot so the header does not show two competing navigation icons.
When the header has too little room, lower-priority contextual actions move into one More actions menu. Back, the playlist switcher, search, and downloads keep their place. The menu appears only when moving at least two actions creates useful room, and it keeps a small return margin so resizing does not make actions flicker between the header and the menu.
References: libs/…/workspace-shell-header.component.html• L1-151 libs/…/workspace-shell-header.component.html• L299-386 libs/…/workspace-shell-header.component.ts• L74-227 libs/…/workspace-shell-header.component.ts• L388-471 libs/…/workspace-shell-header-overflow.ts• L1-102 libs/…/workspace-shell-header-overflow.spec.ts• L30-99 libs/…/workspace-shell-header.component.scss• L399-552
Workspace navigation
The /workspace route is the entry point for the main application flows. Startup preferences choose the first workspace destination, normally the dashboard, while shell route state turns the current route into provider context, header content, and navigation links. The route definitions in apps/…/app.routes.ts place the dashboard, sources, provider views, and global collections inside this frame.
The shell owns actions that cross route boundaries. A dashboard card can open the correct provider or collection view without replacing the playlist context shown in the header. Search follows the current view and can expand to desktop global search. Typed search keeps the visible input separate from the applied term, applies the term after a short pause, and preserves the active collection scope when it updates the URL. Scope clearing keeps the current search text while removing the category constraint. The open context drawer blocks shortcuts that would otherwise act on the page behind it.
Dashboard search is an entry point rather than a dashboard catalog filter. With an active Xtream context it opens that playlist's advanced search. Otherwise the desktop app can hand a non-empty term to global search when a searchable source exists; the PWA leaves the field out when no such search is available. Settings keeps its local search behavior.
Search capability changes with the data that the current route can query. Settings searches its local control index, a dashboard with Xtream context can hand off to provider search, and global search is available only in Electron when searchable playlists exist. Stalker live search reports a loaded-only mode until the required channel list is ready, so the interface does not promise results outside the data in memory.
Route state also separates focused download details from collection views. A download detail page or recording detail page hides the context panel and route search so the user can focus on the selected item.
Live layouts use a shell-provided category popover when their category rail is folded. The popover closes when the route or live-panel level changes, and a request to show the full categories panel moves the user back to the shell sidebar. This prevents a floating category view from outliving the live page that opened it.
The rail presents dashboard, source, global collection, and desktop-only global search links according to startup and runtime state. When a route has no direct provider context, the shell can use the active playlist to keep provider links available for the dashboard, sources, collections, and related workspace views. Provider links are grouped into primary and secondary sections, while settings remains a global footer action and the server status shortcut appears only when the server is active. On narrow screens the rail becomes a sideways-scrolling bar and keeps settings at the visible end. It also leaves room for frameless window controls and safe-area insets, so links remain clear of system or window chrome.
References: apps/…/app.routes.ts• L36-90 libs/…/workspace-shell.facade.ts• L101-161 libs/…/workspace-shell-route-state.service.ts• L46-163 libs/…/workspace-shell-route-state.service.ts• L173-213 libs/…/workspace-shell-rail.component.html• L1-51 libs/…/workspace-shell-rail.component.scss• L187-293 libs/…/workspace-shell-search.service.ts• L44-177 libs/…/workspace-shell-search.service.ts• L250-341 libs/…/workspace-shell-dashboard-search.ts• L25-83 libs/…/workspace-shell-search-sync.service.ts• L119-221 libs/…/workspace-shell-route-utils.ts• L44-90
Workspace context panel
The context panel narrows the current provider view to categories and related filters. It supports Xtream and Stalker category lists with search, a shared sort choice, load states, source-specific counts where available, and provider-specific management actions. The panel keeps search and category actions in a stable surface, while locked content appears as an explicit unlock row instead of an empty list.
The same panel can appear as the in-flow sidebar or as a live-category popover, and both presentations use the same sort state. Live routes can fold the sidebar to give more room to the player and channel list. The shell treats the folded panel as inactive for keyboard and screen-reader focus, then returns focus to a usable panel control when the rail opens again. The phone drawer does not use this folded state, and a blocked Xtream view keeps the sidebar available because its error surface has no other way to restore it.
Category controls reflect data readiness. Xtream rows and management actions stay disabled until the selected content type is ready, while loading rows can show count placeholders and an import or sync status. Stalker shows category counts only when its full live-TV list is available. The sidebar and the folded live-category popover share the same sort state, so changing the order in one presentation changes the other.
Category selection keeps provider behavior aligned with the active surface. Xtream live selection changes the visible category without clearing the channel that is playing. If the user is already on a category URL, the route is replaced while query state is preserved. Non-live selection clears the selected item and routes to the chosen category. Stalker live TV and radio selection resets the visible page and changes the channel scope without clearing the active item; non-live selection clears the item and routes to the chosen category. A phone drawer closes when a category is selected, and the popover receives a selection signal so its host can close it. Selecting an already active category clears that category scope while retaining the search text.
The panel also provides the category-level parental-lock path. Locked categories remain hidden behind an unlock row, right-click can open a direct lock action when enabled, and management dialogs verify that the user is still on the same playlist and section after the unlock, lock-store read, or lazy dialog load completes. Stalker category management also carries saved hidden categories and live-TV counts into the management surface when those values are available. If lock data cannot be read, the panel withholds categories and does not open a management dialog from an empty lock snapshot.
References: libs/…/workspace-context-panel.component.scss• L21-177 libs/…/workspace-context-panel.component.scss• L262-310 libs/…/workspace-context-panel.component.html• L1-250 libs/…/workspace-context-panel.component.ts• L136-269 libs/…/workspace-context-panel.component.ts• L390-503 libs/…/workspace-context-panel.component.ts• L526-814 libs/…/workspace-context-panel.component.spec.ts• L211-369 libs/…/workspace-context-panel.component.spec.ts• L621-834 libs/…/workspace-context-panel.component.spec.ts• L837-1266 libs/…/workspace-context-panel-route.utils.ts• L33-88 libs/…/workspace-shell-context-sidebar.component.scss• L18-187 libs/…/workspace-shell-context-sidebar.component.ts• L68-146 libs/…/workspace-shell-context-sidebar.component.spec.ts• L180-356
Workspace command palette
The command palette gives the shell one searchable entry point for visible workspace actions. It searches a command's label, description, and keywords, then groups the result by recent use, view, playlist, global scope, and settings. Recent enabled commands appear first when the query is empty, while settings commands appear only through the settings search result, so the palette supports both repeat actions and discovery without duplicating rows.
Before it opens, the palette waits for the desktop player capability probe when that probe is needed. A failed probe does not block the palette; it only removes commands that depend on the missing capability. The palette combines route commands, player commands, and settings commands, then checks that the selected command is still visible and enabled before it runs and becomes recent.
The palette keeps selection valid as filtering changes. Arrow keys move through enabled commands with wraparound, Enter returns the selected command to the shell, and Escape closes the dialog. The input receives focus when the palette opens, and input-method composition keys stay with the input, which makes the palette usable without a mouse and avoids treating an IME commit as command selection.
The shell builds commands from the current route and runtime. Provider views contribute navigation and playlist actions, global commands contribute workspace destinations and source actions, and registered view commands can add actions for the current surface. The header can therefore expose the same route-aware action through both its inline controls and the palette.
References: libs/…/workspace-command-palette.component.html• L1-62 libs/…/workspace-command-palette.component.ts• L27-218 libs/…/workspace-command-palette.component.ts• L221-342 libs/…/workspace-shell-command-builders.ts• L45-58 libs/…/workspace-shell-command-builders.ts• L60-321 libs/…/workspace-shell.facade.ts• L113-119 libs/…/workspace-command-palette.component.spec.ts• L409-613
Workspace settings search
Settings search gives the settings page and command palette one view of the controls that are available in the current runtime. It ranks translated labels, descriptions, and stable keyword aliases, then opens the relevant settings section and asks that page to reveal the selected row.
The search index follows the settings navigation order. Runtime capabilities hide sections and rows that the page cannot render, while dependent rows can point to a visible fallback control that makes them available. A lazy probe adds native-player rows only after the desktop runtime gives a final answer, and the settings page stops following an inconclusive probe when it closes.
The shared index covers dashboard and remote-control settings as well as playback controls. Dashboard entries include the landing-page choice, hero, and each configurable rail. Remote entries cover enablement, port, and local URL controls. Playback entries cover the player choice, shared web-player behavior, ambient mode, external-player behavior, captions, series playback, failover, stream format, desktop playback controls, and recording location. Android device settings are now also capability-gated through the same index, so the command palette and settings page can expose those controls only when the host provides them. A reveal request carries a nonce, so an older navigation cannot clear a newer request. The settings context panel keeps these groups reachable with a compact list and gives way to the section list on short landscape phone screens.
References: libs/…/settings-search-entries.ts• L22-28 libs/…/settings-search-entries.ts• L170-220 libs/…/settings-search-entries-playback.ts• L6-208 libs/…/settings-search-sections.ts• L17-89 libs/…/settings-search.service.ts• L27-79 libs/…/settings-search.service.ts• L81-148 libs/…/settings-search.service.ts• L150-247 libs/…/settings-search.types.ts• L42-83 libs/…/workspace-command-palette.component.ts• L119-137 libs/…/workspace-settings-context-panel.component.scss• L7-184
Workspace keyboard shortcuts
The shell listens for global keyboard actions that change the desktop frame or open shortcut help. It ignores help actions while the user types or while the phone context drawer is open, so a global action does not interrupt a focused control or place a dialog above a modal surface.
The shell maps Ctrl/Cmd+F to global search in Electron. It leaves settings search in place, lets an existing search field handle its own input, and ignores the shortcut while the context drawer is open. Ctrl/Cmd+K opens the command palette, while Ctrl/Cmd+P opens the playlist switcher only when that switcher is available and no dialog already owns focus.
Desktop Electron builds handle F11 as an operating-system window fullscreen toggle and handle Cmd/Ctrl plus +, -, or 0 as frame zoom actions. The browser keeps its own behavior in the PWA, and player-owned HTML fullscreen remains under the player's controls. The help dialog presents platform and runtime-specific shortcut groups while allowing only one dialog instance at a time.
References: libs/…/workspace-keyboard-shortcuts.service.ts• L17-171 libs/…/workspace-keyboard-shortcuts.service.spec.ts• L65-126 libs/…/workspace-shell.facade.ts• L72-99 libs/…/workspace-shell.component.ts• L161-188
Workspace back gestures
Workspace back gestures provide one route for mouse Back, keyboard Back chords, and Electron window or trackpad gestures. They call the header's Back action when it exists, block navigation while a dialog, menu, phone drawer, or fullscreen player owns input, and leave browser history available when the shell has no Back target.
Electron can report one physical mouse press through both renderer pointer events and window events. The shell joins those paired reports into one gesture so a single press does not navigate twice.
References: libs/…/workspace-back-gestures.service.ts• L50-57 libs/…/workspace-back-gestures.service.ts• L111-189 libs/…/workspace-shell.component.ts• L68-72
Source management
The Sources view is the shell's management surface for the user's M3U, Xtream, and Stalker sources. It filters the visible source list by provider type, search text, and source health when the runtime can measure health. It then applies the shared sort choice and can place failing sources first.
The view reports the count after those filters, so the title and list describe the same result. Source actions include adding a source, refreshing it, viewing account or playlist details, and removing it. Cleanup is available only when the runtime can assess source health, and a source remains protected while external playback, refresh, import, deletion, or another source activity is using it. This keeps management actions from interrupting an active session or leaving a source in a partial state.
References: libs/…/workspace-sources.component.ts• L113-175 libs/…/workspace-sources.component.ts• L181-233
Xtream import feedback
The shell gives Xtream import and refresh work a route-aware progress surface. Remote imports and refresh preparation show feedback at once, while a local read of saved data waits briefly so a fast open does not flash an overlay. The overlay appears only for the dashboard or the affected Xtream content routes.
The feedback describes the current phase, content type, source of the work, and progress. Electron can cancel an active remote import, while local refresh preparation remains a separate state. Category rows can also show a short sync phase while the selected Xtream content is still loading. When shown, the overlay covers the workspace with a blurred theme-aware scrim and a selection or error treatment, while reduced-motion settings limit its animation.
References: libs/…/workspace-shell-xtream-import.service.ts• L38-137 libs/…/workspace-shell-xtream-import.service.ts• L139-265 libs/…/workspace-shell-constants.ts• L10-22 libs/…/workspace-context-panel.component.ts• L263-282 libs/…/playlist-drop-overlay.component.scss• L12-67 libs/…/playlist-drop-overlay.component.scss• L126-134
Dashboard libraries
The dashboard is split between a data-access library that joins activity from several source types and a feature library that presents that activity as a curated landing surface. The split keeps source and activity rules separate from the visual rail layout.
Dashboard landing surface
The dashboard presents a hero and horizontal rails for content that is useful to resume or discover. It uses a fixed order controlled by dashboard rail settings rather than a user-built widget grid. Rails hide when their data is empty or disabled, and the page shows a welcome action when no playlist exists.
The feature rail supports cover cards for movies and series and compact channel cards for live content. It reports the cards near the user's viewport so the dashboard can request live programme data only when that data can help the user. When the card set changes, the rail treats it as a new view and returns its horizontal position to the start.
The main feature component maps shared activity into user-facing cards. Those cards lead to existing collection or provider routes, so the dashboard is a launch surface rather than a second catalog. It also presents source-level actions such as refresh, account information, expiry state, and removal through the workspace shell. Live cards can also receive current programme context from the guide sources that apply to them. Activity that no longer has a usable catalog entry stays available in collection views but is not promoted to a playable hero or resume choice.
The main dashboard surfaces are:
- A hero and Continue Watching rail for recent movies and series.
- Live favorites and recently watched live channels.
- Favorite movies and series.
- Recently used sources, with expiry badges when the account facts are known.
- Recently added Xtream content on desktop.
- Optional recommendations and trending titles on desktop.
The dashboard also keeps its card state fresh when the user returns from a detail view. It reloads recent and favorite activity, updates playback positions when the recent VOD or series set changes, and refreshes optional source and metadata rails only when their settings allow them. A failed card action reports an error instead of leaving the user with a silent state change.
References: libs/…/workspace-dashboard-rails.component.html• L1-17 libs/…/workspace-dashboard-rails.component.html• L181-410 libs/…/workspace-dashboard-rails.component.ts• L134-228 libs/…/workspace-dashboard-rails.component.ts• L282-375 libs/…/workspace-dashboard-rails.component.ts• L410-465 libs/…/dashboard-rail.component.ts• L107-157 libs/…/dashboard-rail.component.ts• L221-282 libs/…/dashboard-hero-slides.presenter.spec.ts• L234-281
Dashboard source status
Source status gives dashboard source cards useful account-expiry context without making an unavailable portal look expired. Xtream facts come from the shared portal status check, while Stalker facts come from the account snapshot saved with the imported playlist.
The dashboard refreshes these facts only when the source rail is enabled. It keeps facts tied to the current playlist set and ignores late results from an older refresh round. A known expiry produces an expired or soon-to-expire badge; an unreachable or unknown source produces no badge.
References: libs/…/dashboard-source-expiry.service.ts• L15-82 libs/…/dashboard-source-expiry.service.ts• L84-175 libs/…/workspace-dashboard-rails.component.ts• L282-310 libs/…/workspace-dashboard-rails.component.ts• L347-358 libs/…/dashboard-source-expiry.spec.ts• L202-344
Dashboard data aggregation
libs/…/dashboard-data.service.ts is the shared dashboard data boundary. It combines recent activity, favorites, playlist metadata, recently added content, and playback positions into common activity records. Electron can use the desktop database for global activity, while browser-only paths assemble the data from provider sources that are available in that runtime.
The service normalizes provider-specific records into common content types: live, movie, and series. It also normalizes stored activity metadata before it reaches the feature layer, so absent or invalid title identity does not become a false match. It loads source contributions independently, so a resolved M3U favorites contribution can appear without waiting for every other source. The dashboard still waits for the playlist inventory and required first-load datasets before it declares the full dashboard ready. This lets the feature distinguish an empty source set from a source set that has not loaded yet.
Recent movies and series can carry saved playback information. The dashboard uses that information for progress and episode context, but missing positions do not block the card. Position reads cover the playlists that own recent VOD or series items and accept the newest reload result, so an older request cannot restore stale progress. Series progress prefers the position owned by the selected parent series before using a legacy episode key, so an unrelated episode with a colliding numeric id cannot replace the selected series' progress. Live cards receive current programme details as a separate best-effort enrichment step, so an unavailable guide does not remove the channel from the dashboard.
Live programme enrichment has two source paths. M3U cards use uploaded XMLTV data within the card's playlist scope, with a controlled wider-source fallback where the product permits it. Xtream and Stalker cards use the portal's current programme lookup. The dashboard asks for portal data only for visible live cards and the hero, then keeps answers in a shared per-card cache; this limits work while a user scrolls through rails. Portal answers are queued with bounded concurrency and published as each card resolves. Both paths refresh on the live tick and recalculate the display time range and progress against the configured guide offset. A source or offset change retires old answers before new guide data is shown. A portal answer is matched by source, playlist, and channel identity, so one provider's channel cannot supply another playlist's programme.
Continue Watching waits until history, playback positions, and the needed Xtream series episode lists have reached a settled state. It can then remove finished movies and find the next episode for a series whose newest saved episode is watched. Episode lists are loaded in the background with bounded concurrency, age checks, later lookup rounds, and source-level retry limits. A failed refresh leaves the last usable list in place.
References: libs/…/dashboard-data.service.ts• L182-188 libs/…/dashboard-data.service.ts• L253-383 libs/…/dashboard-data.service.ts• L500-640 libs/…/dashboard-data.service.ts• L841-939 libs/…/dashboard-data.service.ts• L1040-1222 libs/…/dashboard-mappers.ts• L29-115 libs/…/dashboard-data.service.spec.ts• L318-396 libs/…/dashboard-data.service.spec.ts• L1026-1227 libs/…/dashboard-series-identity.spec.ts• L109-167 libs/…/dashboard-continue-watching.ts• L59-84 libs/…/dashboard-continue-watching.ts• L186-250 libs/…/dashboard-series-episodes.service.ts• L93-145 libs/…/dashboard-series-episodes.service.ts• L217-321 libs/…/dashboard-portal-live-epg.service.ts• L45-127 libs/…/dashboard-portal-live-epg.service.ts• L137-237 libs/…/dashboard-portal-live-epg.service.ts• L249-285 libs/…/dashboard-portal-live-epg.util.ts• L13-79 libs/…/dashboard-portal-live-epg.util.ts• L82-137 libs/…/dashboard-live-epg.presenter.ts• L147-220 libs/…/dashboard-live-epg.presenter.ts• L222-376 libs/…/dashboard-portal-live-epg.presenter.ts• L51-93
Dashboard card navigation
Dashboard cards carry a destination and, when needed, navigation state. The data service supplies those destinations through shared navigation rules, which preserve the source identity and the intended detail or collection target. This is important for cross-provider activity because the same title or channel can exist in more than one playlist.
The dashboard reloads recent and favorite activity when it is entered. Optional desktop rails load after the core activity is ready, which keeps a slow database or metadata lookup from hiding useful content that is already available.
Continue Watching uses two distinct actions. The card opens the detail view without starting playback, while an explicit Resume action carries the one-shot handoff that starts the saved episode. A watched episode has no Resume action because its saved position represents completion rather than unfinished progress. For a series, the handoff uses the resolved next episode when the provider list names one and keeps the parent series identity separate from a colliding episode id. The dashboard also reports persistence errors for actions such as marking an item watched or removing it from history instead of leaving the card state silently unchanged.
References: libs/…/workspace-dashboard-rails.component.ts• L316-369 libs/…/workspace-dashboard-rails.component.ts• L401-455 libs/…/workspace-dashboard-rails.component.ts• L468-509 libs/…/dashboard-navigation.util.ts• L63-165 libs/…/dashboard-rail.utils.ts• L71-112 libs/…/dashboard-data.service.spec.ts• L1025-1155 libs/…/dashboard-series-identity.spec.ts• L118-167 libs/…/dashboard-continue-watching.ts• L213-250
Remote-control web application
The remote-control web application is a small companion surface for the desktop app. Electron serves it over a local HTTP server, and the shared remote-control library provides the controls, status view, and request client.
Remote-control setup
The Settings page lets the user enable remote control and select a port. When enabled, the desktop app exposes local network URLs and can show a QR code for each detected local address. A phone or other device opens one of these URLs to reach the companion page.
The web app is served from the Electron process rather than from the normal web application. The server routes remote-control API requests separately from static files and restarts when the enabled state or port changes. Static requests remain inside the configured remote-app directory, and a missing application route falls back only to that directory's index.html.
References: apps/…/settings-remote-control-section.component.html• L16-136 apps/…/settings-remote-control.facade.ts• L9-36 apps/…/http-server.ts• L56-75 apps/…/http-server.ts• L109-165
Remote-control interface
The remote interface is provided by libs/…/remote-control.component.ts and rendered by the apps/remote-control-web application. It presents channel up and down controls, a number pad, volume controls, and a status card. The web application sets a default language and mounts the shared component as its only page-level content.
The shared service maps each user action to one HTTP endpoint. The component refreshes status when it starts, polls every two seconds, and performs a silent status refresh after a command. This keeps the interface simple: commands are sent as requests, while status is read as a current snapshot.
References: apps/…/app.ts• L1-18 apps/…/app.html• L1 libs/…/remote-control.component.ts• L14-155 libs/…/remote-control.service.ts• L26-79
Remote-control contract
The desktop HTTP boundary accepts channel up, channel down, number selection, volume up, volume down, mute, and status requests. Channel movement is sent as a direction event. Number and volume actions are sent as typed commands. The Electron main process forwards these messages to the renderer through the preload bridge.
The renderer sends status in the other direction through the same bridge. A status snapshot identifies the source type, whether a live view is active, the selected channel, the current EPG program when known, and whether volume control is available. The main process keeps the latest snapshot in memory for the next status request.
References: apps/…/remote-control.events.ts• L6-27 apps/…/remote-control.events.ts• L40-115 apps/…/main.preload.ts• L270-294
Controller and player interaction
The controller never selects a channel from its own catalog. It sends an intent to the desktop app, and the active live surface resolves that intent against the list it currently presents. This keeps remote numbering and channel movement aligned with the player that the user sees.
Command path
This sequence shows how a remote action moves from the phone to the active live surface and how the resulting state returns to the phone.
sequenceDiagram
participant C as Remote controller
participant H as Electron HTTP server
participant B as Preload bridge
participant P as Active live surface
C->>H: POST channel or volume action
H->>B: IPC command to renderer
B->>P: Direction or typed command
P->>P: Resolve active list and start playback
P-->>B: Status snapshot
B-->>H: Renderer status update
C->>H: GET current status
H-->>C: Channel, EPG, and capability state
Channel changes use the active surface's normal playback path. Remote navigation therefore starts playback explicitly, including surfaces where a normal click only selects an item before a second action starts playback.
References: apps/…/remote-control.events.ts• L117-184 apps/…/remote-control.events.ts• L245-284 apps/…/main.preload.ts• L270-294
Channel list scope
The shared helpers in libs/…/remote-channel-navigation.ts define adjacent-channel movement and one-based number selection. Adjacent movement wraps at the start and end of a list. Number selection uses the item's position in that list, not an EPG channel number.
Each live surface supplies a different list because each surface has a different user scope:
| Live surface | Remote list | Playback result |
|---|---|---|
| M3U player | Full channel list | Selects or changes the channel in the M3U player. |
| Xtream live view | Current visible category list | Starts the selected live stream in that category. |
| Stalker ITV or radio view | Current filtered channel list | Starts the selected ITV or radio item. |
| Favorites or recent collections | Search-filtered and sorted rows shown in the collection | Plays the selected item through the collection player. |
The collection path also supports dashboard live clicks because those clicks open a collection view with an item to auto-open. Its remote adapter uses the same visible rows for control and status numbering.
References: libs/…/remote-channel-navigation.ts• L20-73 libs/…/video-player.component.ts• L752-793 libs/…/live-stream-layout.component.ts• L531-571 libs/…/stalker-live-stream-layout.component.ts• L1369-1415 libs/…/unified-live-tab-remote-control.ts• L61-90
Status lifecycle
Each supported live surface publishes status while it owns live playback. The status includes the source type and the channel's position in the active list, with EPG fields when the surface has a current program. The shared collection adapter uses the active item's source type, so a mixed collection reports the source that is actually playing.
When a live surface is destroyed or loses its active item, it publishes the shared reset snapshot. The main process treats a non-live update as an authoritative reset and removes stale now-playing fields. This prevents a phone from showing a channel after the desktop has moved to another route or stopped playback.
References: libs/…/remote-channel-navigation.ts• L5-18 libs/…/video-player.component.ts• L709-748 libs/…/live-stream-layout.component.ts• L341-377 libs/…/stalker-live-stream-layout.component.ts• L564-613 libs/…/unified-live-tab-remote-control.ts• L92-125
Volume capability
Volume control is advertised as a capability, not as a promise that every player can change audio. The M3U player supports remote volume for built-in inline playback and reports false when MPV, VLC, or Embedded MPV owns the audio. Xtream, Stalker, and collection surfaces currently report no remote volume support.
The remote UI hides the volume value and disables the meaning of volume actions when the status says that the active player does not support them. This avoids changing a stored web-player setting when that setting cannot affect the audio that the user hears.
References: libs/…/remote-control.component.ts• L82-121 libs/…/video-player.component.ts• L649-674 libs/…/video-player.component.ts• L1120-1185 libs/…/unified-live-tab-remote-control.ts• L105-114
Change checklist
When these files or sections are changed, remember to consider these:
- When workspace routes or startup preferences change, keep shell context, dashboard card destinations, and header playlist context aligned.
- When workspace rail links or route-derived provider context changes, keep dashboard visibility, desktop-only search, provider grouping, downloads placement, server status, and narrow-screen access aligned.
- When the workspace drawer or native playback behavior changes, keep focus return, modal layering, Escape handling, and inert content aligned.
- When header leading controls change, keep back-button precedence, phone drawer access, live sidebar state, layout-slide keys, and reduced-motion behavior aligned.
- When header actions or available width changes, keep the overflow hide order, minimum menu size, divider spacing, hysteresis, and focus handoff aligned.
- When workspace Back handling changes, keep mouse, keyboard, Electron window or trackpad gestures, header targets, browser fallback, and popup, drawer, or fullscreen blocking aligned.
- When the context panel changes category scope, keep search, sort, counts, loading state, parental locks, and live-player selection behavior aligned.
- When context readiness changes, keep disabled category actions, count placeholders, sync status, popover sorting, and focus targets aligned.
- When live category selection changes, preserve active playback and deep-linked URL behavior while keeping non-live selection able to clear its detail.
- When the live category popover changes, keep route-close, sidebar-level-close, compact-band-close, backdrop, Escape, category selection, phone drawer, and focus-return behavior aligned.
- When global search handling changes, keep shortcut scope aligned with editable fields, the open modal drawer, and the header search target.
- When dashboard search handling changes, keep Xtream handoff, desktop global-search launch, PWA capability, empty-term behavior, and route query state aligned.
- When search debounce or route query handling changes, keep raw input, applied provider terms, history navigation, scope clearing, and collection state aligned.
- When command groups, recent command state, or command visibility rules change, keep palette filtering, enabled selection, keyboard return values, settings result order, and shell action resolution aligned.
- When command-palette capability probes change, keep failed probes non-blocking and keep player-dependent commands consistent with the final runtime capability.
- When settings sections, searchable rows, runtime requirements, or reveal requests change, keep settings navigation, page anchors, fallback rows, command-palette results, and capability checks aligned.
- When playback settings or their runtime gates change, keep the page's setting anchors, searchable labels, fallback targets, and player capability checks aligned. The playback index is part of the same settings search contract as dashboard and remote-control rows.
- When Android settings controls or their host capability changes, keep the Android settings requirement in sync with the controls that the settings page can actually render.
- When fullscreen, zoom, or shortcut-help handling changes, keep Electron bridge actions separate from browser fallback behavior and player-owned fullscreen.
- When source filters, sorting, or cleanup rules change, keep provider labels, visible counts, source actions, failing-first behavior, and activity protection aligned.
- When live category controls change, keep popover close behavior, folded-rail behavior, blocked-content handling, focus restoration, route changes, category selection, and phone drawer behavior aligned.
- When Xtream import or refresh states change, keep route gating, delayed local feedback, cancellation capability, phase labels, and category sync text aligned.
- When import overlay presentation changes, keep theme states, rejection feedback, scrim layering, and reduced-motion behavior aligned with the import state.
- When a dashboard rail changes its source or content type, update its data mapping, empty behavior, runtime availability, and destination as one user flow.
- When dashboard rail settings or optional metadata services change, keep loading gates, opt-in state, and the core activity rails independent.
- When dashboard card visibility or rail layout changes, keep viewport-based enrichment, card identity resets, image fallback behavior, and keyboard focus scrolling aligned.
- When dashboard reload or optional-rail timing changes, keep recent and favorite refreshes ahead of optional metadata work, playback-position reloads tied to the VOD or series set, and rejected actions visible to the user.
- When activity identity or saved-position rules change, keep parent-series ownership, legacy episode fallback, detail-only navigation, Resume handoff, and watched-state decisions aligned.
- When live EPG data changes, keep XMLTV scope, portal lookup scope, visibility gating, timestamp fallbacks, display offsets, provider-clock progress, and card lookup keys aligned.
- When portal EPG caching or source settings change, preserve answer retirement, visible-card requeue behavior, and the hero pin so old guide data cannot survive a source or offset change.
- When Continue Watching actions or series lookup rules change, keep the default detail destination separate from the explicit Resume handoff, preserve the watched-state guard, and keep failed refreshes from erasing the last usable episode list.
- When source expiry facts change, keep provider status sources, Stalker snapshot invalidation, unknown-versus-expired meaning, and dashboard clock boundaries aligned.
- When download or recording detail routes change, keep their focused-page search and context-panel behavior aligned.
- When remote commands or status fields change, update the HTTP handlers, preload bridge, shared web client, and every live-surface adapter together.
- When a live surface changes its visible list, keep remote stepping, number selection, and reported channel number based on that same list.
- When a live surface can stop owning playback in place, preserve the reset snapshot path as well as the destroy path.
- When volume ownership changes, derive
supportsVolumefrom the effective player and keep the remote action guard consistent with it. - When remote settings change, preserve the link between enabled state, port restart behavior, local URLs, and QR-code data.
- When shell startup or player loading changes, preserve the idle warm-up path and let player routes retry after a failed warm-up.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| No playlist exists | The dashboard has no source context and empty rails would provide no useful action. | Show the welcome state and route its action to source creation. |
| Playlist inventory is still loading but is treated as empty | Optional Xtream data can settle too early and the dashboard can miss content from sources that have not appeared yet. | Keep the inventory load distinct from the known-empty state before settling Xtream data. |
| A dashboard card loses its source or navigation state | The user can open the wrong provider view or lose the intended resume target. | Build card destinations through the shared dashboard navigation rules. |
| A live program has unusable time values | The card loses its time range or progress but remains usable as a live item. | Accept valid cached timestamps first, then fall back to ISO times. Return no EPG detail when neither form is valid. |
| A portal guide lookup is unavailable or has no programme | The live card loses its now-playing row but remains available for playback. | Treat guide enrichment as best effort and keep the card independent from the answer. |
| A portal answer finishes after its source or display offset changes | The dashboard can show a programme from an old guide or clock. | Retire cached answers and requeue wanted cards when the source revision or offset no longer matches. |
| A portal answer uses only a provider channel id | A channel from one playlist can display another playlist's programme. | Key and resolve the answer by source, playlist, and channel identity. |
| An off-screen portal card remains in the wanted set | The dashboard can spend portal work on cards the user cannot see. | Keep the wanted set to visible cards plus the pinned hero and clear it when the dashboard closes. |
| A folded live context rail remains in the focus order | Keyboard focus can move into a zero-width panel and become hard to find. | Mark the folded sidebar inert and restore focus to a usable panel control or the rail after it opens. |
| The fold control appears in a phone drawer or blocked Xtream view | The control has no useful effect or leaves the user without a way back from the error surface. | Hide it in the drawer and keep the rail visible while Xtream content is blocked. |
| Continue Watching treats a watched position as resumable | Playback can start a completed episode at its end instead of opening the series for a new choice. | Keep the Resume action behind the unfinished-position check and use detail-only navigation for the card. |
| A series and an episode share a numeric identity | The dashboard can show or mark progress for an unrelated episode. | Match by playlist and parent-series ownership first, then use the legacy episode key only when no parent match exists. |
| A playback-position reload finishes after a newer reload | The dashboard can show progress from an older history set. | Apply only the latest reload generation and treat failed playlist reads as loaded without progress. |
| A series episode refresh fails | A recent series can disappear or lose the last known next episode. | Keep the old loaded list during refresh and retry failed or old lists in later lookup rounds. |
| A source is cleaned up while playback or source work is active | The current session or an in-progress source update can be interrupted. | Protect sources used by playback, refresh, import, delete, or other busy activity before allowing cleanup. |
| The dashboard labels an unreachable portal as expired | A source card shows a false account warning. | Show expiry only for known account facts; treat unavailable checks as unknown. |
| A late expiry lookup belongs to an older source set | A removed or replaced source can add a badge to a current card. | Apply results only for the current refresh round and prune absent playlist ids. |
| The header moves only one action into More actions | The menu can consume the freed slot without creating room. | Use the minimum two-action threshold and keep the action inline below it. |
| Header width changes while an action or menu has focus | Focus can drop to the page when the action changes presentation. | Re-measure the laid-out header and move focus to the menu trigger or the last inline action. |
| The command palette keeps a disabled or hidden recent command | Selection can point to an action the user cannot run. | Rebuild recent results from visible commands and include only enabled items. |
| Settings commands are matched by the palette's normal substring search | A setting can appear with a rank or visibility that does not match the settings page. | Keep settings out of the normal list and use the settings search result order for that group. |
| A player capability probe fails while the command palette opens | The palette may fail to open or may offer a command that the runtime cannot use. | Treat probe failure as a capability result, open the palette, and omit dependent commands. |
| An Android settings control is indexed without host support | The user can be sent to a settings row that the page cannot show or use. | Gate the shared index with the same Android control availability used by the host. |
| A dashboard search term is sent without a valid target | The header can appear active but perform no useful search, or can create an empty global-search route. | Require an Xtream context or a desktop global-search capability and do not launch global search for an empty term. |
| A global shortcut runs while the user types or the context drawer is open | The shell can open an unexpected dialog or move focus away from the active surface. | Ignore help shortcuts in inputs and modal drawer state. |
| Ctrl/Cmd+P runs while a dialog is open or the playlist switcher is unavailable | Focus can leave the active dialog or the browser can receive an unintended print action. | Open the switcher only when it is registered and no dialog owns focus. |
| A back gesture is reported by both the renderer and Electron for one mouse press | One physical action can navigate twice or move past the intended page. | Pair the two reports as one gesture and consume the browser's default history action when the shell owns it. |
| A drawer closes while focus remains inside its inert content | Keyboard focus drops to the document body or becomes hard to find. | Restore focus after the drawer leaves inert state to its toggle or the new route content. |
| A category selection races with a route or playlist change | A dialog or selection can apply to the wrong provider context. | Capture the context and re-check it after unlock, lazy loading, and navigation-sensitive work. |
| Xtream category actions are used before selected content is ready | The user can enter a category with incomplete counts or stale content state. | Keep rows and management actions disabled until the selected type is ready and show loading status only for active import work. |
Key files
| File | Why to read it |
|---|---|
| apps/…/app.routes.ts | Shows how the workspace shell contains the dashboard and provider flows. |
| libs/…/workspace-shell.component.html | Shows the persistent frame, routed content, context drawer, import overlay, and playback footer. |
| libs/…/workspace-shell.component.ts | Shows the shell's focus, modal, search shortcut, keyboard, native-player, and live-category integration. |
| libs/…/workspace-shell-header.service.ts | Shows route-aware header context, live sidebar access, playlist actions, and account actions. |
| libs/…/workspace-shell-route-state.service.ts | Shows how route, startup preference, active playlist, and runtime state produce workspace and provider rail links. |
| libs/…/workspace-shell-rail.component.html | Shows the workspace rail groups, server status shortcut, and settings action. |
| libs/…/workspace-shell-rail.component.scss | Shows desktop rail grouping and the narrow-screen scrolling and pinned-footer behavior. |
| libs/…/workspace-shell-rail-links.component.html | Shows the shared accessible link presentation and active-route state. |
| libs/…/workspace-back-gestures.service.ts | Shows how platform Back gestures reach the shell's Back action and when they are blocked. |
| libs/…/layout-slide.directive.ts | Shows how shell controls and content move smoothly when the frame changes. |
| libs/…/workspace-shell-search.service.ts | Shows how route data and runtime capability set the search mode and scope. |
| libs/…/workspace-shell-dashboard-search.ts | Shows how dashboard search chooses Xtream search, desktop global search, or no search. |
| libs/…/warm-player-chunk.ts | Shows how the shell prepares player resources without slowing the first screen. |
| libs/…/workspace-shell-header.component.ts | Shows route-aware header controls, phone navigation precedence, and responsive action overflow. |
| libs/…/workspace-shell-header-overflow.ts | Shows how the header decides which actions move to More actions. |
| libs/…/workspace-shell-header.component.html | Shows the header's search, source, lock, route, overflow, and download actions. |
| libs/…/workspace-context-panel.component.ts | Shows category scope, readiness, search, sort, parental locks, visibility management, and provider-specific selection behavior. |
| libs/…/workspace-context-panel.component.html | Shows category loading, error, locked, and management states. |
| libs/…/workspace-shell-context-sidebar.component.ts | Shows how route panels fold on live views and how the shell restores focus when they open again. |
| libs/…/workspace-shell-context-sidebar.component.spec.ts | Shows the live fold, blocked-content, inert-state, and focus contracts. |
| libs/…/workspace-context-panel-route.utils.ts | Shows how category scope clearing resets provider state while preserving search and live route rules. |
| libs/…/workspace-shell-xtream-import.service.ts | Shows route-aware Xtream import and refresh feedback. |
| libs/…/playlist-drop-overlay.component.scss | Shows the theme-aware import/drop overlay treatment and reduced-motion behavior. |
| libs/…/workspace-shell.facade.ts | Shows how route state and shared actions become shell behavior. |
| libs/…/settings-search-sections.ts | Shows settings page order, navigation groups, and runtime-gated sections. |
| libs/…/settings-search-entries.ts | Shows searchable dashboard, remote-control, and device-setting rows, their fallback links, and the shared settings index. |
| libs/…/settings-search-entries-playback.ts | Shows searchable playback controls and the runtime gates that keep them aligned with visible settings. |
| libs/…/settings-search.service.ts | Shows capability filtering, ranked search, reveal navigation, native-player probing, and Android control gating. |
| libs/…/settings-search.types.ts | Defines the contract between settings rows, runtime requirements, and reveal requests. |
| libs/…/workspace-shell-route-utils.ts | Shows query-string, route-path, provider-context, and category-scope URL rules. |
| libs/…/workspace-shell-search-sync.service.ts | Shows how typed, URL, history, and provider search state stay synchronized. |
| libs/…/workspace-live-categories-popover.service.ts | Shows how live layouts share a shell-owned category popover and return to the full category panel. |
| libs/…/workspace-command-palette.component.ts | Shows how shell commands are searched, grouped, selected, and returned to the caller. |
| libs/…/workspace-shell-command-builders.ts | Shows how route, provider, settings, and runtime state become palette commands. |
| libs/…/workspace-keyboard-shortcuts.service.ts | Shows how global help, fullscreen, and zoom shortcuts respect runtime and modal state. |
| libs/…/workspace-sources.component.ts | Shows how source discovery, health filtering, sorting, cleanup, and activity protection work together. |
| libs/…/workspace-dashboard-rails.component.ts | Shows how dashboard activity becomes hero and rail cards, how visible cards drive live guide data, and how source and playback actions work. |
| libs/…/dashboard-rail.component.ts | Shows the shared rail card layouts, viewport visibility boundary, horizontal navigation, and focus behavior. |
| libs/…/workspace-dashboard-rails.component.html | Shows the dashboard's user-facing order and empty or optional rail behavior. |
| libs/…/dashboard-rail.utils.ts | Shows the available Continue Watching and source actions exposed by dashboard rails. |
| libs/…/dashboard-live-epg.utils.ts | Shows how live cards receive safe EPG time, progress, and lookup details. |
| libs/…/dashboard-live-epg.presenter.ts | Shows how XMLTV guide scopes and portal guide answers form one live-card view. |
| libs/…/dashboard-portal-live-epg.presenter.ts | Shows how visible dashboard cards and the hero control lazy portal guide requests. |
| libs/…/dashboard-data.service.ts | Shows how recent activity, favorites, source metadata, and playback positions become common dashboard data. |
| libs/…/dashboard-mappers.ts | Shows how stored provider activity becomes normalized dashboard records and preserves valid identity metadata. |
| libs/…/dashboard-data.service.spec.ts | Shows the readiness, source-specific loading, and stale-result contracts for dashboard data. |
| libs/…/dashboard-series-identity.spec.ts | Shows the parent-series identity guard for progress, details, Resume, and watched actions. |
| libs/…/dashboard-continue-watching.ts | Shows the settled loading gate and series continuation choices for the Continue Watching rail. |
| libs/…/dashboard-series-episodes.service.ts | Shows bounded episode lookups, source-aware retries, and stale-list handling. |
| libs/…/dashboard-source-expiry.service.ts | Shows how dashboard source cards obtain and retire account-expiry facts. |
| libs/…/dashboard-portal-live-epg.service.ts | Shows the shared cache, visibility queue, bounded portal requests, and request boundary for live programme answers. |
| libs/…/dashboard-portal-live-epg.util.ts | Shows the provider and playlist identity used to build and resolve portal guide entries. |
| libs/…/dashboard-navigation.util.ts | Shows how dashboard items preserve provider identity and choose detail or resume destinations. |
| apps/…/http-server.ts | Shows the desktop server boundary for static remote-app files and API requests. |
| apps/…/remote-control.events.ts | Shows the HTTP command contract and in-memory status boundary. |
| apps/…/main.preload.ts | Shows the safe bridge between Electron main and renderer processes. |
| libs/…/remote-control.component.ts | Shows the remote user's controls, status display, polling, and action refresh. |
| libs/…/remote-control.service.ts | Shows the HTTP operations exposed to the remote interface. |
| libs/…/remote-channel-navigation.ts | Shows the common wraparound and one-based channel selection rules. |
| libs/…/unified-live-tab-remote-control.ts | Shows how mixed-source collection playback joins the remote contract. |