Commit Graph
100 Commits
Author SHA1 Message Date
peter d91f27a22e fix(plex): NULL-safe orphan-people prune (review)
Guard the prune's NOT IN against the classic NULL trap: a JSON-null cast array
element would surface as SQL NULL in the referenced set, making name NOT IN
(…, NULL) evaluate NULL for every row → silently prune nothing. Filter NULLs out
of the subquery. (Plex cast-explore S4 review)
2026-07-19 03:53:03 +02:00
peter 33c60965d9 feat(plex): prune orphaned people after each sync (S4)
The plex_people headshot cache can outlive its subjects — when a title leaves the
Plex library, cast/crew who appear in nothing else are orphaned. prune_orphan_people
deletes rows whose name no longer appears in ANY movie/show cast_names/directors,
run at the end of every plex_sync (best-effort; a jsonb_typeof='array' guard skips
scalar/null JSONB values). The filterable cast_names self-clean with their row;
this cleans the only per-person cache. Verified: an injected orphan is dropped, real
people kept. (Plex cast-explore S4)
2026-07-19 03:50:00 +02:00
peter 05105197e9 feat(plex): person cards in the grid for the filtered actors (S3)
The actors currently in the filter now render as cards above the poster grid —
headshot + name + in-scope title count + a remove x — so you SEE who you're
exploring, not just chips in the rail (generalises the old search-only person
cards to the applied filter). New GET /plex/people/cards (photo from the
plex_people cache, count live against cast_names); PlexBrowse fetches + renders
them; i18n en/hu. Verified: John Goodman (11) / Douglas M. Griffin (1) / Bradley
Cooper (14) with photos + counts. (Plex cast-explore S3)
2026-07-19 03:46:31 +02:00
peter 6f28ce36a7 feat(plex): actor filter AND/OR toggle (default OR) (S2)
Multiple selected actors now combine as OR (any) by default — click several cast
and see films featuring ANY of them — instead of the old hardcoded AND that
emptied the grid. An AND (all) toggle in the ACTIVE filter section (shown for 2+
actors, mirroring the genre match toggle) narrows to films with ALL of them.
Backend actor_mode param mirrors genre_mode. Verified: OR John Goodman|Douglas
M. Griffin = 11 films; AND = 1 (10 Cloverfield Lane). (Plex cast-explore S2)
2026-07-19 03:37:57 +02:00
peter 0030f32a5d feat(plex): lazy-enrich the full cast on info-page view (S1a)
The cheap section listing that drives the main sync only stores the top ~3 cast,
so any cast member below that was unfilterable (clicking them AND-emptied the
grid). Now the movie/show info fetch (/item, /show) — which already pulls the full
rich cast — persists it onto cast_names + people_text (so every displayed cast
member becomes filterable) and caches each headshot in the new plex_people table
(migration 0056). Idempotent (only grows a thinner stored set); best-effort (never
500s a read). Verified: 10 Cloverfield Lane 3->8 cast after viewing; plex_people
populated with photos. (Plex cast-explore S1a)
2026-07-19 03:31:34 +02:00
peter d462834ed7 Merge Platform S6b.3: module registry drives the render (epic DoD)
Closes the Platform epic DoD. Three cross-cutting App states move into scoped
providers (WizardProvider, FeedViewProvider, PrefsProvider) and the module
registry (components/moduleRegistry) drives the render: App looks up
PAGE_CONTENT[page]/PAGE_RAIL[page] gated by moduleDef(page).gate — the page
ternary and the three side-rail page conditionals are gone. Content modules and
rails are prop-free (read me via useMe(), module state from providers).
App.tsx 796->431 lines, zero page===X chrome conditionals. E2E 17/17;
/code-review clean; UAT passed.
2026-07-19 02:45:26 +02:00
peter a42e0a9e3e feat(app): the module registry drives the render (S6b DoD)
Replace App's page-render ternary and the three side-rail page conditionals with
a data-driven lookup: components/moduleRegistry maps each page to a prop-free
content component (+ optional side rail + shell fadeTop), and App renders
PAGE_CONTENT[page]/PAGE_RAIL[page] gated by moduleDef(page).gate (an unreachable
gated page falls back to the feed, as the old ternary did). Content modules and
the two rails are now prop-free: they read `me` via the new useMe() hook and
their module-local state from the scoped providers; FeedPage/MessagesPage are the
only wrappers (they wire the global feed scope / meId). App.tsx 796->431 lines,
zero `page===X` chrome conditionals — closes the Platform epic DoD. (Platform S6b.3)
2026-07-19 01:25:32 +02:00
peter fd1742e783 refactor(prefs): move Settings auto-save machinery into PrefsProvider
Lift the four editable Settings prefs (theme/perf/hints/notifications), their
live-apply effects, the debounced auto-save + baseline echo-guard, and the
server-adopt-on-login into PrefsProvider, exposing the PrefsController via
usePrefs(). SettingsPanel and GlassTuner read it from the hook instead of props;
App's big adopt effect keeps only the shell prefs (panel layouts, rail collapse,
language). App.tsx 655->489 lines. E2E 17/17 incl. settings auto-save. (Platform S6b.3)
2026-07-19 01:09:20 +02:00
peter 36e4419c98 refactor(feed-view): move the feed view mode into FeedViewProvider
Lift the feed's view-mode state (server-synced: persists on pick, adopted from
prefs on login) out of App into FeedViewProvider. App reads it via useFeedView()
to hand to Feed/ChannelPage; the view adopt lines leave App's big prefs-adopt
effect. Removes another App-owned cross-cutting state ahead of the render flip.
(Platform S6b.3)
2026-07-19 01:00:05 +02:00
peter dd921e3209 refactor(wizard): move onboarding wizard state into WizardProvider
Lift the onboarding wizard's open state, first-login auto-open effect, and the
wizard render itself out of App into WizardProvider. Feed, Channels, and
SettingsPanel trigger it via useWizard() instead of an onOpenWizard prop; App
and ChannelPage drop the prop plumbing. First step of S6b.3 — removing the
per-module props that block a uniform registry render. (Platform S6b.3)
2026-07-19 00:55:34 +02:00
peter 8434aac78d Merge Platform S6b.1+S6b.2: module registry + scoped state providers
S6b.1: lib/modules.ts is an ordered ModuleDef registry (single source for nav
label/icon/order/gate), absorbing NavSidebar's ICON map.
S6b.2: module-local state moved out of App into PlaylistsProvider / PlexProvider /
ChannelsProvider (split-context, mirroring FeedFiltersProvider). Header, rails,
PlexBrowse, Channels, NotificationsPanel, Sidebar read from providers; modules take
a uniform `me` prop. App.tsx 796->655 lines. Render still on the ternary (S6b.3
flips it). E2E 17/17; /code-review clean; UAT passed.
2026-07-19 00:46:07 +02:00
peter d33a838462 docs(modules): note the registry is the checklist for new pages
Review follow-up: the ordered MODULES array can't double as a compiler-
enforced exhaustive Page map, so document that adding a Page means adding it
here (an unregistered Page returns undefined from moduleDef/moduleLabelKey and
throws in NavSidebar). No behavior change. (Platform S6b.2)
2026-07-19 00:16:17 +02:00
peter a303f307cd refactor(channels): scope module state in ChannelsProvider
Lift the Channels manager's shared local state (name filter, status chip,
active tab, column-reset token, focus-a-channel intent) out of App into a
split-context ChannelsProvider, nested inside NavigationProvider so its
focusChannel/goToFullHistory actions can drive navigation. The Channels page,
the header search box + sync chip, the feed filter sidebar, and the
notifications inbox all read it via useChannels()/useChannelsActions() instead
of props drilled through App. Channels also internalises onViewChannel /
onFilterByTag / onFocusChannel (nav + feed-filters straight from providers) and
takes only { me, onOpenWizard } now. App loses five useStates, the focusChannel
helper, the focus-clear effect, and a large block of per-page prop plumbing.
(Platform S6b.2)
2026-07-19 00:08:34 +02:00
peter 6c32e5c8d6 refactor(plex): scope module state in PlexProvider
Lift the Plex module's shared local state (scope / watch-state / sort / expanded
filters / search term / open-playlist hand-off) out of App into a split-context
PlexProvider with stable useCallback setters. PlexSidebar, PlexBrowse, and the
header search box read it via usePlex()/usePlexActions() instead of props drilled
through App; PlexBrowse is now prop-free. App loses six useStates + the filters
JSON memo/serialise helpers. (Platform S6b.2)
2026-07-18 23:53:10 +02:00
peter d0fc061795 refactor(playlists): scope module state in PlaylistsProvider
Lift the Playlists module's shared local state (rail name filter + selected
playlist) out of App into a split-context PlaylistsProvider, mirroring
FeedFiltersProvider. Header, PlaylistsRail, and the Playlists detail pane read
it via usePlaylists()/usePlaylistsActions() instead of props drilled through
App; the modules take only a uniform `me` prop now. App loses two useStates and
the selected-playlist persistence helper. (Platform S6b.2)
2026-07-18 23:43:19 +02:00
peter f4a68575c5 refactor(modules): consolidate nav into a module registry
Extend lib/modules.ts into an ordered ModuleDef registry (id/label/icon/
system/badge/gate) as the single source for the nav rail and the header
stepper. Absorb NavSidebar's per-page ICON map; derive moduleOrder /
moduleLabelKey / SYSTEM_PAGES from the one array. Render still on the App
ternary — this is the scaffold S6b.3 will drive from. (Platform S6b.1)
2026-07-18 23:25:39 +02:00
peter 1d84828cd0 Merge Platform S6a: z-index token scale + overlay-root convention
Name the stacking layers as a tailwind zIndex token scale (a value-preserving
rename of ~48 magic z-values) and add an Overlay helper (portals to <body>) that
the in-tree full-screen holdouts (ChatDock, OnboardingWizard, GlassTuner) now use
to escape ancestor stacking contexts.
2026-07-18 19:29:01 +02:00
peter 6075e96bd0 refactor(overlay): single overlay-root convention via Overlay helper
Add components/Overlay.tsx (portals to <body>) and route the in-tree full-screen/
floating holdouts through it — ChatDock, OnboardingWizard, GlassTuner — so they
escape any ancestor stacking context (mask/transform/backdrop-filter) instead of
relying on a bare high z-index. Toaster stays in-tree (it's content-column-scoped
by design, outside the masked scroller); Welcome is a page, not an overlay.
2026-07-18 19:11:38 +02:00
peter c91caffa5e refactor(z-index): name the stacking layers as a token scale
Replace ~48 magic z-index values (z-10..z-[9999] + 2 inline zIndex) with named
tailwind zIndex tokens (base/menu/chrome/paneltab/panel/rail/overlay/popover/
tooltip/tuner). Values are UNCHANGED — a rename, not a renumber — so layering is
identical; the names give one source of truth for the stack.
2026-07-18 19:11:25 +02:00
peter 7039abc4d3 Merge Platform S5: scope feed filters + inherit channel content prefs
FeedFiltersProvider lifts the global feed-filter god-state out of App (mirrors
NavigationProvider) so Sidebar/Header/NotificationsPanel read it via hooks; <Feed>
stays prop-driven for the channel-scoped case. Opening a channel now inherits the
feed's content-type prefs instead of forcing Live/Upcoming on (bug 2). Two E2E
locks: content-filter inherit (both ways) + no-leak.
2026-07-18 18:44:44 +02:00
peter a3ce37cdc2 docs(filters): correct the split-context comment
The prior wording claimed NotificationsPanel subscribes to actions only, but it
reads filters (spreads them into setFilters). No consumer is actions-only today;
describe the split's intent without the wrong example.
2026-07-18 18:30:18 +02:00
peter 7d7e2c6146 test(e2e): lock the channel content-filter inherit + no-leak (bug 2)
Add feed-content-<key> testids to the toolbar's content pills and two channel
specs: the channel view inherits the feed's Live/Upcoming both ways, and a
content toggle made in the channel view does not leak back into the feed.
2026-07-18 18:27:17 +02:00
peter ae7d893a3e fix(channel): inherit content-type filters instead of forcing Live/Upcoming
Opening a channel hardcoded includeLive:true (+ normal on / shorts off), so a
channel view silently showed live/upcoming even when the feed had them off. Seed
the content triad from the global feed once at mount; the channel toolbar can
still toggle them locally.
2026-07-18 18:27:17 +02:00
peter da143fd70d feat(filters): scope global feed filters in FeedFiltersProvider
Lift the feed's filter god-state (per-account persistence, the account-load
effect, share-link capture) out of App into a split-context provider mirroring
NavigationProvider. Sidebar/Header/NotificationsPanel read it via hooks instead
of prop-drilling; <Feed> keeps its filters prop since ChannelPage renders it with
its own channel-scoped state.
2026-07-18 18:27:04 +02:00
peter 54a4b1b8aa Merge Platform S4 + S4b: PageShell contract + fixed-chrome sweep
S4: PageShell/PageToolbar contract, one page scroller, scroll restore on
Back + reset on new filter (bugs 1,3), pinned feed toolbar (bug 4), and
the fix for the ref-churn 'max update depth' loop.

