47 KiB
Workspace Shell
This document records the current workspace-first shell contract. It is the stable replacement for the older UI refactor summary.
Related:
Summary
/workspaceis the primary app surface.WorkspaceShellComponentowns the persistent frame: rail, header, optional context panel, content outlet, and external playback footer.- Descendant workspace pages inherit
layout = 'workspace'from the/workspaceroot route. - Provider route trees now bootstrap through route-scoped session providers instead of nested provider shell components.
Core implementation:
apps/web/src/app/app.routes.tslibs/workspace/shell/feature/src/lib/workspace-shell/workspace-shell.component.tslibs/workspace/shell/feature/src/lib/workspace-shell/workspace-shell.component.htmllibs/workspace/shell/feature/src/lib/workspace-shell/services/workspace-shell.facade.tslibs/workspace/shell/feature/src/lib/workspace-shell/services/workspace-shell-route-state.service.tslibs/workspace/shell/feature/src/lib/workspace-shell/services/workspace-shell-search.service.tslibs/workspace/shell/feature/src/lib/workspace-shell/services/workspace-shell-search-sync.service.tslibs/workspace/shell/feature/src/lib/workspace-shell/services/workspace-shell-header.service.tslibs/workspace/shell/feature/src/lib/workspace-shell/services/workspace-shell-command-palette.service.tslibs/workspace/shell/feature/src/lib/workspace-shell/services/workspace-shell-xtream-import.service.tslibs/portal/shared/util/src/lib/navigation/portal-route.utils.tslibs/portal/shared/util/src/lib/navigation/portal-rail-links.tslibs/portal/shared/ui/src/lib/navigation/portal-rail-links.component.ts
Route Contract
Current workspace routes:
/->/workspace/workspace-> functional redirectworkspaceEntryRedirect(WorkspaceStartupPreferencesService.resolveInitialWorkspacePath();/workspace/dashboardby default,/workspace/sourceswhen the dashboard is disabled, or the last restorable route underStartupBehavior.RestoreLastView—dashboarditself is guarded bydashboardAccessGuard)/workspace/dashboard/workspace/sources/workspace/playlists/:id/:view(plusfavoritesandrecentsiblings)/workspace/global-favorites/workspace/global-recent/workspace/search/workspace/downloads/workspace/settings/:section(/workspace/settingsredirects togeneral; the settings context panel links each section page; sections:general,playback,epg,dashboard,remote-control,tmdb,parental— see parental lock —backup,reset,about)/workspace/xtreams/:id/.../workspace/stalker/:id/...
Compatibility redirect:
/settings->/workspace/settings
Provider route integration:
apps/web/src/app/app.routes.tsmarks the/workspaceroot route withdata.layout = 'workspace'.isWorkspaceLayoutRoute(...)treats that layout marker as inherited route state for all descendants.- Xtream and Stalker parent routes attach route-scoped session providers that bootstrap the active playlist, sync provider section state, and clean up provider-local state when the route is destroyed.
- Xtream route bootstrap is DB-first for already imported Electron playlists: if the requested section has persisted categories and content, the route hydrates from SQLite even when the portal status probe reports unavailable, expired, or inactive. Fresh/no-cache Xtream routes still use the status probe to block remote imports before the loading overlay starts.
- Workspace routes no longer rely on nested provider shell components for hidden local chrome.
Shell Structure
The shell is intentionally split into four persistent regions:
- Left rail:
- Static workspace links for dashboard, sources, global favorites, and recently viewed. The routed global-search rail link is Electron-only because its data source is the SQLite worker bridge.
- Provider-aware context links derived from the active or current playlist.
- Settings remains a persistent footer shortcut in the rail.
- No brand mark: it only repeated the first workspace link (Dashboard, or Sources when the dashboard is off).
- Top header:
- Leading Back slot: the current page's registered Back, else browser history while an in-app previous page exists, else nothing. See Header Back.
- Playlist switcher.
- Route-aware search input and command palette trigger.
- Add source action.
- Optional playlist refresh and route-specific shortcut actions.
- Downloads shortcut in Electron.
- Main body:
- Optional left context panel.
- Main router outlet content.
- Optional footer:
- External playback session bar when a docked session is visible.
WorkspaceShellComponent binds only to WorkspaceShellFacade. The facade is
kept as a thin template-facing API and delegates ownership to component-scoped
services:
WorkspaceShellRouteStateServiceowns current route parsing, rail links, context-panel state, dashboard startup preference, and playlist source signals.WorkspaceShellSearchServiceowns the route-aware header search capability and public search actions.WorkspaceShellSearchSyncServiceowns the search query signals, debounced application, provider-store synchronization, and query-param sync.WorkspaceShellHeaderServiceowns playlist title/subtitle, account/info actions, refresh action state, and recent-items bulk cleanup.WorkspaceShellCommandPaletteServiceowns command-palette dialog lifecycle and recent-command recording.WorkspaceShellXtreamImportServiceowns Xtream import/refresh overlay state and labels.
When adding shell behavior, prefer placing it in the service that owns the
nearest existing state. Keep WorkspaceShellFacade as a stable re-export layer
for the template unless the template contract itself intentionally changes.
Header Back
The header's leading slot is the workspace's one page-level Back. Pages do not
render an arrow of their own: they register a WorkspaceBackTarget
(@iptvnator/portal/shared/util) with WorkspaceBackNavigationService
(@iptvnator/portal/shared/data-access), normally through
registerWorkspaceBack(), which registers for the calling component's
lifetime while its optional available predicate holds. The newest
registration wins, and each release removes only its own target. The button
(data-test-id="workspace-header-back") sits beside the macOS traffic lights,
never scrolls, and has Electron no-drag hit testing. A target supplies its
label (else the translated "Back"), whether Escape on the page runs it, and
run().
| Page | Registered by | Back runs | ≤640 px |
|---|---|---|---|
| Portal, collection, offline and recording details | PortalDetailShellComponent while backAvailable() |
the host's backClicked |
replaces the drawer toggle |
| Xtream and Stalker Discover and actor pages | DiscoverViewComponent, ActorViewComponent |
the route's Location.back() |
(no drawer) |
| In-portal search, Xtream and Stalker | SearchLayoutComponent while backAvailable() and no inline detail replaces the results |
Location.back() |
(no drawer) |
| Settings | WorkspaceSettingsContextPanelComponent, which exists exactly while the settings route shows |
Location.back() |
beside the drawer toggle |
Detail-page semantics (Escape, browse and watch) are in Portal Detail Navigation.
History fallback. Without a registration, the header shows Back while the
previous history entry is an in-app one, and runs Location.back(). The
service reads that from the Navigation API: the previous entry must be
same-document (NavigationHistoryEntry.sameDocument), so the router pushed it
after this document loaded. Entries from before a reload or from another page
of the origin never count, and the fallback can neither leave nor reload the
app. currententrychange keeps it current through pushes, replacements,
traversals and guard-cancelled Back navigations that the router rewrites.
Without the Navigation API (older Safari and Firefox, jsdom) there is no
fallback; registered pages are unaffected. The fallback reads "Back" and
advertises no Escape, because no page handles one for it. Pages that set
backAvailable=false, such as M3U details, therefore show it too when they
were reached by navigation.
When there is nowhere to go, the slot is empty rather than a disabled arrow. Sessions often start on a page that never navigates (an M3U playlist or live TV), where a disabled arrow would stay for the whole session. The cost is one shift of the switcher and search when Back first appears or leaves, which happens only at the start of the history and together with a route change. There is no Forward button: Stalker inline details are store state, not history entries, so Forward would skip them.
Phone width. phoneDrawerToggle sets how Back shares the leading slot with
the context drawer toggle. replace (the default) takes the toggle's slot: a
detail page's drawer belongs to the list that Back returns to. beside keeps
both: the settings drawer holds the page's own sections. yield hides Back
while the toggle shows: the history fallback must not cost a category list its
only way into the drawer, and two navigation icons do not fit beside the
switcher. System and browser Back still work there.
Left in place. These controls stay inside their surface on purpose:
- Downloads offline and recording detail error states keep their labelled "Back to Downloads" button beside Retry or Remove. It is the error state's recovery action, not page chrome; the header shows the same Back.
- Back controls internal to a surface, which leave a panel rather than the page: the Embedded MPV dock panel and the alternative-sources panel inside the VOD "…" menu.
- The M3U player sidebar's Home button, which renders only outside the workspace shell.
Context Panel Rules
The shell decides which secondary panel to show from the current route:
/workspace/sourcesWorkspaceSourcesFiltersPanelComponent
- Xtream category sections (
live,vod,series)WorkspaceContextPanelComponent
- Stalker category sections (
itv,radio,vod,series)WorkspaceContextPanelComponent
/workspace/settings/:sectionWorkspaceSettingsContextPanelComponent
- Downloads sections
WorkspaceCollectionContextPanelComponent
The context panel is part of the shell contract. New workspace-level routes should explicitly decide whether they need one rather than adding local sidebars inside feature pages.
Xtream and Stalker category panels preserve provider/server category order by
default. The panel header exposes a sort menu next to category search with
Server sorting, A-Z, and Z-A; when alphabetical sorting is active,
synthetic "all categories" entries stay pinned before sorted provider
categories.
On live sections the category panel can be folded away independently of the
channels list; the folded panel is reachable as a popover from the channels
header through the LIVE_CATEGORIES_POPOVER token the shell provides. The
three nested levels, their affordances and persistence are specified in
iptvnator-ui-guidelines.md ("Collapsible Live Sidebar").
A category click in a LIVE section (Xtream live, Stalker itv and radio)
changes only the selected category: the live layouts gate their player on the
store's selected item, so the handler must not clear it — the channel the user
is watching keeps playing while the sidebar re-filters (Xtream: #936; Stalker:
onStalkerCategoryClicked returns before clearSelectedItem()). VOD and
series category clicks do drop the open detail (setSelectedItem(null) /
clearSelectedItem()) because they navigate to a list route.
The channel header offers Show playing channel when browsing excludes the active channel. It returns to that category and focuses the row without restarting playback; remote commands retain captured playback order. See the queue and reveal contract.
Search And Navigation Rules
Search is shell-owned and route-aware:
- On settings routes, searches the settings themselves (see Settings search).
- Enabled on sources routes.
- Enabled for
/workspace/search, which is the Electron-only routed global-search view.Ctrl/Cmd+Fin Electron opens this route and focuses/selects the header search input instead of opening a fullscreen dialog. - Enabled for supported Xtream and Stalker content/search views.
- Placeholder text and search handling vary by provider and section.
- Input changes are debounced before route/store updates are applied.
- Global search uses the header input as its primary input and writes the
search phrase to the
qquery parameter, so history/back-forward behavior matches the rest of the workspace. - The URL is authoritative for the search box only when it carries search
intent.
WorkspaceShellSearchSyncServicere-readsqon everyNavigationEnd, but an app-initiated navigation that stays on the same page and carries the term already applied is always ignored — whether or not a debounce is still pending. Otherwise a page writing an unrelated query param (a downloads filter chip, a refresh bump) or the router echoing back our own trimmedqwould reset the box to the applied term, eating everything typed since: the whole word while the first keystroke is still debouncing, or a just-typed trailing space once the debounce has fired ("Bein " would snap to "Bein" and typing on would yield "BeinSports"). Applied terms are always stored trimmed (applySearchQueryandsetSearchStateboth trim), so the echoedqcompares directly; the box keeps exactly what the user typed. Pages are free to write their own query params while the user types; they must not assume the shell will re-apply the search afterwards. - Browser history overrides that guard. The exemption is keyed on
Navigation.trigger === 'imperative', so back/forward always re-applies what the history entry carries, even mid-typing. - Applying a term explicitly supersedes a queued one.
applySearchQuery()cancels any pending debounce, so the Enter key committing a trimmed term cannot be overwritten a moment later by the untrimmed keystroke still waiting behind it.
Rail navigation is also shell-owned:
- Workspace-global entries are static.
- Provider entries come from
buildPortalRailLinks(...). - On dashboard, sources, settings, global search, global favorites, and global recent, the shell falls back to the currently selected playlist so provider navigation remains available even outside a provider route.
Command palette behavior is shell-owned but view-extensible:
- The shell resolves commands into groups in fixed order: current view, this playlist, global, then settings. The settings group appears only for a non-empty query and holds at most six settings matches (see Settings search).
- Shell-owned commands are derived from route context and current playlist state; empty groups are omitted instead of rendering disabled placeholders.
- Workspace features contribute current-view commands through
WorkspaceViewCommandService. - Header shortcut actions can opt into palette exposure by attaching palette
metadata through
WorkspaceHeaderContextService. - Filtering matches command labels, descriptions, and keywords, and keyboard selection always lands on the first enabled command.
- A "Recently used" section is rendered above the standard groups when the
query is empty and at least one stored id resolves to a visible+enabled
command; ids are persisted via
RecentCommandsService(capped at 5, stored atSTORE_KEY.RecentCommands). Storage is not pruned by route visibility — a navigation command likeOpen sourcesis invisible while the user is on/workspace/sourcesbut the id stays in storage so it reappears in the recent section after navigating away. - Six "Switch player to X" commands are registered globally by
WorkspacePlayerCommandsContributor(VideoJS, HTML5, ArtPlayer, Embedded MPV, MPV, VLC). Each command carries arequiresflag gating its visibility: the MPV/VLC ("managed-external") entries are visible only whenRuntimeCapabilitiesService.supportsManagedExternalPlayersis true, and the Embedded MPV ("embedded-mpv") entry is visible only after the command palette lazily preloads an asyncwindow.electron.getEmbeddedMpvSupport()check and it resolves tosupported(mirroring the Settings dropdown gate). Do not run this Embedded MPV support check from workspace shell bootstrap: supported desktop builds may load the native addon while resolving capabilities. The entry matching the currentSettingsStore.player()value is disabled. The new player setting applies to the next playback session; an existing stream is not re-mounted.
Settings search
Settings rows are searchable from the header search on /workspace/settings
and from the command palette. Both use the same index and ranking.
- The index is
SETTINGS_SEARCH_ENTRIESinlibs/workspace/shell/util/src/lib/settings-search/, published through the@iptvnator/workspace/shell/util/settings-searchsub-entrypoint. Eager code imports the main shell util barrel, so the index stays out of it and ships only in lazy chunks (the initial-bytes ratchet enforces this). - Each entry names its section, title and description translation keys,
untranslated synonyms (
keywords), runtimerequires, and an optionalfallbackId. Section definitions (SETTINGS_SECTION_DEFINITIONS) are the single source for the settings navigation too. - Every titled
.setting-itemin the section templates carriesdata-setting-id.settings-search-registry.spec.tsfails when a row, id, title key or description key drifts from the index, so a new settings row must be added to the index in the same change. SettingsSearchService.search()matches the translated title and description of the current language plus the keywords; every query token must match (AND), and a label prefix outranks a word start, which outranks an inner match. Rows whoserequiresthe runtime lacks are never returned. Embedded MPV rows depend on a lazy support probe (ensureEmbeddedMpvSupportLoaded()), run when the settings page or the command palette opens, never from shell bootstrap; frame copy also needsframeCopyAvailable, matching the settings page gate.- Settings routes use
local-filtersearch mode, so the term lives inq. Whileqis set, the settings page shows ranked results in place of the section page and the settings context panel shows per-section match counts, muting sections without matches. The search box is shown on settings even when no playlist exists. - Choosing a result, pressing
Enterin the header search (best match), or picking a settings command in the palette callsreveal(): it navigates to the section page withoutq(which clears the box) and the page scrolls to, focuses, and briefly highlights the row once the form is hydrated. A row hidden by the current form state falls back to itsfallbackId, the control that makes it appear. A reveal must win over the typed term:WorkspaceShellSearchSyncServicedrops a keystroke still waiting for its debounce throughonReveal(), and Enter does not apply the term first, because eitherqsync navigation would supersede the reveal navigation. Keyboard users keep a:focus-visiblering on the row after the highlight fades. Ctrl/Cmd+Fon settings focuses the header search instead of opening global search.
Keyboard shortcut help is shell-owned:
WorkspaceKeyboardShortcutsServiceis provided byWorkspaceShellComponent. It owns the workspace-scopeddocument:keydownlistener for?/Shift+/.- The listener ignores events from inputs, textareas, selects, and
content-editable elements via
isTypingInInput(...). libs/portal/shared/util/src/lib/keyboard-shortcut-definitions.tsis the metadata registry for shortcuts shown in the help dialog and documented in README.keyboard-shortcuts.tsowns the display transformation and help trigger detection. Shortcuts that only work through the Electron bridge, such as embedded MPV controls, must setelectronOnly: trueso the PWA dialog does not advertise unavailable commands.- New custom shortcuts should be added to that registry when the handler is
added. Do not include native browser/editor behavior such as
Tabor platform text editing shortcuts.
Window Chrome And Custom Title Bar
The Electron window hides the native title bar on all desktop platforms
(titleBarStyle: 'hidden' in apps/electron-backend/src/app/app.ts):
-
macOS keeps the native traffic lights (
titleBarOverlay: true,trafficLightPositionfromMACOS_TRAFFIC_LIGHTS_POSITIONin@iptvnator/shared/interfaces); the renderer draws no window buttons. The lights sit in the header band (--workspace-header-band, 56 px) over the rail and the header's leading padding. The macOS rail (.app-rail.is-macos) starts its first link below the band: level with the content area and the dashboard hero, with its hover surface clear of the lights. The header's content starts 84 window pixels from the window's left edge (60 px rail plus 24 px padding). macOS 26 ends the lights at 76 (earlier releases at 68), which is where Back's left edge sits at 100 % because of its 8 px pull-in.App zoom (see "Zoom level") scales CSS pixels but not the lights. On macOS,
TrafficLightsClearanceDirectiveon.workspace-shellreads the page zoom factor (outerWidth / innerWidth, refreshed onresize) and publishes the clearance in CSS pixels as--traffic-lights-clear-x(84 window pixels) and--traffic-lights-clear-y(48: the lights' bottom plus a gap). Zoomed out, the band grows to the vertical clearance, so the lights never overlap the content area. The header's leading padding grows to the horizontal clearance, less the rail column (--workspace-header-lights-inset). At 100 % both match the default layout. Off macOS nothing is published and the defaults apply. The phone layout, which puts the rail in a row above the header, ignores the inset.window-controls.e2e.ts("macOS traffic lights") checks the rail alignment, the first header control (the switcher on the first page, which has no history fallback yet, then a detail page's Back) and the content top at default and minimum zoom. -
Windows and Linux use renderer-drawn window controls (
app-window-controls,libs/ui/components/src/lib/window-controls/).frameis intentionally left untouched so native resize borders and window snapping keep working.
The controls are mounted once in app-root (not inside the workspace
header) as a position: fixed top-right overlay so they stay clickable
above full-window content such as Material dialog backdrops — the same behavior as the macOS traffic lights. Because
CDK overlays render as popovers in the browser top layer (above any
z-index), the component host is itself a popover="manual" element: it
enters the top layer on init and re-enters it (hide + show) whenever
another popover opens, so the controls always paint last. The
z-index: 10000 remains only as a fallback when the popover API is
unavailable. They render only when
RuntimeCapabilitiesService.usesCustomWindowControls is true (Windows/Linux
Electron with the window-control bridge methods available); the PWA and
macOS never mount them.
IPC contract (constants in libs/shared/interfaces/src/lib/ipc-commands.ts,
handlers in apps/electron-backend/src/app/events/window.events.ts):
-
WINDOW:MINIMIZE,WINDOW:TOGGLE_MAXIMIZE,WINDOW:CLOSE,WINDOW:GET_STATEareipcMain.handlechannels resolved from the sender WebContents. Close goes throughwin.close()so the existing window-bounds persistence inapp.tsstill runs. -
WINDOW:STATE_CHANGEDis pushed main → renderer on maximize/unmaximize and on the fullscreen events —enter/leave-full-screenplus theenter/leave-html-full-screenvariants emitted for HTML-element fullscreen (video player fullscreen) — so the maximize/restore glyph stays correct for externally triggered changes (double-click on a drag region, OS snap, F11). The controls hide themselves while the window is fullscreen.Window state is never re-read at event time.
attachWindowStateEventsseeds{ isMaximized, isFullScreen }once at window creation and each event patches only the flag it names; every push carries a copy of that tracked state. On Windows both getters can still report the pre-transition value while the matching event fires —isFullScreen()staystrueduring an HTML fullscreen exit, andisMaximized()readsfalsewhile the window is fullscreen. Because the renderer replaces both flags on every push and no later event corrects a stale one, polling left the controls hidden forever after leaving fullscreen and stuck the maximize/restore glyph on the wrong icon. Regression coverage:app-window-state.spec.tsandwindow-controls.e2e.ts.The pushed
isFullScreenis the OR of two flags tracked apart: native (OS-level, fed byenter/leave-full-screen) and HTML-element (fed by the*-html-*pair). Electron remembers when the window was already natively fullscreen before the player entered HTML fullscreen and then leaves ONLY the HTML state on exit — noleave-full-screenfires and the window stays fullscreen — so a single flag cleared byleave-html-full-screenwould un-hide the controls over a window that is still fullscreen. A fullscreen launch (below) or F11 followed by the player'sF→Escmakes that path routine on Windows/Linux. -
WINDOW:TOGGLE_FULLSCREENtoggles OS-level fullscreen (setFullScreen) and, like the maximize toggle, reports the requested state and leaves theWINDOW:STATE_CHANGEDpush authoritative. Because the transition is asynchronous —isFullScreen()reports the old value until it lands, and on Windows even while the matching event fires — a toggle must never be decided against the getter. Every native fullscreen request goes through the tracker inapps/electron-backend/src/app/services/native-fullscreen-transitions.ts(the F11 toggle AND the startup fallback below). Like the state pushes above it keeps its own per-window fullscreen state, seeded from the getter once at window creation (trackNativeFullScreenininitMainWindow, while no transition can be in flight) and fed afterwards only by theenter/leave-full-screenevents, which also cover transitions the app did not request. A toggle is decided against the pending target while a transition is in flight, else against that tracked state: two quick presses are an enter-then-exit, not two enters, and F11 during the startup animation leaves fullscreen instead of asking for it again. The tracker observes and never issues a request on its own. The pending record is the LATEST requested target: an event landing on it clears it, an event landing on the other state (an earlier request of a burst landed first; ours is still queued) leaves it in place so the next press still follows the user's latest intent, and a record older thanFULLSCREEN_TRANSITION_TIMEOUT_MS(2 s) is ignored. Events cannot say which request they belong to, so any automatic "repeat the target" on a mismatch is indistinguishable from reversing the user's own green-button/Ctrl+Cmd+F action and is deliberately not done: should a platform ever drop a queued request (Electron queues them on macOS and applies them synchronously elsewhere), the record expires, the event-fed state takes over and the next press corrects the window. The renderer binds it to F11 inWorkspaceKeyboardShortcutsService(deliberately not gated byisTypingInInput— it must work from any focus, because it is the only exit from a fullscreen launch on Windows/Linux, where the title bar is hidden and the controls hide themselves) and skips the key whiledocument.fullscreenElementis set, since the player's ownF/Escown HTML fullscreen and F11 must not yank OS fullscreen out from under it. Without a bridge (PWA) F11 is left to the browser.
Startup window mode (Settings.startupWindowMode, issue #1455):
normal(default) /maximized/fullscreen, chosen in Settings → General ("Window on startup"). Electron only — the select renders only whenRuntimeCapabilitiesService.supportsStartupWindowModesees bothupdateSettingsandtoggleFullScreenWindowon the bridge, so the mode is never offered without its F11 exit.- Settings live in the renderer's IndexedDB, which the main process cannot
read at window creation, so the
SETTINGS_UPDATEhandler mirrors the value into electron-conf (STARTUP_WINDOW_MODE, the same pattern as the frame-copy flag) andinitMainWindowreads it synchronously. A change therefore applies on the next launch. Both sides normalize throughnormalizeStartupWindowMode, so junk never reaches the config file or the window options. fullscreenis theBrowserWindowconstructor option: on Windows/Linux the window is created hidden and enters fullscreen before its first paint. macOS ignores the option while the window is hidden (an NSWindow only toggles fullscreen once it is on screen), so the first show repeats the request withsetFullScreen(true)right aftershow()whereverisFullScreen()is still false — never unconditionally, or the platforms that honoured the option would animate a second toggle. The saved bounds stay spread into the options — they are the normal bounds the window returns to, and the close handler keeps persistinggetNormalBounds().maximizedcallsmaximize()right before the firstshow(), never earlier:maximize()on a hidden window shows it, and a blank window would flash. That first show happens atready-to-showor the main frame'sdid-finish-load, whichever comes first (services/main-window-first-show.ts): on Linux a hidden window whose startup scripts ran before its first frame gets the next one about a second later, soready-to-showalone left the window off screen and the splash's animation frame waiting. Atdid-finish-loadthe inline splash is parsed, and the window'sbackgroundColoris the splash colour (MAIN_WINDOW_BACKGROUND_COLOR, keep it in sync with#initial-splashinapps/web/src/index.html), so showing before the first paint does not flash.iptvnator --fullscreen(read viaapp.commandLine.hasSwitch, so it can sit anywhere in argv; the playlist-path extractor already skips every--prefixed argument) forcesfullscreenfor that launch only and is never persisted. Resolution lives inapps/electron-backend/src/app/services/startup-window-mode.ts. The switch is consumed by the first window (launchFullscreenSwitchConsumedinApp): on macOS the process outlives its last window and the Dock re-creates it through the sameinitMainWindow, which must then follow the stored setting only. A second-instance launch carrying the switch is ignored — the window already exists.- Deliberately not offered: kiosk mode (removes the exit path) and
"remember last state" (bounds persistence stores normal bounds only; an
explicit choice is clearer). Regression coverage:
app.spec.ts("startup window mode"),settings.events.spec.ts,window.events.spec.ts, and the startup-window-mode cases insettings.e2e.ts.
Zoom level (Cmd/Ctrl and +/−/0, issue #1109):
- The packaged renderer runs under
file://with path routing. Chromium keys per-host zoom by the FULL URL when a URL has no host, so everypushStateto another section owns a separate zoom entry: after a route changewebContents.getZoomLevel()already reports that entry (usually 0) and the next visual-properties sync — a window resize, a display change — snaps the renderer back to it. Chromium persists those per-URL entries inPreferenceson its own, which is why the level used to "appear briefly" onindex.htmlat startup and then reset. Dev mode (http://localhost:4200) is per-host and never shows this, so only a packaged orELECTRON_IS_DEV=0run can verify zoom behaviour. - Restore therefore happens in the preload, not the main process:
applyPersistedZoomLevel(api/preload-zoom-level.ts) asks for the stored level over the synchronousWINDOW:GET_ZOOM_LEVELIPC at preload start and applies it withwebFrame.setZoomLevel, which installs a TEMPORARY, frame-bound zoom level. It survives in-page navigation and resizes, the zoom shortcuts (point 4) step it through the same call, andgetZoomLevel()reports it regardless of the route.webContents.setZoomLevelfrom the main process would write the per-URL entry and re-create the bug. When nothing is stored the preload re-applies the current level for the same reason: entering temporary mode makes the first zoom shortcut URL-independent too. A failed request is swallowed and only costs this load its restore. The apply is deferred toDOMContentLoaded— never at preload start and never from asetTimeout: on Linux and Windows awebFrame.setZoomLevelthat early leaves the hidden window without a first frame,ready-to-shownever fires,show()never runs, and the renderer gets no animation frames (the splashmain.tsremoves in arequestAnimationFramestays). macOS is unaffected and CDP-driven tests force frames, so only the packaged Linux/Windows E2E asserting the splash is gone caught it (legacy-playlist-migration.e2e.ts, defer-epg). After the parser finishes the call is harmless and still lands before the first Angular paint. The preload then sendsWINDOW:ZOOM_LEVEL_APPLIED. - Chromium never persists temporary zoom, so
services/window-zoom-level.tsowns the electron-conf keyZOOM_LEVEL: the applied acknowledgement (not the request — between the two the sender'sgetZoomLevel()is still the per-URL default) marks the sender as owning the level,persistZoomLevelwrites it back from the windowcloseand appbefore-quithandlers (the bounds-only saves of before, folded intopersistWindowState), andattachZoomLevelPersistencealso writes it on every main-frame cross-documentdid-start-navigation— a reload drops the temporary level, and bydid-finish-loadthe new document's preload has already read whatever was stored. That navigation also releases ownership until the next preload answers, so a close mid-reload cannot save the per-URL default over the user's level. - The shortcuts are a renderer key binding, not a native menu: the
Windows/Linux window calls
setMenu(null), so no accelerator could reach it there.WorkspaceKeyboardShortcutsService(libs/workspace/shell) listens on the document like it does for F11 and resolves the chord withresolveZoomShortcutAction(libs/portal/shared/util): Cmd on macOS, Ctrl elsewhere, never Alt;+/=(soCtrl+=andCtrl+Shift+=both zoom in),-/_,0, and the numpad+/-/0(bycode, since a NumLock-off0reportsInsert). Keys are matched byevent.key, so non-US layouts zoom with their own+/-keys. Like F11 it is not gated by the typing-target check — browsers zoom from any focus — and a key another handler alreadypreventDefaulted is left alone. The binding calls the synchronous, preload-localwindow.electron.adjustZoomLevel(adjustFrameZoomLevelinapi/preload-zoom-level.ts), which steps the frame's temporary level through the samewebFrame.setZoomLevelas the restore and returns the level applied — never a main-processwebContents.setZoomLevel, which would re-create the per-URL bug. The step and limits live inlibs/shared/interfaces/src/lib/zoom-level.util.ts(stepZoomLevel): 0.5 per press, Electron's ownzoomIn/zoomOutrole step (≈10 %), clamped to levels −4…6 (≈48 %…299 %, inside Chromium's 25–500 %), off-grid levels snapping to the next grid point in the pressed direction;Ctrl/Cmd+0returns to level 0. A stored level already outside the limits (the macOS menu roles never clamped) is never moved against the request: a press further out leaves it, a press back in lands on the limit. Persistence needs nothing extra: the main process reads the live level back (point 3). On macOS the default application menu still carries thezoomIn/zoomOut/resetZoomroles, but Chromium hands a key equivalent to the web contents first and Electron performs the menu equivalent only inWebContents::PlatformHandleKeyboardEvent(shell/browser/api/electron_api_web_contents_mac.mm, Electron 43.3.0), the unhandled-keyboard-event hook — apreventDefaulted keydown never gets there, so the binding keeps one press at one step. CDP-dispatched keys (the E2E) never reach the menu at all. Without a bridge (PWA) the browser keeps its own zoom, and the help dialog lists the chords as Electron-only. Regression coverage:window-zoom-level.e2e.tspresses the real shortcuts (in, out, numpad, reset) and measures the rendered factor (content width ÷window.innerWidth) across a section change, a resize, a reload and a restart; key resolution and the bridge step are unit-tested inkeyboard-shortcuts.spec.ts,workspace-keyboard-shortcuts.service.spec.tsandpreload-zoom-level.spec.ts.
Reloading the renderer on an in-app route:
- The packaged renderer is
dist/apps/web/index.htmloverfile://and Angular routes by path (no hash strategy), so once the user is on a section the document URL isfile:///…/web/workspace/sources— a path with no file behind it. A reload of that URL fails withERR_FILE_NOT_FOUND(-6) or is cancelled outright, depending on who starts it. Two user-reachable triggers: the macOS default application menu (nothing callsMenu.setApplicationMenu, so View › Reload / Force Reload are live; Windows/Linux drop the menu bar viasetMenu(null)), and the settings unsaved-changes guard, which callswindow.location.reload()after the user confirms a reload intent on/workspace/settings/<section>. Dev mode (http://localhost:4200) never shows either — the dev server serves the index for every path. - Both legs live in
services/renderer-reload-fallback.tsand end in the samerestoreRendererRoute: load the packaged index with the routed URL's route — its path relative to the renderer root plus query and fragment (resolveRoutedRendererUrl) — in therestoreRoutequery parameter.- A main-process reload (
webContents.reload(), the menu role, DevTools) fires nowill-navigate, so it cannot be redirected up front: it fails, Chromium commitschrome-error://chromewebdata/andapp-rootstays empty until the app restarts.attachRendererReloadFallbackrecovers it after the fact from the main-framedid-fail-loadwithERR_FILE_NOT_FOUND(resolveReloadedRendererRoute); other error codes, subframes and non-file:URLs are left alone. The recovery load is deferred to the error page'sdom-readyand never issued from insidedid-fail-load: aloadFilestarted while Chromium is still committing the error page yields a document that never receives animation frames — the splash stays, nothing paints, whiledocument.visibilityStatestill saysvisible— and the same load afterdom-readypaints normally (Electron emitsdid-fail-loadbefore thatdom-ready). A cross-document navigation starting in between withdraws the pending recovery, so a staledom-readycan never re-load the index over a newer navigation. - A renderer-initiated reload (
location.reload(), the settings guard) does firewill-navigate, where the routed URL is not the trusted index andhandleRendererNavigationwould cancel it — silently, so the confirmed reload simply never happened. The handler now recognizes a routed renderer URL and sends it straight to the index with its route, with no failed load in between; every other untrusted navigation is still blocked (external URLs still open in the browser). A failedindex.htmlitself is never re-requested (it would loop):resolveRoutedRendererUrlrejects the index, and the recovery load carriesindex.htmlas its path, so a second failure cannot recurse.
- A main-process reload (
- The renderer consumes the parameter before Angular bootstraps:
apps/web/src/main.tscallsresolveRestoredRendererRoute(libs/shared/interfaces/src/lib/renderer-reload-route.util.ts, which also owns the parameter name) and installs the result withhistory.replaceState, so the router's initial navigation lands on the route the user was on. The route is resolved againstdocument.baseURI(the packaged<base href="./">, i.e. the renderer directory — the same prefix Angular strips fromlocation.pathname), and anything that would leave that directory (an absolute URL, another scheme, a..escape) is dropped with only the parameter removed, so the app boots at its default route instead of following an arbitrary target. - Zoom persistence is unaffected: the failed reload's
did-start-navigationalready saved the level and released ownership, the recovery load'sdid-start-navigationis then a no-op, and the new document's preload restores the level as after any other reload. The main-process close guard also treats the recovery like any full navigation (did-navigatedisarms it). - Regression coverage:
renderer-reload.e2e.tsreloads from the main process (webContents.reload(), the menu role) on Sources and from the renderer (window.location.reload(), the settings guard) on a settings section and asserts a NEW document is rendered on the same route with the parameter gone (renderer-reload.support.tsmarks the old document, since the URL alone is identical before and after);window-zoom-level.e2e.tsreloads the same way. Unit coverage:renderer-reload-fallback.spec.ts,renderer-reload-route.util.spec.ts,app.spec.ts("renderer reload recovery").
Layout integration:
document.bodygets aframeless-platformclass (set inAppComponent, same mechanism asdark-theme) — body-level so rules also reach cdk-overlay content rendered outsideapp-root.apps/web/src/styles.scssreservespadding-right: 150pxin the top-aligned drag region (.workspace-header) for the 3 × 46px button strip.- Button colors follow the theme via CSS variables (
--app-on-surface,--app-hover-overlay); the close button uses the Windows-style red hover (#e81123). No theme IPC is involved.
Window decorations on Linux (shadows, corners):
- Hiding the title bar removes the window manager's decorations, so the shadow/rounded corners must come from client-side decorations (CSD). Electron 43 enables rounded corners by default when the Linux desktop environment supports CSD. GTK drop shadows and extended resize boundaries remain environment-dependent; Electron selects native Wayland automatically on Wayland sessions.
- Linux environments without CSD support can still show a square, undecorated window. Windows 11 keeps its DWM rounded corners and shadow because the standard frame is retained.
Toolchain notes for the Electron 43 baseline:
better-sqlite3remains pinned exactly so native dependency updates happen deliberately with database-worker, packaging, and Electron E2E validation. Version 13 uses Node-API and ships its supported platform binaries in the package. It must not be listed in pnpm'sonlyBuiltDependencies: forcing an implicitnode-gyp rebuildbypasses those binaries and makes installation depend on the host compiler toolchain. The oldnode-abioverride belonged to v12's removedprebuild-installpath and is no longer required.- Local development supports Node 22.22.3–22.x or 24.15.0–24.x, declared in
enginesas^22.22.3 || ^24.15.0. Use.nvmrc(currently 22.23.2) for development and CI. Angular 22 sets this supported LTS range and requires TypeScript>=6.0 <6.1.electron-builder26.15.7 also pulls@electron/rebuild4, which requires Node 22.12 or newer, and the rootpostinstallrunsinstall-app-depson everypnpm install. The 26.15.7 minimum also carries the v26 backport that fully extracts the Snap template's.tar.7zpayload; 26.15.0–26.15.6 can produce a Snap that is missingdesktop-init.sh. - Dependabot keeps Electron, native database, packaging, EPG parser, and version-locked Shaka/mpegts updates out of the shared npm minor/patch group. Those dependencies require standalone PRs so their dedicated package, worker, playback, and diagnostic-contract validation cannot be hidden by an unrelated grouped update.
- Electron 42 and newer download their development binary on the first
Electron command instead of during package
postinstall, soelectronmust not remain in pnpm'sonlyBuiltDependenciesallowlist. The first localpnpm run serve:backendcan include a one-time download; usepnpm exec electron --versionto prewarm it before an offline run.
Known caveats:
- DIY buttons cannot show the Windows 11 Snap Layouts flyout (only native caption buttons or the Window Controls Overlay get that).
- Double-click-to-maximize on drag regions is handled natively by Electron/Chromium; on Linux the exact behavior depends on the window manager.
Maintenance Guidance
Use this document as the source of truth when changing workspace shell behavior.
- New top-level user destinations should default to child routes under
/workspace. - Shared provider navigation logic belongs in portal-shared util/UI libraries, not duplicated inside the shell.
- If a provider route changes how playlist/session bootstrap works, update the route-session provider and shell-facing route contract together.
- When adding a non-native keyboard shortcut, update the shared shortcuts registry, the help dialog tests, README, and the closest behavior test.
- Historical migration notes, cleanup lists, and one-off refactor steps should stay out of this file; track them in issues or PR notes instead.