* feat(sources): add the shared source row and credential-free formatting One app-source-row (regular for the Sources page, compact for the playlist switcher) with an app-source-tile, built on pure helpers: - resolvePlaylistSourceKind: one provider rule for icons, filters and counts (the list filter and the panel counts used to disagree). - sourceDisplayName / sourceDisplayUrl: a name or URL never shows a password, token or MAC. URL imports that stored "get.php?username=…&password=…" as the title now show the host. - stripUrlCredentials (shared/logging): drops what the log redactor would mask, plus short user/pass keys. - formatSourceDate / sourceMetaParts / sourceStatusTag: one meta line order and Intl dates and durations in the UI language. - SourceStatusService + SourceHealthHistoryService: one status per source (desktop health check, browser Xtream portal status) and the last conclusive result kept across restarts, so "not responding for 3 days" survives a relaunch. No URL or credential is stored. Also fixes playlistNameHasCredentials answering differently on repeated calls (global regex lastIndex), and adds the UI-kit button, menu and segmented-control mixins (libs/ui/styles/_app-controls.scss); menus opt in with class="app-menu", styled by the components that use them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat(sources): rebuild the Sources page on the shared source row - Side list (UI-kit side list): title with the playlist count and an Add button, a Type group, and on desktop a Status group (Any / Responding / Not responding). The two filters combine and persist; each group counts within the other's choice. The chosen row uses one selected-row token (soft tint, outlined in light theme). - Page: a 28px title with the visible count instead of the bordered header bar; Clean up and the sort menu are secondary buttons. Clean up shows how many sources do not respond. Sort adds Last updated, Most channels and (desktop) Not responding first, and keeps Name Z-A and Custom order. - List: app-source-row with hover actions (Refresh, Edit, ⋯); a failing row keeps Retry in view. "No matches" offers Reset filters. Dragging in custom order no longer reuses positions of rows a filter hides. - Delete with Undo: no confirmation; the row leaves at once and the delete runs when the toast closes (its close button commits at once). Deleting the active source switches to the next row. A large Xtream delete shows its row as "Removing…" with progress and Cancel, as before. - The list's refresh flows moved into SourceListRefreshService; E2E and performance drivers follow the new markup and delete flow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat(switcher): restyle the toolbar trigger and open it with Cmd/Ctrl+P - The trigger is a 40px secondary button: the active source's tile with its status dot, its name and "type · channels" (or the source count), and a chevron that turns while open. The name comes from sourceDisplayName, so a URL-named playlist no longer shows its URL or credentials in the toolbar. - Cmd+P / Ctrl+P opens the switcher wherever it is shown (Cmd+K stays the command palette) and is listed in the keyboard shortcuts dialog. - The trigger's inline refresh button is gone; refresh stays in the playlist's ⋯ menu and the command palette. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat(switcher): rebuild the playlist switcher as an overlay popover The switcher's mat-menu becomes a CDK connected overlay (app-playlist-switcher-panel), 440px wide, with a dimmed, blurred backdrop; only its list scrolls and row menus open above it. - Header with the source count, Add playlist and All sources. - Search by name or host, autofocused; the type filter is one segmented control (All / M3U / Xtream / Stalker with counts) instead of three checkboxes, remembered between openings (the old checkbox setting is migrated). The search is no longer kept between openings. - "Recent" (the three most recently opened, kept across restarts) above "All" in the Sources page order, as compact source rows: the current one tinted with a check. Each row's ⋯ menu holds Refresh, Playlist info, Account info, Check again and Remove (with Undo); the footer's info, account and add actions moved there and to the header. - Keyboard: a listbox driven by aria-activedescendant from the search field. Arrow keys move and wrap, Enter opens, Shift+F10 opens the row's menu, Escape closes and returns focus to the trigger. Hints in the footer. - Deleting from a row menu moves focus to the toast's Undo, since the row (and its focus) left the page. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * refactor(sources): remove the old source row, filter state and dead styles - Delete app-playlist-item and SourceHealthIndicatorComponent, replaced by app-source-row and its tile dot. - Delete the ngrx type-filter slice (FilterActions, selectedFilters, selectActiveTypeFilters); the Sources filters live in SourcesViewStateService. - Drop the empty state's unused "no results" variant and its styles. - The switcher and Sources list components are no longer in the max-lines baseline. - Docs: UI guidelines (source row, Sources page and switcher, status dot, selected-row tokens, UI-kit mixins), the source-health contract and the zoneless inventory. Release notes for the redesign and the credentials fix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(catalog): keep the refine menu whole in short windows The refine menu held 12 rows at 48px plus two section titles (657px). Angular Material 22 sets no max-height on a menu panel, so below ~800px the overlay was pushed up over its own Refine button, and at 600px the last thresholds were clipped behind an invisible scrollbar. The minimum-rating thresholds now open in a submenu from one row that names the active threshold. The menu is about 390px and opens below its button at 600px. The submenu trigger sits in a role="none" wrapper: Material offsets a submenu by the first direct mat-menu-item's offsetTop, and with the sort rows inside a role="group" that item was the trigger itself, which opened the submenu 335px off screen. The Electron E2E opens both menus by keyboard in a 600px-tall window and checks that each lies whole on screen without scrolling. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * style(workspace): drop the side panel's divider line The context panel beside Sources, categories, Settings and collections drew a 1px outline-variant border against the content surface, whose background, shadow and rounded top-left corner already mark the edge; the line clashed with that corner. The border stays 1px but transparent, so the panel width, the persisted sidebar widths and the resize handle's position do not move. The handle keeps its hover and drag highlight. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(switcher): keep the search field and type filter whole with many sources The switcher popover is a height-capped flex column. With a long list (hundreds of sources) the browser shrank every part in proportion to its size, not only the list: the type filter, which clips its overflow, collapsed to 2px and showed no labels, and the search field dropped from 36px to its 21px text line. The header, search, type filter, empty state and footer are now flex: none, so only the list shrinks and scrolls. The search field now matches the header and side-panel search fields: the shared --app-search-* tokens, a 10px radius, an 18px icon, the same text size and focus halo. The Electron E2E opens the switcher in a 320px-tall window and checks the search height, the type toggles and the scrolling list; it fails without the fix (search 21px). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(sources): checks behind filters, keyboard Undo in the switcher, check causes Local review round 1 (Codex + Greptile) on the redesign: - A saved Responding / Not responding filter hid every source without a result, and the hidden rows were what started the checks, so the list stayed empty. keepSourcesChecked (portal shared data-access) now keeps every library source checked while the Sources page lives, on desktop where a check is one shared job that rows join. - Removing from the switcher left its focus trap open around the search, outside of which the Undo toast sits: Tab could not reach Undo. The popover now closes first; Undo takes the focus and returns it to the trigger (SourceRemovalOptions.returnFocusTo). Every switcher action closes through one path, so a closing row menu no longer pulls the focus back into the popover. - A running desktop Xtream delete brought its source back into the switcher as an ordinary option that could be opened or removed again; the switcher now leaves it out until the delete ends (the Sources page shows its progress and Cancel). - Undo re-activated the removed source over a source the user had chosen since, when nothing had replaced it (it was the only row a filter showed). Undo now restores only while no other source is active. - The switcher highlight stays on its option, or in range, when the list changes under the same search, so Enter still opens something. - The status dot named every failure "Could not connect". SourceStatus now carries the check's cause (access denied, account disabled, timeout…, kept with the health history and validated on read), and M3U dots again say the check covers the playlist URL, not its channels. Tests: new specs for keepSourcesChecked, the saved-filter check, the Undo guard and focus return, the switcher close/highlight/deleting cases and the dot's cause; the filter and Undo specs fail without their fixes. The switcher keyboard E2E now deletes and undoes from the keyboard. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(sources): own Undo timer, per-connection health history, race-free perf waits Local review round 2 (Codex + Greptile): - The delete committed whenever the shared snack bar was dismissed, so another message (a refresh finishing elsewhere) cut the four-second Undo window short and deleted the source early. The window is now the service's own timer; only the toast's close button (commitNow) or a second delete commits sooner. - The health history was keyed by playlist ID only, so an edited address or account inherited the old connection's result, failing run included. Entries now keep a 32-bit FNV-1a fingerprint of the source health key (no URL or credential); a result for another connection starts over and a stale entry no longer shows. - The M3U refresh-cancellation probe still queried the removed row's .cancel-btn, .busy-state__message and .action-spinner, so its cancel never fired; it now uses the source row's selectors (smoke run passes, cancelEffect=true). - The Xtream delete benchmark waited to catch the "Removing…" row coming back before it left, which a fast delete could finish before the wait began. The driver now arms a delete-playlist operation window before the commit click and ends on its completed event and the absent row. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(sources): sort by the shown name; start the benchmark's Undo window in its trigger Local review round 3 (Greptile; Codex was clean): - Name order compared the stored title, while the rows show a URL-named or credential-bearing source by its host: a source stored as get.php?username=… sorted by its hidden account details. sortPlaylists takes the list's name function, and Sources and the switcher pass sourceSortName, the name they display. - The Xtream delete benchmark clicked Remove while preparing, which starts the four-second Undo window; capture setup before the trigger could outlast it, so the delete committed on its own before the measurement and the close button was gone. Preparation now stops at the open menu, and the trigger clicks Remove and then the toast's close button, with the trigger time taken right before the commit click as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(sources): never hand over to a leaving source; browser checks per connection Local review round 4 (Codex + Greptile): - Removing the active source handed over to its neighbour even when that neighbour's own delete was still running ("Removing…"), activating a source about to disappear. replacementAfterRemoval (playlist shared util) picks the nearest row that is not leaving, on the Sources page and in the switcher; SourceRemovalService also refuses a leaving replacement. - In the browser build a "Check again" for an account the user then edited could finish last and overwrite the new account's status under the same playlist ID. Portal statuses are now keyed by playlist and connection fingerprint, so the old check lands under the old key. - The switcher scrolled the highlighted option into view through a selector built from the playlist ID, which a restored ID with "." or ":" broke (or made throw). It now finds the row by its exact DOM ID. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(sources): keep ⌘P out of open dialogs; redact refresh errors Local review round 5 (Greptile; Codex was clean): - Ctrl/Cmd+P opened the playlist switcher over an open dialog (an editor, a confirmation), taking the focus out of it and handing it back to the toolbar behind the dialog on close. The shortcut now leaves the key alone while MatDialog has open dialogs. - SourceListRefreshService logged a failed refresh's raw error, which can carry the playlist URL and its credentials. It now logs through the redacting portal logger (createLogger). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(sources): show a new search's first match; keep inconclusive check causes Local review round 6 (Codex; Greptile was clean at 5/5): - Typing a search or picking a type in the switcher highlighted the first match but kept the list scrolled where the previous result left it, so the highlighted row could sit above the view. The list returns to the top whenever the search or type changes. - A source with no kept history whose check was inconclusive (connection checks paused by the connectivity guard, a cancelled check) lost the live cause and time, and its dot said only "Not verified". The status now keeps them; a running check still reads as checking. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(switcher): fall back to All when the remembered type has no sources left Local review round 7 (Greptile 5/5 with one P2; Codex was clean): when the last source of the remembered switcher type was removed while two other types remained, the list kept filtering by the missing type. Its segment was gone, no segment was selected, and the list said "Nothing found". The list now filters by All until a source of that type returns; the remembered choice is kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(sources): clean credentials nested in kept URL parts Codex bot (PR review, P1): stripUrlCredentials copied every non-sensitive parameter value unchanged, so a URL nested in one (a proxy's ?url=http%3A%2F%2Fjoe%3Ahunter2%40origin.test%2F…) kept its userinfo and password and reached the Sources row through sourceDisplayUrl. Kept query and fragment values and path segments are now cleaned recursively, up to four levels: a nested URL loses its credentials the same way, a nested parameter list loses its sensitive keys, and a part that still names a secret (joe:hunter2@host, token=…) is dropped. Deeper nesting is dropped rather than shown. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(sources): keep fragment and nested URL secrets out of source names Greptile bot (PR review, P1 security): an unnamed import of https://host.test/list.m3u#api_key=secret123 stored list.m3u#api_key=… as its title. isUrlDerivedName only knew names ending in a query, and sourceSecrets only read the top-level query, so the row and the toolbar showed the secret while the displayed URL hid it. A name that ends the URL with a query or a fragment is now URL-derived, and shows the host. The secrets a typed name is checked against now include sensitive fragment parameters and, as stripUrlCredentials cleans them, the credentials of URLs and parameter lists nested in parameters (nested account names included). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(sources): keep deletes busy until settled and on screen; refresh E2E via the switcher PR #1932 round 1 (CI + local Codex/Greptile on the bot fixes): - CI: category-management.e2e refreshed the active playlist through the old switcher trigger's inline refresh button, which the redesign replaced with the switcher row menu (⋯ → Refresh playlist). The helper now goes through that menu; it failed on all three OS shards. - A desktop Xtream delete's completed event cleared its progress while PlaylistsService still cleaned up (parental lock, stored state), so the already-deleted source was actionable again on Sources and back in the switcher until the store dropped it. A terminal event now only ends Cancel; the row stays busy until the delete settles and the removal service clears it. - A running delete (from the switcher, say) disappeared from Sources when the page's saved filters excluded it, hiding its only progress and Cancel. Running deletes stay listed whatever the filters. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(sources): keep counting a failure's duration while the list stays open Local Greptile (5/5, one P2) on the PR round: the row's status tag formatted "Not responding · 3 days" against the time the row mounted (or the language last changed), so a new failure never gained its duration and an existing one froze while Sources stayed open. A shared root SourceClock now ticks once a minute and only the status tag reads it, so dates and the meta line do not recompute every minute. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(sources): keep the page header in view; mark the active source's row Local Greptile (two P2s) on the PR round, both regressions against master: - The redesigned Sources page scrolled as one, so the title, Clean up and Sort left the view in a long library (master kept a sticky header, and the UI guidelines say headers stay and lists scroll). The header now stays and only the list below it scrolls, which also keeps a row reached by keyboard from scrolling under the header. - Master marked the active playlist on the Sources page; the new row only tinted the current row in the compact (switcher) size. The active source's row is now tinted with the same --app-list-selected-* token on the page too; the switcher keeps its check. The design handoff called the header non-sticky and the current tint switcher-only; both followed master and the guidelines instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(sources): name the Sources sort group; refit the switcher on resize Local review on the PR round: - Greptile: the Sources sort menu's radio group had no accessible name, unlike every other menu group (UI guidelines). It is named by its section, "Sort by". - Codex: the switcher popover capped its height once, when it opened, so shrinking the window while it was open left the footer and the lower rows out of reach. A window resize refits the open popover. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * wip: linear URL-cleaning regexes * fix(sources): linear URL-cleaning patterns; keep the stripper off the startup path PR #1932 CI: - CodeQL (polynomial regular expression on uncontrolled data): the embedded-URL and keyed-pair patterns in stripUrlCredentials could retry from every position of a long run of letters. Matches now start only where a name can start (lookbehinds) and every name part is bounded, as is the bare-userinfo pattern; a spec times 50,000-character runs. The preceding "wip: linear URL-cleaning regexes" commit holds that change. - Initial bytes ratchet (+135 B over after master's #1928 lowered the baseline): stripUrlCredentials sat behind the shared logging barrel, which startup code imports, so esbuild placed it in an initial chunk although only the lazy Sources page and switcher use it. It now lives beside its only consumer in playlist/shared/util source-display, and the logging barrel exports the two redaction helpers it needs. Measured locally on the merge with master: 1,537,497 bytes, within 1,538,700. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(sources): case-insensitive Xtream path markers; no removal during a refresh - Strip and redact the account segments after `/LIVE/`, `/Movie/` or an encoded marker such as `/%6Cive/`, as after `/live/`. The display-name check also treats an Xtream path password as a URL secret. - A source cannot be removed while a switcher refresh clears and refills it: the removal service ignores the request, the switcher disables Remove, and the Sources page shows the refresh as busy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(sources): search URLs nested in path segments for name secrets A proxy URL can carry a whole source URL, or a token pair, in one path segment. The display stripper already cleans such segments; the name check now collects their secrets too, so a name holding them collapses to the host. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(sources): decode nested URLs before classifying; narrow Xtream paths - A URL nested in a parameter or path segment is percent-decoded one round at a time until it reads as a URL or parameter list, so one encoded twice is cleaned too; a value still encoded after the last round is dropped. The name check unwraps nested values the same way. - The two segments after `/live/` and its siblings count as an account only when a stream follows them, so a playlist path such as `/live/news/list.m3u` keeps its file name in the URL and the title. - Adding a playlist from the phone drawer closes the drawer first, so two focus-trapped modals never stack. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(sources): clean URL-shaped fragments; one registry for busy sources - A fragment is cleaned whatever its shape: `#https://joe:pw@…` loses its userinfo, an unclassifiable secret is dropped, and the name check reads a URL in the fragment as well as a parameter list. - Every refresh holds its source in the root SourceActivityService, which deletes and the startup auto-refresh already use: Sources-row refreshes, the switcher's M3U refresh and the shared Xtream flow. The switcher no longer offers Refresh or Remove for a source the page is refreshing, the removal service ignores a held source, a second refresh from either entry point is skipped, and the page disables Remove while it is held. - The long-input timing spec allows 3 s: the inputs take about 0.25 s, a backtracking pattern takes minutes, and a loaded runner took 1.6 s. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(sources): keep a browser refresh busy until the backend answers The browser build's PLAYLIST_UPDATE returned at once while its request ran on, so the row stayed refreshable and removable and the shared registry saw the source as idle. The event now settles when the refresh does (the PWA service resolves after its success or error report; the Electron fallback awaits its handler), and both the Sources row and the switcher keep the source busy and held until then. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(sources): name check hides values under short account keys The name check used the log redactor's key list, which leaves out the short keys `pass`, `pas`, `user` and `usr` that the URL stripper drops. Both now share `isDisplaySensitiveKey`, so a name holding `?pass=…` collapses to the host; `user`/`usr` are account names like `username` and stay shown at the top level, as by design. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(sources): read keys, markers and secrets through every encoding layer Each check decoded its input once, so one more encoding layer slipped a secret past it: `?%2570assword=…` kept its value, and `/%256Cive/…` kept its account segments, both on screen and in logs. `decodeFully` (shared logging) undoes up to four percent-encoding layers and is now the one form every name check reads: the redactor's key normaliser and Xtream marker check, the display key predicate and path check, and the name check's secret values. Logs and the Sources lists gain the fix together. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(sources): read Xtream paths decoded; keep short decoded forms out - An Xtream account could hide behind encoded separators (`live%2Fjoe%2Fhunter2%2F1.ts` is one raw segment). `findXtreamAccount` reads the path as decoded parts, maps them back to raw segments, and is the one scanner for the log redactor, the on-screen URL and the name check. Account segments go whole, joined ones included. - The name check required a minimum length only of the raw secret, so a decoded form as short as one letter (`%2542` is `B`) hid ordinary names. Each form must now be long enough on its own. - The decoding helpers move to `url-credential-parts.ts`, which keeps the redactor under the line limit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(sources): read an Xtream path both whole-segment and split Reading the path only as decoded parts misplaced the account when the user name itself held an encoded slash (`/live/joe%2Fx/hunter2/1.ts`): the password segment stayed on screen and in logs. `findXtreamAccount` now scans both readings, each raw segment decoded whole and the decoded path split on every separator, and drops what either finds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(sources): drop JSON configs from shown URLs; read their secrets A nested value such as `?config={"password":"…"}` was neither a URL nor a parameter list, and the quoted key slipped past the free-text check. - A nested value that parses as a JSON object or array is dropped from the shown URL (JSON can spell a key so no pattern reads it, such as `w`); brackets that are not JSON, like `[1080p]`, stay. - The free-text check accepts a quoted key (`"token": …`). - The name check parses JSON values and collects what sits under sensitive keys, and follows URLs in its other strings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(sources): hold Xtream sources through re-import; match secrets in any case - An Xtream refresh released its hold when navigation ended, while the re-import ran on from the route session, so Remove came back during the import's writes. The route session now takes the hold synchronously on NavigationEnd and keeps it until its sync, and the import it awaits, settle; the store also holds the source for every content initialization, retries included. - Secret matching was case-sensitive against encodeURIComponent's upper-case escapes, so `%3a` or a lower-case MAC slipped through. Text and secrets are now compared lower-cased, the text also fully decoded. - The Xtream `· username` label is left out when it is, or holds, the password. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(sources): read a bracketed key as parameters unless it is JSON The name check returned early for any value starting with `{` or `[`, so `[password]=…` (not JSON) skipped the parameter check and its password stayed in the name. It now returns early only when the value parses as a JSON object or array. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(sources): no opening a source from the switcher mid-refresh While an Xtream refresh was still deleting the catalog, ⌘P could reopen the switcher and selecting that source navigated at once, starting its import before the user data to restore was parked. The refresh flow now exposes `isRunning` (its set of runs is a signal), and the switcher marks a refreshing source aria-disabled and ignores its selection by pointer and Enter alike. Imports alone do not block opening a source. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(sources): hand over only to an idle source; hide names that are a short secret - Removing the active source could hand over to a neighbour a refresh was still clearing, opening it and starting its import early. `SourceRemovalService.canTakeOver` (not leaving, not deleting, not held in SourceActivityService) now picks the replacement in both lists and gates it in the service. - Secrets under three characters were dropped from the check entirely, so a name that was just a two-letter password showed it. Short secrets now count as the whole text (trimmed, any case); longer ones still match inside a text. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(sources): offer Refresh only when it can run; drag handle never opens - PlaylistRefreshActionService runs one refresh at a time, but canRefresh checked only the source, so the switcher, the command palette and the dashboard offered a Refresh that refresh() then ignored. canRefresh now applies the same global guard. - In Custom order a click on a row's drag handle bubbled to the row and opened the source; the handle now stops it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(sources): no idle Refresh on held rows; Recent counts the filtered list - The Sources page offered Refresh on a source the startup auto-refresh, an import or a delete held, and refresh() then refused it. The row now offers Refresh only while it can run, keeping it (with its spinner) while that source refreshes. - The switcher showed Recent whenever the library had six sources, so a type filter down to one or two listed them twice and the keyboard visited each twice. Recent now depends on the filtered count. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(sources): compare passwords in their own case; only a MAC caselessly Matching every secret lower-cased hid any name holding the password word in another case: the Electron E2E source "Stress Xtream Portal" (password `stress`) showed its host, and the deletion test could not find its row. A password is case-sensitive, so it is compared as written; the text is still read fully decoded, so `%3a` escapes count as `:`. A MAC is the same address in either letter case and is compared lower-cased. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(sources): match a MAC from the URL in any letter case Only the source's own `macAddress` was compared caselessly, so an M3U URL carrying `?mac=…` (nested ones too) left the MAC visible in a name written in another case. Any MAC-shaped secret, and every form of the source's own MAC, is now compared lower-cased; passwords keep their case. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * perf(sources): keep source-health helpers off the startup path Master's #1931 lowered the initial-bytes baseline, and this branch then sat 535 bytes over its slack. Most of its growth was runtime helpers in `@iptvnator/shared/interfaces` (reachability, health history, reason and fingerprint helpers) that only the lazily loaded source services call: the bundler put them in a chunk the app preloads. They now live in `@iptvnator/portal/shared/data-access` beside those services (types stay in interfaces); initialBytes 1,350,438 → 1,349,048, 855 under the limit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
20 KiB
Zoneless change-detection migration
Working checklist for plan item C6 of the performance journeys plan: move the
renderer (apps/web) from zone.js to provideZonelessChangeDetection().
The win is measured with the change-detection tick counters described in
performance journeys; the
idle work audit found the Eager roots that
re-render on every tick. Update this file in the same PR that converts an item.
The inventory was taken on e8b181fce (2026-10-04, Angular 22.1.6). Run
pnpm nx run electron-backend-e2e:test-performance-harness after editing the
Eager list: zoneless-migration.spec.ts fails when the list and the code
disagree, so a new Eager component cannot land unnoticed and a converted one
must be ticked here.
Starting point
- OnPush is already the default. Since Angular 22 an unset
changeDetectionmeans OnPush, and the oldDefaultstrategy is spelledChangeDetectionStrategy.Eager. Only components that setEagerare checked on every tick.ChangeDetectionStrategy.Defaultis not used. - Renderer bootstrap.
apps/web/src/app/app.config.tsprovidesprovideZoneChangeDetection({ eventCoalescing: true })andapps/web/project.jsonbuilds with"polyfills": ["zone.js"].apps/remote-control-webdoes the same; it is a separate app and outside this migration unless a step says otherwise. - Unit tests already run zoneless. Every
src/test-setup.ts(apps/web, apps/remote-control-web and 24 libs) callssetupZonelessTestEnvand loadszone.js/zone.js/testingonly forfakeAsyncandwaitForAsync. A component that passes its specs is therefore not proof of zone-free production behavior when the spec callsfixture.detectChanges()itself. - IPC callbacks never ran in the Angular zone.
window.electron.on*listeners arrive throughcontextBridgeand are not zone-patched, so every one that works today already writes signals or callsNgZone.run. - Counters before the migration (macOS, from
performance journeys):
renderer.cdTicksToFirstCard20–21 (the one-tick zone.js race),renderer.cdTicksIdle30s3,renderer.cdTicksToFirstPage22;renderer.cdTicksToPlayinghas no recorded run yet.
PR sequence
- Keep
@ngrx/store-devtoolsout of production bundles (#1810, open). Not a zone change; it loweredrenderer.initialBytesbefore the migration starts moving it. - This inventory and its guard spec.
- Per-project PRs, in this order, each converting the project's Eager
components and fixing its zone-dependent sites while zone.js stays on:
libs/ui/*,libs/workspace/*,libs/playlist/*,libs/portal/*, playback (libs/ui/playback,libs/playlist/m3u/feature-player),apps/web. Each reports the tick counters before and after and runs the affected unit and E2E tests. provideZonelessChangeDetection()behind a build-timefileReplacementsflag, off by default; the three implemented journeys (J1-J3; J4 is still planned) and the Electron E2E suite run with it on (see Zoneless flag).- Flag on by default,
zone.jsout ofpolyfills, new tick baselines (renderer.cdTicksIdle30sand any counter that becomes deterministic once the zone.js race is gone).
Eager components
65 production files, 66 components (epg-progress-panel.component.ts holds
two); two have since been deleted (the old Sources row and its health dot). Tick an entry by deleting changeDetection: ChangeDetectionStrategy.Eager
(or setting OnPush) once its template state is signals, signal inputs or
explicitly marked. The guard spec compares the unticked entries with the
files whose component metadata still sets
changeDetection: ChangeDetectionStrategy.Eager (comments do not count).
The settings sections read form values in their templates and the parent
patches the form outside their events (Discard, backup import, the EPG file
picker), so each marks itself on the form's events through
markSectionForCheckOnFormEvents (apps/web/src/app/settings).
apps/web (15)
apps/web/src/app/app.component.ts(idle audit root)apps/web/src/app/app-update-notification-panel.component.ts(idle audit root)apps/web/src/app/settings/app-update-release-notes-dialog.component.tsapps/web/src/app/settings/settings.component.tsapps/web/src/app/settings/settings-about-section.component.tsapps/web/src/app/settings/settings-backup-section.component.tsapps/web/src/app/settings/settings-dashboard-section.component.tsapps/web/src/app/settings/settings-delete-all-playlists-dialog.component.tsapps/web/src/app/settings/settings-epg-section.component.tsapps/web/src/app/settings/settings-general-section.component.tsapps/web/src/app/settings/settings-playback-section.component.tsapps/web/src/app/settings/settings-remote-control-section.component.tsapps/web/src/app/settings/settings-tmdb-section.component.tsapps/web/src/app/settings/settings-unsaved-changes-dialog.component.ts
libs/ui (20 files, 21 components)
libs/ui/components/src/lib/confirm-dialog/confirm-dialog.component.tslibs/ui/components/src/lib/content-hero/content-hero.component.tslibs/ui/components/src/lib/expandable-text/expandable-text.component.tslibs/ui/components/src/lib/portal-detail-shell/content-about.component.tslibs/ui/components/src/lib/portal-detail-shell/portal-detail-shell.component.tslibs/ui/components/src/lib/progress-capsule/progress-capsule.component.tslibs/ui/components/src/lib/season-container/episode-info-dialog.component.tslibs/ui/components/src/lib/watched-badge/watched-badge.component.tslibs/ui/epg/src/lib/epg-item-description/epg-item-description.component.tslibs/ui/epg/src/lib/epg-progress-panel/epg-progress-panel.component.ts(idle audit root; alsoEpgTrustConfirmDialogComponent)libs/ui/epg/src/lib/epg-source-status/epg-source-status.component.tslibs/ui/remote-control/src/lib/remote-control/remote-control.component.ts(apps/remote-control-webonly)libs/ui/playback/src/lib/art-player/art-player.component.tslibs/ui/playback/src/lib/audio-player/audio-player.component.tslibs/ui/playback/src/lib/external-player-info-dialog/external-player-info-dialog.component.tslibs/ui/playback/src/lib/html-video-player/html-video-player.component.tslibs/ui/playback/src/lib/video-player/sidebar/sidebar.component.tslibs/ui/playback/src/lib/vjs-player/vjs-player.component.tslibs/ui/playback/src/lib/vod-details/vod-details.component.tslibs/ui/playback/src/lib/web-player-view/web-player-view.component.ts
libs/ui/playback (8) goes with the playback PR, not the libs/ui one.
apps/remote-control-web (1)
apps/remote-control-web/src/app/app.ts(separate app; converts withremote-control.component.ts)
libs/workspace (7)
libs/workspace/shell/feature/src/lib/workspace-command-palette/workspace-command-palette.component.tslibs/workspace/shell/feature/src/lib/workspace-context-panel/workspace-collection-context-panel.component.tslibs/workspace/shell/feature/src/lib/workspace-context-panel/workspace-context-panel.component.tslibs/workspace/shell/feature/src/lib/workspace-context-panel/workspace-settings-context-panel.component.tslibs/workspace/shell/feature/src/lib/workspace-keyboard-shortcuts/workspace-keyboard-shortcuts-dialog.component.tslibs/workspace/shell/feature/src/lib/workspace-shell/workspace-shell.component.ts(idle audit root)libs/workspace/shell/feature/src/lib/workspace-sources/workspace-sources.component.ts
libs/playlist (12)
libs/playlist/import/feature/src/lib/add-playlist-dialog/add-playlist-dialog.component.tslibs/playlist/import/feature/src/lib/auto-import/auto-import.component.tslibs/playlist/import/feature/src/lib/file-upload/file-upload.component.tslibs/playlist/import/feature/src/lib/stalker-portal-import/stalker-portal-import.component.tslibs/playlist/import/feature/src/lib/text-import/text-import.component.tslibs/playlist/import/feature/src/lib/url-upload/url-upload.component.tslibs/playlist/import/feature/src/lib/xtream-code-import/xtream-code-import.component.tslibs/playlist/m3u/feature-player/src/lib/m3u-vod-detail/m3u-vod-detail.component.tslibs/playlist/m3u/feature-player/src/lib/video-player/video-player.component.tslibs/playlist/shared/ui/src/lib/recent-playlists/empty-state/empty-state.component.tslibs/playlist/shared/ui/src/lib/recent-playlists/playlist-info/playlist-info.component.tslibs/playlist/shared/ui/src/lib/source-health/source-cleanup-dialog.component.ts
libs/playlist/m3u/feature-player (2) goes with the playback PR.
libs/portal (8)
libs/portal/shared/ui/src/lib/components/playlist-error-view/playlist-error-view.component.tslibs/portal/shared/ui/src/lib/navigation/portal-rail-links.component.tslibs/portal/stalker/feature/src/lib/stalker-catalog-detail/stalker-catalog-detail.component.tslibs/portal/stalker/feature/src/lib/stalker-favorites-button/stalker-favorites-button.component.tslibs/portal/stalker/feature/src/lib/stalker-series-view/stalker-series-view.component.tslibs/portal/xtream/feature/src/lib/global-search-results/global-search-results.component.tslibs/portal/xtream/feature/src/lib/serial-details/serial-details.component.ts
Test-only files that set Eager are not listed; they do not ship. The guard
skips every *.spec.ts / *.test.ts file with or without a suffix of one
or more segments (*.spec-stubs.ts, *.test-helpers.ts,
*.test-data-stubs.ts, …),
test-setup.ts and test-stubs/ directories.
Zone-dependent sites
Plain (non-signal) fields read by a template and written from a callback
that is not an Angular template event. Under zone.js the next tick happens to
refresh an Eager view; under zoneless nothing schedules one. Each fix makes
the field a signal (or a computed), or writes it through one.
| Done | Site | What depends on the zone | Owning PR |
|---|---|---|---|
| [x] | libs/playlist/m3u/feature-player/src/lib/video-player/video-player.component.ts onChannelNumberInput/clearChannelNumberInput |
2 s window.setTimeout hides the channel-number overlay through plain showChannelNumberOverlay/channelNumberInput |
playback |
| [x] | same file, applySettings and the settings effect() |
IndexedDB storage.get(...).subscribe and an effect assign plain playerSettings, which picks the player in the template |
playback |
| [x] | libs/portal/shared/data-access/src/lib/source-status.service.ts checkPortal (replaced the old Sources row's checkPortalStatus) |
the PWA Xtream portal status lands after await; it is written to a signal |
playlist |
| [x] | libs/playlist/shared/ui/src/lib/recent-playlists/playlist-info/playlist-info.component.ts (EPG clear and EPG file pick handlers) |
plain playlist reassigned after await |
playlist |
| [x] | libs/playlist/import/feature/src/lib/stalker-portal-import/stalker-portal-import.component.ts (device-id derivation) |
form.patchValue after await; no fix needed: while derivation is on hasManualDeviceIds is false whatever the IDs are, the controls write their own DOM values, and typing goes through value-accessor listeners that mark the view |
playlist |
| [x] | libs/portal/stalker/feature/src/lib/stalker-live-stream-layout/stalker-live-stream-layout.component.ts (favorites load) |
favorites Map filled in a subscribe without markForCheck; the component is OnPush already, so this is a latent bug today |
portal |
| [x] | libs/portal/xtream/feature/src/lib/portal-channels-list/portal-channels-list.component.ts (favorites load) |
same pattern; the neighbouring favoriteMarks.changes$ handler does call markForCheck |
portal |
| [x] | same file, programme dialog afterClosed |
deletes from epgPrograms/currentProgramsProgress after await without marking |
portal |
| [x] | apps/web/src/app/settings/settings-backup.facade.ts (backup import) |
change listener on a detached file input → hydrateFromStore(); section templates read form().value.theme/coverSize; each section now marks itself on its form's events (markSectionForCheckOnFormEvents), which settings.component.form.spec.ts guards without a forced render |
apps/web |
| [x] | libs/ui/epg/src/lib/epg-guide/epg-guide.component.ts (jump to now, keyboard focus) |
afterNextRender registered from CDK/RxJS callbacks; zone.js followed them with a tick, zoneless schedules no render, so the guide opened at midnight. It now marks itself when it registers the hook. Found by epg-guide.e2e.ts on the zoneless build |
flag |
| [ ] | libs/ui/remote-control/src/lib/remote-control/remote-control.component.ts |
plain isLoading/error/status written after await and from a 2 s setInterval |
only if apps/remote-control-web goes zoneless |
Explicit zone and change-detector calls
They keep working under zoneless (NgZone becomes NoopNgZone, so run
and runOutsideAngular just call through). Remove them in the flip PR, not
before: with zone.js on they still matter.
apps/web/src/app/settings/settings-unload-guard.service.ts: twozone.runcalls around the window-close dialog (IPConWindowCloseRequestedandbeforeunload).libs/ui/playback/src/lib/embedded-mpv-player/embedded-mpv-session-controller.ts:runOutsideAngular(() => setInterval(...))for the position poll;embedded-mpv-session-controller.position.spec.tsasserts the call and changes with it.libs/workspace/dashboard/data-access/src/lib/dashboard-data.service.ts: 18ngZone.run(() => signal.set(...))calls, all redundant around signal writes.libs/workspace/dashboard/data-access/src/lib/dashboard-source-expiry.service.ts: onengZone.runaround a signal update.ChangeDetectorRefinstalker-live-stream-layout.component.ts(4 ×markForCheck, 1 ×detectChangesbefore measuring a row) andportal-channels-list.component.ts(3 ×markForCheck, 2 ×detectChanges): correct under zoneless; replace the Maps with signals in the portal PR if it stays small.
Checked and signal-safe
No change needed; recorded so the flag PR knows where to look if a journey regresses. Embedded MPV and external players are the riskiest paths because their events arrive over IPC.
- IPC listeners (17 registrations): app update status, external player sessions, window close and window state, player errors, playlist open requests, embedded MPV sessions, playback history gate, downloads, recordings, playlist refresh, DB operation and save progress, EPG progress, playback position updates, channel change and remote-control commands. All write signals, signal stores or NgRx, or have no UI state.
- Player libraries (video.js, mpegts.js, hls.js, artplayer, shaka, native
<video>): callbacks bump signals in the control adapters or emit outputs whose parent handlers write signals. - Observers (13 Intersection/Resize/Mutation observers) and document
and window listeners (~40): signals or DOM only.
@HostListenerbindings are Angular listeners and mark their view. - Timers (~130
setTimeout/setInterval/rAF/queueMicrotask): all write signals, touch the DOM or focus, or have no UI state, apart from the two in the table above. - Dialogs and snackbars (20
afterClosed/onActionsites): signals, stores, outputs or navigation, apart from the one in the table above. - No production code uses
NgZone.onStable,onMicrotaskEmpty,isStable,ApplicationRef.tick(),Zone.currentorngDoCheck.
Build, tests and runtime details
provideServiceWorker(..., { registrationStrategy: 'registerWhenStable:30000' }): under zoneless "stable" means no pending tasks. The 30 s bound still registers the worker; check the PWA build in the flag PR.change-detection-tick-counter.tswrapsApplicationRef._tick, which the zoneless scheduler also calls, so the counters stay comparable.- Specs that need zone.js:
fakeAsyncinplaylist-switcher.component.spec.tsandstalker-live-navigation.spec.ts,waitForAsyncin 13 files. They keepzone.js/testinguntil rewritten; removing zone.js from the build polyfills does not affect them. - Unreferenced leftovers to delete in the flip PR:
apps/web/src/polyfills.ts,apps/web/src/polyfills-test.ts,apps/web/src/setup-jest.ts(no project, tsconfig or Jest config uses them).
Zoneless flag
app.config.ts takes its change-detection providers from
apps/web/src/environments/change-detection.providers.ts
(provideZoneChangeDetection({ eventCoalescing: true })). The
electron-performance-zoneless and electron-e2e-zoneless web
configurations are their base configuration plus one fileReplacements
swap to change-detection.providers.zoneless.ts
(provideZonelessChangeDetection()); a test in
performance-build-config.spec.ts pins that and refuses the swap in any
other configuration. zone.js stays in the polyfills, so these builds log
NG0914 in dev mode and nothing schedules through the zone. The Electron app
loads the renderer from dist/apps/web, so rebuilding only the web app
switches an existing Electron build:
pnpm nx run electron-backend:build-performance # or build-e2e
pnpm nx run web:build:electron-performance-zoneless # or electron-e2e-zoneless
cd apps/electron-backend-e2e
../../node_modules/.bin/playwright test --config=playwright.journeys.config.ts
../../node_modules/.bin/playwright test --grep-invert packaged
Do not run pnpm run perf:journeys or pnpm nx run electron-backend-e2e:e2e
afterwards: their build dependencies restore the zone.js renderer.
First measurement (macOS, 2026-10-04, the six OnPush PRs merged locally on the flag branch; the same integration build measured with the flag off and on, five iterations each):
| Counter | flag off | flag on |
|---|---|---|
renderer.cdTicksToFirstCard |
22, 20, 22, 21, 21 | 7, 7, 7, 7, 7 |
renderer.cdTicksIdle30s |
4, 4, 4, 4, 4 | 3, 3, 3, 3, 3 |
renderer.cdTicksToFirstPage |
22 (all) | 8 (all) |
renderer.cdTicksToPlaying |
16, 15, 15, 17, 15 | 6, 8, 10, 10, 7 |
| DOM mutations J1 / J2 / J3 | 553 / 1,603 / 6,182 | 553 / 1,603 / 6,182 (one J3 iteration 6,199, as on master) |
spawnToFirstCardMs p50 |
3,071 | 828 |
clickToFirstPageMs p50 |
82.8 | 80.4 |
clickToLoadedMetadataMs / clickToPlayingMs p50 |
94.8 / 268.7 | 158.3 / 409.3 |
J1 and J2 tick counts become deterministic without the zone.js one-tick
race, and the DOM mutations are unchanged, so nothing renders differently.
J3's tick count still varies with player events and its wall-clock
numbers rose locally; the machine was shared with other runs (load 26 to 58
during these two runs, master itself read 363.8 ms clickToPlayingMs p50
earlier the same day), so judge J3 on the CI runner before the flip.
Electron E2E suite on electron-e2e-zoneless (all specs except the
packaged frame-copy ones): 203 passed, 7 skipped, 3 failed. epg-guide
failed on every run and is fixed above; playlist-auto-refresh passed on
--repeat-each=2; dash-clearkey "reopens from recent and favorites" is the
known local flake (it fails as often on master). The IPC-driven paths
passed zoneless: external-player launch states and the MPV/VLC DASH
fallbacks in dash-clearkey, the MPV double-click gate in settings,
remote-control, picture-in-picture and stream-info. Their state reaches
the renderer over IPC into signals and never ran in the zone. Embedded MPV
playback itself is covered only by the packaged frame-copy E2E, which these
runs left out; run it on a packaged zoneless build before the flip.
Measuring a PR
Build electron-performance and run the journeys as described in
performance journeys, then paste
renderer.cdTicksToFirstCard, renderer.cdTicksIdle30s,
renderer.cdTicksToFirstPage and renderer.cdTicksToPlaying before and
after. While zone.js is on, removing Eager does not change the number of
ticks, only the work per tick; expect the counters to stay put until the flag
PR and the template work (DOM mutations, profile time) to drop.