S4b: the fixed-header / scrollable-content pattern applied across nine
modules (feed, channel detail, channel manager + discovery, playlist,
plex, notifications, downloads, admin users/config), plus the sticky
DataTable header with the header+fade 3D-depth edge the user liked.

E2E 17 specs green (incl. bug 1/3/4 locks); tsc + knip clean. Not shipped.
2026-07-18 06:40:36 +02:00
peter a2e371a558 feat(admin): fix the tab bar on Users + Configuration pages
Apply the fixed-chrome pattern to the two admin pages with a horizontal
tab bar: the tabs (and Config's intro) pin in the shell's fixed band while
the tab content scrolls under them. Config's floating save bar is
unaffected. Suite 15/15, tsc + knip clean.
2026-07-18 06:21:49 +02:00
peter 685c7b4c0b feat(shell): fix headers on Notifications, Downloads, Discovery
Apply the fixed-chrome pattern to three more list modules:
- Notifications: the inbox header (title + mark-all / clear-all) pins in
  the band; only the notification list scrolls.
- Downloads: the title + subtitle + tabs pin; the tab content scrolls.
- Channel discovery: the intro + table controls pin (controlsInBand), the
  table rows scroll under the sticky header (fills out the manager's
  Discover tab to match Subscriptions).

Verified: headers land in the fixed band, content in the scroller. Suite
15/15, tsc + knip clean.
2026-07-18 06:16:16 +02:00
peter ed3990a9af feat(plex): fix the title-count row, scroll only the poster grid
Lift Plex browse's title-count line into the shell's fixed band via
PageToolbar, so the count stays visible while only the poster grid scrolls
(the filters already live in the left rail). Verified with a 3.5k-title
library: the count holds at a fixed offset while the grid scrolls. Suite
15/15, tsc + knip clean.
2026-07-18 06:07:29 +02:00
peter 0c3ca72545 feat(playlists): fix the playlist header, scroll only the list
Lift the playlist detail header — cover/title/actions (Play all, sync,
delete) and the sort/group controls row — into the shell's fixed band via
PageToolbar, so only the video list scrolls under it. Matches the
feed/channel/manager pattern. Verified with a 40-item playlist: the header
holds at a fixed offset while the list scrolls. Suite 15/15, tsc + knip.
2026-07-18 06:03:32 +02:00
peter e9135a0183 polish(datatable): fade rows under the sticky header, not the header itself
The rows now dissolve as they slide up under the sticky header (matching
the bottom fade), while the header stays crisp. A short gradient painted
by the header's ::after sits just below it and fades the rows — this
replaces the scroller's top mask-fade, which is off on these pages so it
can't touch the header. Barely visible at rest (it covers the first row's
top padding), clear once scrolling. Suite 15/15, tsc + knip clean.
2026-07-18 05:51:11 +02:00
peter af915883f9 fix(datatable): the sticky header no longer shifts or fades on first scroll
The sticky <thead> jumped up ~8px and picked up the scroller's top fade
the moment you scrolled 1px — so it read as 'not fixed'. Two causes:
- the table sat under a pt-2 gap, so its natural position was 8px below
  the sticky top:0 it snapped to. Drop the top padding (the fixed band's
  controls row already gives the visual gap) → no shift.
- the page scroller's top edge fade turned on with the first scroll and
  masked the header's top. Add a fadeTop flag (PageShell → PageScroller →
  useScrollFade), off for the Channels + Audit pages whose scroll region
  starts with a sticky header. Feed/channel keep the top fade (it fades
  cards under the fixed toolbar, as intended).

Verified: header stays at a fixed offset with no fade change from scroll 0
through scrolled, on both the manager and the audit log. Suite 15/15.
2026-07-18 05:43:19 +02:00
peter 867daa0dcf feat(channels): pager into the chip row, Blocked as its own tab
Address manager UAT:
- The DataTable controls row (status chips + pager) now portals into the
  fixed band via a new controlsInBand prop, so it stays put above the
  sticky header instead of scrolling away — and the pager fills the empty
  space next to the status chips, on one row.
- The tab bar is always fixed chrome now (not just on Subscriptions), so
  it doesn't jump when switching tabs; on Subscriptions the stats/intro/
  tags ride with it.
- Blocked channels moves off the bottom of the Subscriptions list into its
  own 'Blocked' tab (with an empty state), alongside Subscriptions and
  Discover.

Verified with a 90-channel test account: everything above the rows stays
fixed while the rows scroll under the sticky header. Suite 15/15, tsc +
knip clean.
2026-07-18 05:34:07 +02:00
peter dcadbe346d feat(channels): fix the manager header, scroll only the table rows
Lift the whole subscribed-view header — tabs, sync stats + actions, the
intro, the tag chips and the sync-status chips — into the shell's fixed
band via PageToolbar. Combined with the sticky table header row, only the
channel rows scroll now; everything above them stays put.

The status chips move out of DataTable's controlsLeading into the fixed
chrome (they belong above the header, not in the scrolling controls row).

Note: the DataTable pager (rows-per-page / pagination) stays in the
scroller for now — it rarely shows on the manager (few channels = one
page). The discovery sub-view's chrome is still inline (separate
component, handled in the sweep). Suite 15/15, tsc + knip clean.
2026-07-18 05:15:01 +02:00
peter 7df9bc0035 feat(datatable): sticky table header row
Make the DataTable's <thead> sticky so the column headers stay put at the
top of the page scroller while the rows scroll under them — the core of
'the table header should be fixed, only the rows scroll'. Benefits every
DataTable page (Channels manager, discovery, Audit log).

Each header cell gets bg-bg so rows don't show through; the header's
bottom border rides an inset box-shadow because a sticky <tr>'s own
border can scroll away with the collapsed table box. Verified on the
Audit log: 500 rows scroll under a header stuck at the scroller top; the
scroller's top fade is unobtrusive behind the solid header. Suite 15/15.
2026-07-18 05:11:10 +02:00
peter 02bd0d433b polish(channel): tighten toolbar-to-grid gap + restore top scroll fade
Two UAT nits on the channel page:
- the chip-row-to-cards gap was ~36px (toolbar pb-3 + wrapper pb-2 + grid
  pt-3 stacking); drop the wrapper/grid pads so the toolbar's own pb-3 is
  the only gap (~15px).
- restore the page scroller's TOP edge fade. It was dropped when the chrome
  was a sticky sub-header (the fade bit into it); now the chrome is a fixed
  band ABOVE the scroller, so the top fade correctly hints at cards
  scrolling up under the toolbar. Reverts the useScrollFade edges option.

Suite 15/15, tsc + knip clean.
2026-07-18 05:01:31 +02:00
peter ec807c8b31 feat(shell): channel chrome is fully fixed, only the grid scrolls
Reworks the channel detail per UAT: instead of the banner scrolling away
and a sticky sub-header (which felt odd to scroll and needed an opaque bar
that clashed with the design even at rest), the ENTIRE chrome — banner,
identity, tabs, toolbar — is fixed and only the video grid scrolls.

Mechanism: ChannelPage wraps its whole chrome in <PageToolbar> so it
portals into the shell's fixed band (like the feed toolbar); the
channelScoped Feed portals its toolbar into a slot at the bottom of that
chrome. No sticky, no opaque bar — the chrome is transparent over the page
bg because nothing scrolls under it (the band sits above the scroller).

E2E updated: the channel chrome (title + toolbar) stays at a fixed
viewport position while the grid scrolls. Suite 15/15, tsc clean.
2026-07-18 04:53:49 +02:00
peter 0e03e561eb feat(shell): sticky tabs+toolbar on the channel page
Generalise the fixed-chrome pattern to the channel detail page: the
banner + identity now scroll away, while the tab row and the channel
feed's toolbar stick to the top as a sticky sub-header — only the video
grid scrolls.

Mechanism: PageToolbarSlot (the toolbar portal target) is now an exported,
overridable context. ChannelPage provides its own sticky sub-header node
as the target, so the channelScoped Feed portals its toolbar up next to
the tabs instead of into the shell's top band. Feed always portals its
toolbar now (the slot decides where it lands).

Also: the page scroller now fades only its BOTTOM edge — the top is
bounded by the fixed/sticky chrome, so a top fade only bit into it.

E2E: adds a lock that the channel tabs/toolbar stay pinned while the
banner scrolls away; suite 15/15 on :5173, tsc + knip clean.
2026-07-18 04:45:11 +02:00
peter 10f4baab3b fix(shell): scroll restore on Back + reset on new filter (bugs 1, 3)
The shell owns the scroller, so it owns the scroll policy. PageScroller
now takes a scrollKey identifying the logical view and keeps a per-view
offset in a module-level map, recorded live on scroll:
- same key returning (feed -> channel -> Back, filters unchanged) restores
  where you were (bug 1) -- the feed's scroller unmounts, but the saved
  offset survives and is re-applied, retried over a few frames so the
  virtualized list has time to reach its full height;
- a new key (feed filters changed) starts at the top of the fresh result
  set (bug 3). q is normalised out of the feed key so typing doesn't reset.

Recording on scroll rather than at unmount matters: by cleanup time the
scroller's scrollTop is already zeroed, so a cleanup-read saved 0.

Also fixes a Maximum-update-depth loop this introduced: the combined
element/fade ref was an inline callback, so React re-attached it every
commit and re-ran useScrollFade's state setter. Bound it with useCallback.

Adds E2E locks for bugs 1, 3 and 4 (restore on Back, reset on filter,
toolbar stays pinned). Full suite 14/14 green on :5173; tsc + knip clean.
2026-07-18 03:51:40 +02:00
peter a6cbc45334 fix(feed): pin the feed toolbar in the shell's fixed band (bug 4)
The feed's show/content chips, source, count, sort and view switcher —
plus the active-filter chips — lived inside the scroller, so they
scrolled away with the cards; only the SearchBar strip stayed fixed.

Give PageShell a fixed toolbar band (filled by a module via the new
PageToolbar portal) above the scroller. On the feed page the toolbar +
chips portal into it and stay put — and removable — while cards scroll.
The channel-embedded Feed (channelScoped) keeps its inline toolbar,
which rides with the banner/tabs as before.

Verified both entry points at desktop + 1000px (toolbar wraps in-flow,
band grows, still pinned); E2E 11/11; tsc + knip clean.
2026-07-18 03:25:48 +02:00
peter d81f10b1cf refactor(shell): channel page is a PageShell config, not a 2nd scroller
The channel page rendered its own PageScroller as a separate App branch —
the source of the app's two <main>s. Make it a headerless/rail-less
PageShell config (its banner scrolls from the top) so there is exactly
ONE page scroller. Verified: single <main>, banner scrolls, in-page and
browser Back both return to the feed; E2E 11/11.
2026-07-18 03:19:34 +02:00
peter dc6e62e822 refactor(shell): introduce PageShell for the normal-page chrome
Collapse App's hand-assembled normal-page chrome (floating Header +
top-padded wrapper + PageScroller + banners) into a single PageShell
contract with declared fixed vs scrollable regions. No behaviour change;
the channel page still renders its own scroller (dissolved next).

Groundwork for the S4 fixed-chrome/scroll-ownership seam.
2026-07-18 03:15:41 +02:00
peter 91691c150d Merge: E2E account is admin + nav spec covers the admin pages 2026-07-18 02:54:02 +02:00
peter 833aee07d4 test(e2e): make the seeded account admin + cover admin nav pages
The E2E account is now admin (matching the real primary user), so the nav spec
also drives scheduler/config/users/audit — exercising the render ternary's admin
branches, which the upcoming PageShell refactor will restructure.
2026-07-18 02:52:54 +02:00
peter c5a7296306 Merge fix: wrap audit-log details so rows stay inside the card 2026-07-18 02:49:13 +02:00
peter 7e88b0af0c fix(audit): wrap long audit details instead of truncating
A `truncate` (nowrap) cell in the auto-layout DataTable sizes the whole table to
its widest row, so one long summary/change stretched the table past the card and
the row rules bled into the page. break-words keeps every row inside the card.
2026-07-18 02:43:17 +02:00
peter b463e4852a Merge Platform S3: lift navigation+history into NavigationProvider 2026-07-18 02:35:55 +02:00
peter 7819c2e3a0 docs(nav): note the render-time ref is the intentional latest-value pattern 2026-07-18 02:24:19 +02:00
peter a1bdfece6d refactor(nav): read navigation from context, drop the prop-drilling
VideoCard/PlayerModal read openChannel from useNavigationActions (the memo'd
VideoCard subscribes to the STABLE actions context, so a page/channel change
no longer re-renders it); NavSidebar/Header read page/setPage; ChannelPage
reads closeChannel; NotificationsPanel reads setPage. App sheds the matching
props, and Feed/VirtualFeed no longer thread onOpenChannel at all.
2026-07-18 02:19:52 +02:00
peter 41bb1b2ab3 refactor(nav): lift navigation + history into NavigationProvider
Move page/channelView/ytSearch and the history/popstate/title effects out of the
App god component into a new NavigationProvider (split state/actions contexts so
the memo'd VideoCard doesn't re-render on a page/channel switch). App consumes it
via useNavigation/useNavigationActions but still passes the props down for now;
the consumer migration that removes the prop-drilling follows.
2026-07-18 02:06:07 +02:00
peter cabc759a31 Merge Platform S2: Settings auto-save (drop draft + leave-guard) 2026-07-18 01:44:35 +02:00
peter c855924fdc feat(settings): auto-save preferences instead of draft + Save
Every Settings change now persists on its own (debounced ~500ms so a slider drag
is one PUT), with a small transient indicator; the draft/dirty-save UI and the
navigation leave-guard are gone. Also unblocks the navigation extraction — there
is no longer a cross-page "unsaved settings" guard to thread through routing.
2026-07-18 01:44:25 +02:00
peter 49739da925 Merge Platform S1: E2E characterization safety net 2026-07-18 00:36:12 +02:00
peter e7091158fd test(e2e): golden-master Playwright net for the Platform refactor
Locks the five flows the refactor must not break (feed, channel, player,
settings, nav) so later sprints can prove they changed nothing. Adds a thin
data-testid layer and a dedicated seeded non-demo account; the suite runs on
the baked :8080 stack (authoritative) or :5173. No product-behaviour change.
2026-07-18 00:35:57 +02:00
peter bc5f95f807 Merge E3: feed view modes + scroll-affordance sweep
Five view modes behind a reusable ViewSwitcher (cards · cardsSmall · rows ·
rowsCompact · tiles), and a subdued edge-fade on the page scroller and every
capped list. UAT-accepted; not shipped to prod (user's call — the Platform
refactor is next). Version bump + releaseNotes deferred to ship time.
2026-07-17 21:58:43 +02:00
peter 65ab33d632 fix(player): portal the YouTube player modal out of the page scroller
Same regression the S3 edge-fade caused for the Plex player, and the one my
"swept the class" pass missed: PlayerModal is `fixed inset-0 z-50` but rendered
inside the page scroller, so once that scroller got the mask it became a
stacking context and scoped the modal's z-50 inside it — the nav rail (z-40) and
header (z-30) painted over the player, and the fade dimmed its top edge (worst
at browser zoom, where the centered card is smaller against the rail/panel).

Portaled to <body>, where every other full-screen overlay already lives.
Verified: modal is body-parented, full-viewport, and hit-tests on top at the
nav / filter / header / corner points with the main mask active.
2026-07-17 21:43:37 +02:00
peter 9b4ee83ec8 fix(plex): portal the full-screen player out of the page scroller
The player is `fixed left-0 top-0 z-50` but rendered from inside the page
scroller, so it only ever covered the viewport because that scroller happened
not to be a stacking context. Giving it the edge-fade made it one, and the mask
scoped the player's z-50 inside it: the rail, the side panel and the header
painted straight over the player, and its edges faded. Measured both ways, then
fixed where every other full-screen overlay here already sits — <body>.

Same for the Suspense fallback that stands in while the player chunk loads, and
for the floating draft save bar on the Configuration page. Swept the rest: every
other `fixed` element is either App-level or already portaled.
2026-07-17 03:30:55 +02:00
peter 0ed58e3cb1 improvement(scroll): fade every capped list's clipped edges
The sweep's own three (the thread, the Plex collections filter, the tag manager)
plus the seven the spec missed — the playlist picker, the row tag menu, the Plex
playlist/collection dialogs, the player's track menu, the video description and
the table's multi-select filter. Same idiom throughout: a height-capped list that
silently clipped its content now says so, and hides its scrollbar like the rail
and the panels already do.

The table's option list is its own module-level component because it owns a hook:
FilterPopover is redeclared per DataTable render, so React remounts it.
2026-07-17 03:14:48 +02:00
peter a032324513 improvement(scroll): fade the page scroller's clipped edges
The subdued edge-fade the rail and side panels use now hints at more content on
the page scroller too, which the feed, the channel page and Plex all scroll
inside. Both <main>s move into one PageScroller so the invariants they share —
the load-bearing scrollbar gutter, and the bar staying visible because hiding it
would zero that gutter — are stated once.

Two fixes the hook needed first: it set fresh state on every scroll event, which
above a page tree would re-render it per frame; and it watched a single child
captured at mount, so a lazy page swapping out its Suspense fallback left the
observer on a detached node and the fade frozen at its pre-load value (measured
on the Plex page: no bottom fade over a 3119px list).
2026-07-17 03:14:37 +02:00
peter 0b56eb9d53 fix(feed): keep the row's columns growing with the text-size setting
My last commit made ROW_COL the literal source of the widths — and froze
them, because inline pixels can't follow the root font that Settings'
text slider drives (0.9-1.3). Measured at 130%: the channel box stuck at
128px while its text wanted 152 and the meta cell, being a rem grid, grew
to 156 — one row in two unit systems.

The classes come back and ROW_COL documents them, saying plainly that the
two are matched by hand and why they have to be. Chasing a comment's
literal truth cost a property I'd already verified.
2026-07-17 02:21:04 +02:00
peter 99c1bd9916 fix(feed): make the row's widths actually come from one table
The comment claimed the boxes were generated from ROW_COL. They weren't —
still w-32/w-16/w-48 by hand — so a comment promised a link that didn't
exist, which is worse than not claiming it. The boxes take the numbers
directly now (inline, since Tailwind can't read a runtime value), and the
thresholds add up in plain arithmetic rather than an IIFE whose result
depended on key order.
2026-07-17 02:16:16 +02:00
peter ba23c0c996 refactor(feed): derive the row's drop-out thresholds from its column widths
They were two hand-written sets of numbers describing the same boxes —
change a w-32 and the thresholds are silently wrong, the symptom being a
column appearing just before it fits. Now computed from one table (which
reproduces the old values exactly).

Width also stops reaching the four views that ignore it: it changes every
frame of a resize, so passing it everywhere pushed all of them through
VideoCard's memo for nothing.
2026-07-17 02:13:45 +02:00
peter be05c80d82 fix(feed): drop the compact row's columns by the ROW's width, not the viewport
The viewport was the wrong signal: the nav rail and filter panel move the
row's width by ~430px between them, so at a 1280 window with both pinned
every column still qualified while the row had 762px for 766px of them —
the title squeezed back to nothing, the exact bug the breakpoints were
meant to fix. My own comment predicted it and I didn't follow it through.

VirtualFeed already measures the container for colCount, so it now passes
the item's real width down. Measured in the failing config: title -4 ->
359 with the date column standing down.
2026-07-17 02:11:06 +02:00
peter 21cc5de034 refactor(feed): build the prose view count where it's used
It sat above the one-line row's early return but only textBlock consumes
it, so every compact row allocated it and threw it away — the same shape
I'd already fixed for textBlock and meta, crept back. Also merges a
rationale comment I'd written twice.
2026-07-17 02:04:56 +02:00
peter f702526cef refactor(feed): let the caller decide where the mode's name fits
The xl breakpoint was a fact about the FEED's toolbar, hard-coded into
the switcher that E4's managers are meant to reuse — their rows are far
emptier and would have hidden the label for no reason. It's a prop now,
defaulting to icon-only.

The two views spans collapse into one builder, which also fixes a
regression I'd just added: splitting them put the exact-count tooltip on
the number alone, so hovering the word gave nothing.
2026-07-17 02:02:35 +02:00
peter eda6ef4766 improvement(feed): give the compact row's title the room back
Three from UAT: the row's cap goes 1280 -> 1472 (+15%), since with the
rail and filters hidden there was a lot of page left over and the fixed
columns mean the extra width can only go to the title; the views column
drops the word and keeps it in the tooltip (a table doesn't repeat its
unit every line), taking that column 144 -> 64; and the view switcher
names the current mode where the toolbar has room, falling back to the
icon alone below xl. Title: 431 -> 511 at 1440, 706 at 1900.
2026-07-17 01:58:14 +02:00
peter ed08aa87f0 fix(feed): stop the compact row eating its own title on a smaller window
Every column but the title is shrink-0, so once the fixed widths outgrow
the row the title gives all of it: measured clientWidth 0 on every row at
a 1000px window — a table of channel, duration, views and date with no
titles. Columns now drop from the right as space runs out, least
important first, in the order the user named: title, then channel, then
the rest. Measured at 1000px: title 0 -> 351.

I'd written this off as "E15's problem, bites below ~640px" — wrong by
600px, because I only ever measured at 1440.
2026-07-17 00:55:46 +02:00
peter 638aa5750e fix(feed): only tooltip the channel name where it's actually cut off
I set the attribute unconditionally because the one-line row truncates
hard, and never looked at the other four views — where the name fits and
the tooltip just repeated what was already on screen. It now shares the
title's clamped check.
2026-07-17 00:50:40 +02:00
peter 30804dc7dd fix(feed): name the row's status markers once, and reliably
Dropping the sr-only twin last round swapped a double announcement for
none: a bare span's title isn't dependably surfaced, so a screen reader
got no hint a row was live, a stream, or saved. role="img" + aria-label
names each marker once and keeps the hover.
2026-07-17 00:47:40 +02:00
peter e52fba8b07 fix(feed): don't tell people to click an indicator that isn't a button
The saved pip borrowed the bookmark button's label, so it read "Saved —
click to remove" on a plain span: hover, be told to click, click, nothing.
It gets its own "Saved" string. The status markers drop their sr-only
twin too — with a title already carrying the meaning, a screen reader
that surfaces title text said it twice.
2026-07-17 00:45:06 +02:00
peter 3de7e0ba0e fix(feed): stop the compact row's meta sliding about
The cell was a flex row, so whatever sat left pushed the rest: a 36:36
and a 3:31:09 put the marker beside them at different x, and a live video
— which has no duration at all — pulled it left again. The column edges
lined up, which is all I had checked; the data inside them did not.

Each datum now has a fixed slot in a grid, the duration right-aligned as
a number should be. The chip becomes an icon, about a letter wide: it is
the least important thing in the row, and three states have to stay apart
by SHAPE — in the youtube scheme --accent is red, so a live dot and a
stream dot would be the same dot.
2026-07-17 00:41:33 +02:00
peter 26c7ed7471 fix(nav): stop back-to-top dying on the first visit to a lazy page
It looked <main> up when it bound, which the lazy pages won. On a first
visit to the channel page or Plex the chunk is still loading, so the
Suspense fallback is on screen, there is no <main> to find, and the effect
gave up — its dep never changes again, so the button stayed dead for that
whole visit and only worked once the chunk was cached.

It now reads the scroller off the scroll event instead, captured on the
document: scroll doesn't bubble but it does capture, so there is nothing
to look up and nothing to race. Also 50% bigger, as asked (44 -> 64).
2026-07-17 00:14:31 +02:00
peter 7dda44c487 fix(feed): size the compact row's columns for Hungarian too
Every width was measured in the English UI, but "101.7K megtekintés" is
139px against "101.7K views" at 79 — so a Hungarian user's view count
ellipsed itself in a column whose job is to show it. The channel column
gives back the room: its names truncate at any width we can afford (12
of 102 at 128 vs 5 at 160), and a clipped name still reads where a
clipped number does not.

The channel name also carries a tooltip now — it truncates hardest in
the fixed column and had no way to be read in full.
2026-07-16 23:59:49 +02:00
peter 5433a60ac9 fix(feed): size the badge column against the library's worst case
A 60-video sample topped out at 2:00:58, so the column was 8px short of
an 11-hour stream that is also saved — and the library holds one. That row
would wrap to two lines in the one layout that promises single ones.

The stacked layouts' textBlock now builds after the one-line row returns,
since only they use it.
2026-07-16 23:54:21 +02:00
peter f5649fc0b9 improvement(feed): make the compact row a real table
Actions lead the row: the title is what you read, so that is the shortest
pointer trip to them. Every column after it is a fixed width, which is
what puts the same datum on the same vertical line in every row — a CSS
grid cannot do it, since VirtualFeed renders each row as its own subtree.
Widths come from measuring the real data, not from taste.

Metadata rises to the channel name's size, and the duration drops its
chip: over a thumbnail that background carries contrast against the
artwork, but in a text column it only made one data column look unlike
its neighbours.
2026-07-16 23:46:34 +02:00
peter a78d0faa69 fix(feed): keep the small card's action row inside the card
Six buttons need 188px but the small card's text column bottoms out near
160 (its 180px column less padding), so the reset button — the only one
that is conditional, hence the only one anyone noticed — hung outside the
card by up to 15px. The buttons go tighter there (154px), and the row can
wrap as a backstop rather than clip. AddToPlaylist and DownloadButton now
take the button style as a prop so all six stay one size.

Tile actions also pin to the tile's bottom edge, so they land in the same
place whether the title above ran to one line or three.
2026-07-16 23:34:46 +02:00
peter 5436a81d10 refactor(feed): read the view spec's column bounds in one place 2026-07-16 04:23:43 +02:00
peter 6f1afbbb13 fix(feed): re-measure the bare row's first-paint estimate
Making it a single line halved its height (82 -> 46), which left the
virtualizer sizing a 60-item page ~2160px too tall.
2026-07-16 04:20:59 +02:00
peter f8a6ce69c7 fix(feed): give the small card the icon-only thumbnail controls too
Its column bottoms out at 180px, so its image is narrower than a row's
(measured 170px) while still carrying the 194px labelled pair — the same
overflow the row fix was for. The rule is the thumbnail's size class, not
the family: only the large card has room for labels.
2026-07-16 04:18:31 +02:00
peter ace4a144e8 fix(feed): stop the layout juddering when content lands on the scroll threshold
The feed takes its column count from main's clientWidth and its
thumbnails are aspect-ratio boxes, so the two feed each other once the
content height sits within a scrollbar's width of the viewport: the bar
appears, 15px goes, thumbs shorten, the content fits, the bar leaves,
and round again — every frame. Measured: scrollbar width alternating
0/15 and clientWidth 987/972 on consecutive frames. Reserving the gutter
holds clientWidth constant and breaks it.
2026-07-16 04:14:27 +02:00
peter f108c93c02 improvement(feed): rework the row views from UAT feedback
The bare row becomes a single line — title truncating into the space
left, then channel, badges, meta and the actions each holding a fixed
column — and it drops the 896px reading cap, since with the actions
right-aligned there is no gap for the extra width to stretch. The
actions get a reserved slot: the reset button only exists for videos
with watch state, so without one the meta sat 32px further right on
some rows than others.

Rows and tiles get a permanent container instead of a hover-only fill.
They were transparent at rest and painted an opaque bg on hover, so
running the pointer down the list kept covering and re-revealing the
ambient backdrop — which reads as the background flickering.

Card actions now sit on the bottom edge rather than wherever the title
ends, and the small thumbnails carry icon-only controls: the labelled
Continue / Restart are sized for a card's image and were clipped at
176px.
2026-07-16 04:14:27 +02:00
peter de1b32ba6f refactor(feed): tidy the inline badge classes and the no-thumb guard 2026-07-16 03:28:56 +02:00
peter 944dedb218 fix(feed): keep the duration, live state and resume bar in the bare row
Dropping Thumb dropped everything it draws ON the image — duration, the
live/stream badges, the saved marker and the resume bar. Those are
metadata, not decoration, so they move into the meta line and the bar
onto the row. Splits the spec's overloaded compact flag into thumb/dense,
which meant one thing per family and nothing on its own.
2026-07-16 03:25:05 +02:00
peter 78f21eb46b feat(feed): add the small-card, compact-row and tile views
Tiles answer the row view's wasted space: the actions move under the meta
into vertical slack the thumbnail already reserves, which frees ~168px of
width, so the block survives in a narrow column and the list can go
multi-column. Rows stay single-column on purpose — reading down one edge
is why that view exists.

The column count now comes from a per-view minimum width, so every
multi-column view reflows on the mechanism the card grid already used.
2026-07-16 03:17:30 +02:00
peter 1a94411a03 fix(feed): clamp the view menu's roving index to the option list
Guards the shared switcher against a caller whose option list shrinks
while the menu is open, which would leave every item un-tabbable.
2026-07-16 02:44:22 +02:00
peter 67f14d145f fix(feed): open the view menu on the active item, group its radio items
Seeding the roving index from an effect only scheduled the update, so the
focus effect still read the previous index and focused the wrong item for
one render — a screen reader announced both. Seed it where the menu opens
instead. The modes are one exclusive choice, so they also need a group to
scope their checked-ness to.
2026-07-16 02:42:06 +02:00
peter 805441ac58 fix(feed): give the view switcher the keyboard model its menu role promises
Arrows/Home/End move a roving focus and Escape hands focus back to the
trigger — the menu unmounts under the focused item, which stranded focus
on <body>. Outside-click deliberately does not refocus: that would steal
focus from whatever was just clicked.
2026-07-16 02:36:56 +02:00
peter eae65456ac feat(feed): pick the feed's view from its own toolbar
The view mode moves out of Settings into a switcher next to sort, on the
feed and channel pages alike. It leaves the Settings prefs draft for its
own eager save: a toolbar click must not mark that page dirty and trip
its leave-page guard.

lib/feedView.ts owns the vocabulary and maps the old grid/list prefs
forward on read, so nobody's saved choice is lost.
2026-07-16 02:29:32 +02:00
peter 303c896d87 chore(release): 0.44.0 — peek-open panels, active-filter chips, channel filter, sync chip 2026-07-16 01:21:55 +02:00
peter c88f0343e1 Merge feature/e2-panel-overlay: E2 side-panel overlay, active-filter chips, header sync chip, reachable + multi channel filter 2026-07-16 01:21:06 +02:00
peter 34fd88faf6 fix(channel): "Show in my feed" adds to the picked channels, not replaces
Sprint 5 made the channel filter multi-select, but this handler still wrote a
single-element array — so arriving from a second channel page silently dropped
the first. Union the id in (deduped, so repeating it for an already-picked
channel is a no-op).
2026-07-16 01:18:23 +02:00
peter 36581f2380 fix(channel): "Show in my feed" lands on the feed, not where you came from
It called closeChannel() before setPage("feed"). closeChannel runs
history.back(), and the popstate that restores the page fires AFTER the
synchronous setPage — so the restore won, dropping you back on whatever page the
channel was opened from. Opening from the feed hid it: the page it restored
happened to be the feed.

setPage already closes an open channel page and pushes a clean history entry, so
the closeChannel() call was both redundant and the bug.
2026-07-16 01:13:08 +02:00
peter 0d10e0f0a5 feat(filters): filter the feed by several channels at once (OR)
Pick any number of channels; they OR together and every other filter applies
across the lot — "the last week's unwatched from these three".

`channelId`/`channelName` are replaced outright by `channelIds: string[]`, no
legacy reader (standing rule: no back-compat unless asked — a saved view written
against the old field simply loses its channel filter). The wire and the share
URL move with it: repeated `channel_ids` params, `?channel=a,b`. Backend ORs via
`Video.channel_id.in_()`; the count endpoint shares the same params object.

Two things the migration exposed:
- SavedViewsWidget fed DB blobs straight into serializers that now index an
  array — the FeedFilters type says nothing about what an older build wrote, so
  the blob is coerced where it enters. It white-screened the app before this.
- Chips carried channelName to label themselves. Without it they resolve names
  from the channel cache, so they now fall back to the id, not a shared
  "This channel" that would render N identical chips while the cache loads.
2026-07-16 00:54:22 +02:00
peter 82e351bc62 improvement(channel): bring the actions to the tabs, list every channel
Channel page: the actions sat in the header's top-right corner, a page-width
mouse trip from anything else you'd click. There are only ever two tabs, so
they ride the tab row now, right next to About.

Channel picker: drop the 50-row cap — 320 plain buttons cost nothing to render
(the feed virtualises thousands), so the whole list scrolls in the same box. The
cap was caution, not a measurement. The box gets the app's usual edge-fade to
hint at more, and a line saying "Priority first, then A-Z" — the backend orders
by `priority DESC, lower(title)`, which reads as random to anyone who hasn't set
a priority.
2026-07-16 00:32:53 +02:00
peter 452fbd43de fix(filters): stop the channel list squashing its own rows flat
The picker's list is a flex column with a max height, so its fifty buttons were
flex children free to shrink: each collapsed to ~12px and clipped its own text
into an unreadable smudge instead of the box scrolling. shrink-0 on the rows.

Colour, contrast (9.03) and opacity all measured fine — the height was the
broken part, and no colour check was ever going to see that.
2026-07-16 00:16:32 +02:00
peter 3caef7f6f9 feat(filters): make the feed's channel filter reachable
`filters.channelId` was settable by exactly one thing: a "?channel=" URL from a
shared view. The panel still rendered a CHANNEL card whose only control was
"remove" — a remove button for a filter the UI could not apply.

Two ways in now. The panel gets a real Channel group (searchable picker,
first-class alongside date/tags/language, so the chip row surfaces it for free);
normalizeLayout appends it to saved layouts, so nobody loses their arrangement.
And a subscribed channel's page gets "Show in my feed", which applies the filter
and keeps the rest of your filters — the point is "this channel, the way I
normally read", which the channel page itself can't answer (it runs show=all,
scope=all over the whole catalog).

The picker owns its channel query so a few-hundred-entry list loads when the
panel is actually opened, not on every feed visit, and says "showing 50 of N"
rather than quietly stopping.
2026-07-16 00:11:30 +02:00
peter 0ab1d0b057 fix(header): show the sync chip only where it means something, trim its copy
The chip is about YouTube subscription syncing, so it only earns its place on
the feed those subscriptions fill and the manager where you curate them. On
Plex — a different source entirely — plus playlists, downloads and stats it was
just noise.

Its tooltips were written for a roomy sidebar block and read like documentation
on a pill: the counts explanation went 120 chars -> 48, the full-history one
142 -> 46, and pause/resume drop "background".
2026-07-15 23:55:37 +02:00
peter e642b356a9 fix(header): sit the sync chip with the pills, shorten its tooltip
Pinning it to the header's right edge read fine on a narrow window and stranded
it on a wide one — it's a status, but it's still part of the pill row. It now
follows the search bar.

Its tooltip was the long explanation of the counts, which is redundant next to a
popover that spells them out and overflowed the viewport from the right edge.
The chip gets the counts themselves; the explanation moves onto the popover's
counts row, where there's room for it.
2026-07-15 23:48:36 +02:00
peter 104183118d feat(header): move the sync status into a chip on the header
The rail spent a two-row block plus a divider on per-user sync status. It's
global, not per-module, so it now rides the right end of the floating header as
a pill: the headline count at a glance, an accent dot when something wants you
(paused / missing history), and the counts, state, the channel-manager link and
pause in a popover.

Frees the rail's whole top block. Also drops SyncStatus's two now-dead layouts:
"bar" was a leftover of the top bar removed in 0.42.0, and "rail" lost its only
caller here — the component is chip-only, ~60 lines lighter, and the popover
reuses useDismiss.
2026-07-15 22:42:31 +02:00
peter c440a043f2 fix(feed): no active-filter chips on channel pages
A channel page renders the Feed from its own baseline — channel-scoped,
whole-catalog, show-all, live included — so measuring it against the feed's
defaults labelled all five as "filters you applied" when they are just the page
being itself. It also has no filter sidebar (App hides it), and revealing what
the collapsed panel hides is the chip row's only job.
2026-07-15 22:30:07 +02:00
peter 644d65a3fd feat(feed): removable active-filter chips above the feed
With the filter panel now collapsed to a tab, there was no way to see what was
narrowing the feed without opening it. Every applied filter is now a chip you
can drop on its own, with a Clear all when more than one is on.

The panel's count badge and the chip row read the SAME list (lib/useActiveFilters),
so they can't disagree about what's applied; that list also owns the reset both
"Clear all"s share. Replaces the hand-summed activeCount in Sidebar.
2026-07-15 22:11:44 +02:00