Commit Graph
100 Commits
Author SHA1 Message Date
peter 4bae9113e4 test(backend): pin the traversal guard against a string-prefix bypass
Review round 1: the two existing safe_abs_path escape tests both pass even against
the classic buggy `str(path).startswith(str(root))` containment check, so a
regression to that bug would have shipped green. Add the one input that
distinguishes the correct `root not in path.parents` guard: a sibling dir whose name
prefixes the root (/root vs /rootx). Mutation-verified — swapping the guard to
startswith now fails this test. Also corrected the requirements-dev header (installed
by Dockerfile.test, not a nonexistent `dev` stage).
2026-07-21 03:36:42 +02:00
peter 33dbf70313 test(backend): pure-logic pytest harness, run in an isolated test image
The backend had zero tests. This adds 33, all pure (no DB, no network), plus the
harness to run them in the gate:

- backend/Dockerfile.test: the app's deps + pinned pytest/ruff, code bind-mounted at
  run time so it always tests the working tree. Isolated from the prod Dockerfile, so
  the published image never carries test tooling.
- requirements-dev.txt: pytest==8.4.2, ruff==0.15.21 (the version the gate already
  runs) — the backend lane is now pinned, not just host-global.
- tests: normalize_title (de-shout, hashtag strip, emoji drop, trilingual letters
  survive); storage sanitize/rel_path/download_filename and the safe_abs_path
  traversal guard (../ and absolute-path escapes rejected — verified by mutation);
  links HMAC grants (round-trip, wrong-token, tampered sig/exp, expiry) + is_expired;
  a DB-free app-assembly smoke (every router wires up, OpenAPI generates).

DB-backed router smoke (auth/feed/downloads) needs a test Postgres + migrations —
deferred. useCardPager needs hook-test infra (jsdom/renderHook) — deferred.
2026-07-21 03:29:24 +02:00
peter eea1a22572 Merge: R2 S2a — e2e scroll-restore fix + columnSort/linkify unit tests 2026-07-21 03:17:16 +02:00
peter bdb0185db8 test(frontend): unit-test columnSort and linkify
22 vitest cases for two pure helpers that had none:
- columnSort: numeric-vs-locale comparison, asc/desc, no-mutation, the null/junk
  coercion in parseSortState, and the unsorted→asc→desc→unsorted click cycle.
- linkify: http/www/bare-domain URLs, the version-number non-match, the
  "<platform>: @handle" mention (handle linked, prefix kept as text), alias→canonical
  base URL, bare @handle/#hashtag left plain, and multi-link ordering. Nodes are
  inspected structurally, so the existing node-env vitest needs no DOM.

useCardPager (a hook) is deferred to when component/hook test infra lands with the
backend pytest sprint.
2026-07-21 03:13:26 +02:00
peter 3c119b66c7 test(e2e): click a visible channel card in the scroll-restore test
The "Back restores the feed scroll position" spec failed against the production
build while the app was in fact correct. Root cause, found by instrumenting
PageScroller and comparing the baked :8080 build to live :5173:

`getByTestId("video-card-channel").first()` grabs the first card in the DOM, which
after scrolling 3000px is in the virtualizer's overscan ABOVE the viewport.
Playwright scrolls it into view to click it, moving the feed from 2879 to ~1017–1253
BEFORE navigating; PageScroller's save-on-scroll records that moved position, so Back
faithfully restores the moved position — under the test's own tolerance. A real user
clicks a card they can see, which does not move the feed.

New helper clickVisibleChannelLink() clicks a card whose bounding box is inside the
viewport. Restore now lands at ~2804 (was ~1017). 17/17 pass; stable over 3 reruns.
No app change — the scroll-restore logic was already correct.
2026-07-21 03:10:19 +02:00
peter f95d889a92 Merge: R2 S1b — ESLint flat config + Prettier gate lanes 2026-07-21 02:56:45 +02:00
peter d222751fe2 chore: add .git-blame-ignore-revs for the Prettier format pass
Lists the repo-wide format commit so `git blame` skips it. One-time local setup:
`git config blame.ignoreRevsFile .git-blame-ignore-revs` (Forgejo honours it too).
2026-07-21 02:26:53 +02:00
peter e257e2aca0 style(frontend): Prettier config + one-time repo-wide format pass
Prettier 3 (pinned), printWidth 100, double quotes — chosen to match the existing
hand-formatting and minimise reflow. This commit is ONLY the mechanical format pass
(`prettier --write`) plus the config/ignore/scripts, isolated so it never pollutes a
feature diff. Verified behaviour-neutral: typecheck, eslint (0 errors), and vitest
all green before and after. See .git-blame-ignore-revs — `git blame` skips this sha.
2026-07-21 02:26:40 +02:00
peter 04ecd8b3a7 build(frontend): add ESLint flat config as a gate lane
ESLint 9 flat config, pinned. Narrow by design: the load-bearing rule is
react-hooks (rules-of-hooks + exhaustive-deps) — 33 disable comments existed for a
rule nothing ran. tsc already owns unused vars / undefined / types, so those are
turned off here to report each finding once. no-explicit-any is off: all 19 live in
the api.ts god-module that R7 rewrites, and it flips the rule back on then.

reportUnusedDisableDirectives is an error, which immediately caught two inert
`eslint-disable` comments (App.tsx, AddToPlaylist.tsx) whose effects have stable
deps — removed. no-unused-expressions allows the side-effect ternary idiom the
codebase already uses (`v.paused ? v.play() : v.pause()`).

Errors: 0. Remaining 38 are warnings (28 react-refresh DX, 10 exhaustive-deps) —
pre-existing, visible in the lint output, tracked to their epics.
2026-07-21 02:25:12 +02:00
peter dc991111a9 Merge: R2 S1 — quality gate wiring (build typecheck, knip pin, publish gate) 2026-07-21 02:17:25 +02:00
peter 33abf2a4d8 fix(build): stop the host tree leaking into the image, split the tsc lanes
Review round 1 fallout, all of it verified against real builds:

- .dockerignore: `node_modules/` is anchored at the context root and has no
  implicit `**/` (unlike gitignore), so it never matched frontend/node_modules.
  `COPY frontend/ ./` was overlaying the Windows host's node_modules on top of
  what `npm ci` had installed — the image carried @esbuild/win32-x64 and 31 .cmd
  shims, and the new typecheck ran a tsc resolved from that merged tree. Build
  context transfer drops 3.05 GB -> 19 kB. Also excludes e2e/.auth (a live
  Playwright session), the report/result dirs and logs.
- build no longer type-checks the e2e project: a type error in a spec must not
  make the app unbuildable for a self-hoster. The gate still checks it via
  `npm run typecheck` (now three named lanes).
- tsconfig.json references tsconfig.node.json, so editors check vite.config.ts /
  vitest.config.ts under the same config the gate uses instead of an inferred one.
- vitest include accepts .test.tsx: an uncollected test file does not fail, it
  silently never runs.
2026-07-21 01:37:53 +02:00
peter 172ab8008f build(frontend): type-check the production build, pin knip
`npm run build` now runs `typecheck` first, so the Docker image is built through the
same gate as local dev — until now the image was a bare `vite build`, and esbuild
strips types without checking them.

typecheck covers three projects: src, the Node-side build configs (new
tsconfig.node.json — vite.config.ts/vitest.config.ts were type-checked by nothing),
and e2e. knip moves from `npx knip@latest` to a pinned devDependency so the gate
stops depending on the network and on whichever version shipped that morning.
2026-07-21 01:07:54 +02:00
peter 25f0d71dfc chore(frontend): unexport two ConfirmProvider-internal types
knip flags them: both are only referenced inside the file. Clearing them is what
makes the lint lane green enough to become a hard publish gate.
2026-07-21 01:07:54 +02:00
peter 855ae0c995 release: 0.48.0 — playlist column headers, and sorting stops rewriting the list 2026-07-21 00:46:41 +02:00
peter a94da079ba Merge: E4 S4 — playlist hybrid table (view-sort + explicit save)
Closes E4. The playlist detail gains real sortable/filterable column headers
over the drag-reorderable list, and the crucial distinction: the sort and the
filters are a VIEW, while the stored order changes only on drag or an explicit
save. Picking a sort used to write straight through to the server.

Also extracts the column header out of DataTable (shared by both tables now,
which fixed the filter popover remounting on every keystroke), and closes eight
findings from the 2026-07-20 reviews that lived in these files.
2026-07-21 00:43:36 +02:00
peter f87d58d8d7 fix(playlists): name the view state in one sentence
Sorting a playlist whose stored order already matches the sort produced a
warning, no Save button and no visible change — which reads as a malfunction,
not as "there is nothing to save". And when the order DID change, three separate
texts piled up in the toolbar (a reset link, a save hint, a "reordering is off"
notice), none of which answered the question actually being asked: did I just
change my playlist?

One line now names which of the three situations you are in — the view matches
the saved order, the view differs and can be saved, or a filter is on and saving
is impossible — and says in each case that the saved order is untouched. The
disabled grip still explains itself on hover and focus, so that notice no longer
needs to stand in the toolbar.
2026-07-21 00:40:49 +02:00
peter cdec80547e fix(playlists): UAT round 1 — drag lag, an invisible default sort, dialog layout
- The dragged row trailed the cursor by 150ms. The row carried Tailwind's bare
  `transition` utility (copied from DataTable's <tr>), which animates TRANSFORM
  — exactly the property dnd-kit drives from the pointer. transition-colors now,
  and the row being dragged drops dnd-kit's own transition too.
- The list looked sorted by Channel when it was really in its stored order that
  happens to be channel-grouped, and nothing said so. Sorting by "#" ascending
  IS the stored order, so it is now the neutral state: the header shows a real
  arrow for it, cycling off any column lands back on it, and it stays the state
  where drag is enabled and no save is offered.
- A choice dialog with two or more actions stacks vertically. Side by side they
  wrapped raggedly, and the wrapped one read as a lesser second group when the
  two are peers. Cancel goes last, actions run least to most destructive.
2026-07-21 00:03:07 +02:00
peter 6dc7b9268a fix(playlists): the table overflowed the page scroller
A truncate cell is white-space:nowrap, so its min-content width is the whole
title — under table-layout:auto the Title column grew until Length and the
remove button hung off the scroller (measured: table 1059px inside an 855px
wrapper, main.scrollWidth 1074 vs clientWidth 887). Fixed layout with a declared
width on every column but Title, which absorbs the rest.
2026-07-20 23:48:50 +02:00
peter efd46a01c8 fix(playlists): address the review round — 11 findings
Header (shared, so every table gets these):
- The filter funnel could not close itself: useDismiss only knew the panel, so
  the trigger's mousedown closed it and the click reopened it. It now knows the
  trigger, captured at open time so it survives the close.
- Escape stranded focus on <body>; it goes back to the funnel, which also gained
  aria-expanded/aria-haspopup.
- A non-sortable header rendered a focusable no-op button — two unlabeled dead
  stops per playlist table, whose grip and actions headers are empty. Plain span
  unless the column sorts.

Playlist:
- The disabled drag grip explained itself to nobody: `disabled` drops a button
  from the tab order and suppresses its tooltip. It is aria-disabled now, stays
  focusable, and the reason is its accessible name.
- That reason also lied on a built-in list, where the block has nothing to do
  with sorting or filtering. Third branch, own string.
- The open player followed a position in a derived list, so a refetch or a view
  change could slide a different video under it or unmount it mid-playback. It
  follows the video id, like PlayerModal's own queue already does.
- A failed reorder could not resync: the id set is unchanged by a reorder, so
  the arriving detail was judged "same list" and the rejected order stayed on
  screen as the base for the next drag.
- The same guard is now keyed by playlist. Two lists holding the same videos
  looked identical to it, so the second rendered in the first's order and
  inherited its undo stack — where Undo would write it back to the wrong list.
- A one-item list filtered to nothing had no Reset view: the whole control strip
  was gated on the item count while the funnels rendered regardless.
- Both delete outcomes now read as actions ("Delete here only" / "Delete here
  and on YouTube"); "Here only" scanned as the safe choice while also deleting.
- Keyboard dragging shipped with dnd-kit's hardcoded English screen-reader
  instructions and announcements. Localized, with live positions.
2026-07-20 23:45:31 +02:00
peter 83e673718f feat(playlists): hybrid table over the drag list, and guard its destructive paths
The column sort and the filters are a VIEW; the playlist's stored order only
changes when the user presses "Save this order", which still goes through the
undoable path. Picking a sort used to write straight to the server, so merely
looking at the list by title rewrote the playlist and marked a YouTube-linked
mirror dirty.

The table:
- playlistColumns.tsx holds the column defs; the body renders them as table rows
  and fills the grip cell itself, since the handle needs the row's sortable
  listeners that a render closure can't reach.
- The # column shows the STORED position, so a view-sort never renumbers the
  playlist under the reader.
- Saving is withheld while a filter is active (it would drop the hidden items),
  and drag is disabled under any view, with the reason spelled out rather than
  silently doing nothing.
- applyView/sameOrder live in lib/playlistView.ts with tests: the sort and the
  channel grouping compose, and getting that wrong produces a plausible order
  that the save button would then persist.
- dnd-kit KeyboardSensor: the grip was focusable and called itself "reorder",
  but only a pointer could move it.

The guards:
- Delete is ONE dialog with every outcome. It was two chained confirms where the
  second one's Cancel/Escape/backdrop meant "delete here only" — dismissing the
  dialog deleted the playlist. ConfirmProvider gained useChoice() for it.
- ConfirmProvider focuses Cancel when an offered action is destructive; the
  confirm button took autoFocus unconditionally, so a stray Enter on an open
  dialog ran "Delete user" or "Clear audit log".
- Removing an item asks first, and rebases the undo history instead of throwing
  it away: useUndoable.rebase maps every snapshot, so the reorder history stays
  valid for the remaining items.
- A failed detail query showed "Loading…" forever; it now says so and offers a
  retry. Rename and reorder failures are surfaced instead of swallowed (reorder
  was a bare .then(), which also produced an unhandled rejection).
- Local reorder/remove no longer require YouTube write scope.
- playlistName() replaces the watch-later localizer copied into three files.
2026-07-20 23:30:49 +02:00
peter 89000538d4 refactor(table): extract the column header out of DataTable
The sort cell, filter funnel/popover and filter predicate move to
components/tableHeader.tsx so a non-DataTable body can render under the same
headers — the playlist manager's drag-reorderable list needs the headers
without inheriting DataTable's internal ordering state.

FilterPopover reaches module scope in the process. It was declared inside
DataTable's body, so it was a new component type on every render and React
remounted it on each keystroke; verified against the pre-change build, where
the input's DOM node is replaced on all four keystrokes of a test word.

Also picks up two things that live in this markup: aria-sort on the sortable
headers, and a real hit target on the filter funnel (it was 14x14).
2026-07-20 23:18:46 +02:00
peter 742cf2df73 release: 0.47.0 — relative timestamps fixed, and localized by the platform 2026-07-20 22:31:30 +02:00
peter 72bd1d9e9d Merge: relative time localized by Intl.RelativeTimeFormat
Hands the wording to the platform instead of 12 hand-written strings.
Hungarian is unchanged; English becomes more compact.
2026-07-20 22:30:40 +02:00
peter 93b793dea2 Merge: relative-time tier shift fix + the first unit tests
Fixes a bug live since 0.2.0 (ea317c0): every relative timestamp named the
tier below its own range, so minutes read "Ns ago" and hours "N min ago".
Brings the repo its first unit-test runner along with it.
2026-07-20 22:30:40 +02:00
peter 7cd5adc78f refactor(format): localize relative time with Intl.RelativeTimeFormat
The tier table kept a divisor and a translation key as two independently
maintained halves, and a mispairing there rendered minutes as "Ns ago" for 59
releases. The table now pairs a divisor with the Intl unit it produces and the
platform supplies the words, so the wrong half is at least self-evident on
sight — "minute" next to 3600 reads wrong in a way "time.minutesAgo" never
did. It also removes 12 hand-written strings and hands plural rules to CLDR
for any language added later.

Hungarian output is byte-identical to the strings it replaces. English gets
shorter: "59 min ago" to "59m ago", "1 wk ago" to "1w ago", "1 mo ago" to
"1mo ago", "1 yr ago" to "1y ago"; "2h ago" and "1d ago" are unchanged.

style narrow matches the app's compact timestamps and numeric always keeps it
counting, rather than "yesterday"/"last week". time.justNow stays because Intl
has no wording for the sub-minute case. Formatters are memoized per language,
since this runs once per rendered timestamp across a virtualized feed.
2026-07-20 22:28:09 +02:00
peter dea63d8fd2 refactor(format): hoist the relative-time tiers and lock their invariants
Review follow-ups on the tier-shift fix. The table moves to a module-level
RELATIVE_UNITS: it is constant, so rebuilding it per call was pure garbage on
a path that runs once per rendered timestamp across a virtualized feed.

Its ascending order is load-bearing and was unstated — sorting it largest-first
would make every timestamp under a year read "just now", silently, the same
shape as the bug this branch fixes. It is now documented and asserted, and the
suite derives its tier coverage and translation checks from the table itself
rather than from its own case list, so a new tier cannot slip in uncovered.

The audit log read the empty string for an unreadable date as a value and
rendered a blank cell; it now uses the `|| "—"` idiom the channel table
already uses, so missing and unreadable dates look alike.
2026-07-20 22:17:51 +02:00
peter da728f0c5e test(format): cover the relative-time tier boundaries
The repo had no unit-test runner, so this adds the minimum: vitest (3.x, as
4.x needs Vite 6), a node-env config deliberately separate from vite.config.ts
so the production build never loads it, npm test / test:watch, and a knip
entry so the config and specs are not reported unused. Browser flows stay in
e2e/ under Playwright.

The suite samples every tier at its exact opening second as well as inside it,
and stubs i18n so each assertion lands on the key rather than the copy. An
interior-only suite still passes when the range comparison flips to <=, which
is how the tier shift went unnoticed for so long.
2026-07-20 03:06:50 +02:00
peter c61bc4ff74 fix(format): relative time labelled every tier one unit too small
The units table paired each divisor with the NEXT row's label, so the count
came out right and the word wrong, all the way up the scale: minutes rendered
as "Ns ago", hours as "N min ago", days as "N hours ago", months as "N weeks
ago". Most visible on the audit log, where scheduler rows three minutes apart
read "1s / 4s / 7s ago".

Each row now carries its own label and is read whole, so a divisor can no
longer drift from its word. Also guard a non-finite age, which rendered
"NaN mo ago", and drop time.secondsAgo now that nothing emits it.

Present since ea317c0 swapped the hardcoded English strings for i18n keys;
shipped in every release from 0.2.0 on.
2026-07-20 03:06:42 +02:00
peter 758e655642 release: 0.46.0 — channel manager overhaul (table/cards, About, shared sort, paging) 2026-07-20 01:31:15 +02:00
peter 5210e9c6fe Merge: E4 managers overhaul — bottom pager, About column, table/cards layouts (S1–S3) 2026-07-20 01:29:53 +02:00
peter 307ab96d84 fix(managers): two-way menu flip + extract useCardPager
- The tag menu's flip was one-way: once anchored above it stayed there, so a row
  scrolling toward the top dragged the menu off the screen. It now re-decides both
  ways each pass — prefer the side it is on (no flapping), leave it as soon as that
  side stops fitting and the other does. Verified: trigger at y=229 (no room above)
  flips back below, menuTop 253 = btnBottom 249 + 4, nothing off-screen.
- Extract the card pagination into lib/useCardPager: size (persisted, validated),
  page, the out-of-range clamp-commit, the slice and the Pager props lived twice,
  and every review round had to fix both copies in lockstep. The two tabs now keep
  only what differs — which rows, which storage key, and when to reset.
  The clamp is gated on the card layout too, so it no longer rewrites card state
  while the table is the one on screen.
2026-07-20 01:24:31 +02:00
peter ab5f3c9fbb fix(managers): address the E4 S3 code-review round 3 findings
- The tag menu's "trigger is gone" test now measures against the SCROLLER, not the
  window. The page scroller starts ~230px down (measured), so a row that slid under
  the fixed toolbar was still "on screen" by window coords and the menu floated over
  the chrome, anchored to something invisible.
- Scroll-repositioning keeps whichever side the menu is anchored to instead of
  resetting it to "below" every frame — that reset made the layout effect flip it
  back, costing two renders and two forced layouts per frame near the bottom edge.
- One placement rule (`coordsFrom`) now serves the initial open, the layout
  correction and every reposition, so those can no longer drift apart.
- Card page: reset on the filter/sort INPUTS only, and separately COMMIT the clamp
  when the page falls out of range. Keying the reset on the row count (round 2) was
  too blunt — a background refetch that merely added a channel threw the reader off
  page 7 for something they didn't do.
- Pager derives `pageCount()` once and `hasPagerContent` reuses it, instead of the
  same expression twice in one file.
- Re-indent the pagerNode JSX left dangling by round 2's ternary edit.
2026-07-20 01:10:13 +02:00
peter c630d29ff6 fix(managers): address the E4 S3 code-review round 2 findings
- The portalled tag picker now FOLLOWS its trigger on scroll (rAF-coalesced)
  instead of closing. Closing on every wheel tick was a regression for the table,
  where the menu used to travel with its row; it still closes once the trigger
  leaves the viewport (nothing left to anchor to) or on resize.
- Place the menu by MEASUREMENT, not a px estimate: it opens below, then the
  layout effect flips it above only if the real box overflows. The old
  `rows * 30px` guess read short at font-scale 1.3 (the rows are rem), which
  could leave a fixed menu hanging off the bottom with no way to reach it.
- `toggle` only opens once a position exists, so the `open && coords` gate can
  never show a stale anchor.
- One owner for "is there anything to page": `hasPagerContent()` lives in Pager
  and DataTable calls it, instead of both re-deriving the rule — that drift is
  what left empty control bands behind in the first place.
- Reset the card page on the row COUNT too, not just the filter inputs, so an
  unsubscribe or a shrinking refetch can't leave a stale page to spring back.
- `parseCardSize` clamps to the sizes the pager actually offers (like clampView /
  clampStatus), so the select can't display one value while the grid pages by another.
- VirtualGrid's docblock now carries the stacking-context constraint: its rows are
  transformed, so anything floating an item renders must portal out.
2026-07-20 00:56:47 +02:00
peter 260de48f41 fix(managers): the tag picker drew under the next card
In the card layout every VirtualGrid row carries a `transform`, which makes it a
stacking context — so the tag menu's z-index was scoped to its own row and the
NEXT card (a later DOM sibling) painted over it. Same hazard that buried the
players in E3, so the same blessed fix: render the menu through <Overlay> (i.e.
at <body>) with fixed coords instead of `absolute` inside the cell.

The flip-up case anchors the menu's BOTTOM to just above the button so it lands
exactly whatever its real height is, and the horizontal clamp measures the
rendered width rather than assuming px — `w-44` grows with the text-size slider.
Closes on outside click (dismiss now watches the cell AND the portalled menu),
and on page scroll/resize, where a fixed menu would otherwise strand at a stale
anchor. Verified in both layouts by hit-testing the menu's own pixels.
2026-07-20 00:42:33 +02:00
peter be9d17ebb1 fix(managers): address the E4 S3 code-review findings
- DataTable: keep `pagerNode` NULLABLE. Extracting Pager made it an always-truthy
  element, so the `controls` / `bottomControls` guards always fired and a table with
  nothing to page rendered empty `my-3` bands (plus an empty in-band PageToolbar).
- ChannelsProvider: `setView` bails when the tab is unchanged (re-selecting the
  active tab, or goToFullHistory forcing "subscribed", stacked dead Back entries),
  and pushes a FRESH state like setPage does instead of spreading `_chan`/`_yt`
  markers into the tab entry.
- Lift the layout into its own narrow context (`useChannelLayout`): App read the
  whole ChannelsState for the fade, so every keystroke in the manager's search box
  re-rendered the app root.
- Reset the card page when the row set or sort changes (both tabs) — the clamp only
  hid a stale page, which came back when the filter was cleared.
- Sort + slice the card rows only in cards mode; table mode was copy-sorting ~300
  rows per render for a result nothing read.
- Validate persisted `cardSize` / `sort` (`parseCardSize`, `parseSortState`), matching
  the clamp-on-read convention the module's other persisted values already follow;
  a corrupt size made the page count NaN and emptied the grid.
- Pager: page-size changes scroll to the top too (they re-slice from a new first item).
- ColumnSortControl: a stored sort naming a column this table no longer offers is
  treated as no sort, instead of showing a direction arrow for a sort that isn't applied.
- Drop the stale "rows" layout comments (that variant was retired this sprint).
2026-07-20 00:34:38 +02:00
peter a50608d026 feat(managers): actions-first discovery table, tabs in the back chain, pager scrolls to top
UAT round 4:
- Discovery table: move Actions to the first column, mirroring the Subscriptions
  table (where it sits right after Prio) so both tabs' actions line up.
- The manager's tabs now ride in history.state (`_chTab`), the same way the channel
  page (`_chan`) and the live search (`_yt`) already do — so Back steps back through
  the tabs you visited before it leaves the module. Arriving from elsewhere stamps
  the entry setPage pushed (one navigation never costs two Back presses).
- Turning a page now scrolls the list back to its top (both the tables and the card
  grid, since they share Pager) — landing mid-list in an unseen page is disorienting.
2026-07-20 00:14:23 +02:00
peter dff4152522 feat(managers): paginate the card layout + its top scroll-fade
UAT round 3 feedback on the card layout:
- Add a pager + "Cards per page" to the card view (it infinitely-scrolled before).
  Extracted the pager cluster out of DataTable into a reusable Pager component
  (the table now renders it too — no behaviour change); the card view slices the
  sorted rows and drives its own per-account page size (subscribed + discovery).
- Restore the top edge-fade in the card layout. The channels page registers
  fadeTop:false for its sticky-header table; the card layout has no sticky header,
  so App now re-enables the top fade when the channel layout is cards.
2026-07-19 23:28:43 +02:00
peter 9c4dd0163a feat(managers): shared sort across the table and card layouts
Cards have no column headers to sort by, so lift the sort out of DataTable into
one shared state that BOTH views drive and reflect. New lib/columnSort.ts holds
the comparator + click-cycle (one source of truth); DataTable gains an optional
controlled sort (sort + onSortChange) and falls back to its internal persistKey
sort when they're omitted, so every other table is untouched. The subscribed
sort lives in ChannelsProvider, discovery keeps its own (its columns differ);
a new ColumnSortControl dropdown (options derived from the columns' sortable
metadata, feed-style + asc/desc toggle) drives it in cards mode. Per-account,
persisted, per-tab.
2026-07-19 23:09:54 +02:00
peter 875c7ad741 feat(managers): richer channel cards + drop the rows layout, cap the channel column
UAT round 1 feedback:
- Retire the `rows` layout — it barely differed from the table; keep Table + Cards.
- The card now shows the About cell (+ its hover overlay) and the priority stepper
  in every layout, not just the table: ChannelLayoutGrid gains named slots
  (lead / about / actions) and stops hiding the `hideInCard` columns, since the
  roomy desktop card has space the cramped mobile fallback did not.
- Fix the table losing its centering with "Rows per page: All": a long-titled
  channel stretched the uncapped Channel column (~289→429px) and overflowed the
  centered table. Cap it with a max-w element inside the cell (table-layout:auto
  ignores a cell max-width), the same trick AboutCell already uses. Gaps now 163/162.
2026-07-19 22:42:09 +02:00
peter b659ad800c fix(managers): key the row-layout primary cell + measured rowEst
Self-review follow-ups: the `rows` layout mapped the primary column without a
React key (single-element today, but a warning waiting to happen); wrap it in a
keyed Fragment. Also replace the guessed card/row rowEst with browser-measured
values (176 / 62) so the scrollbar doesn't jump on first scroll.
2026-07-19 21:59:28 +02:00
peter 1703d4ab5e feat(managers): table / cards / rows layouts for the channel manager (E4 S3)
A generic ViewSwitcher (reused from the feed) drives a per-account layout
shared by the Subscriptions + Discovery tabs. `table` keeps the DataTable
(numbered pager); `cards` and `rows` render a virtualized grid over the same
client-side list via the new ChannelLayoutGrid, which composes cells straight
from each table's Column<T> render closures (cardPrimary/hideInCard/cardLabel),
so both tabs — with their different columns — get the views for free. Status
chips surface in the fixed band when the table's own controls row is gone.
2026-07-19 21:52:16 +02:00
peter 5ea82095a1 refactor(feed): extract virtualization engine into a generic VirtualGrid<T>
VirtualFeed becomes a thin wrapper that maps a FeedView to VirtualGrid's
layout spec and renders a VideoCard per item; all measure/chunk/place/
infinite-scroll mechanics move to VirtualGrid so the channel manager (E4 S3)
can reuse them. Behaviour-preserving: e2e 17/17, all render families smoked.
2026-07-19 21:36:54 +02:00
peter 1fdc01c0cd feat: linkify resolves '<platform>: @handle' social mentions
Platform-prefixed handles (x/twitter/instagram/facebook/tiktok/youtube/twitch/threads/
telegram/soundcloud) now link to the platform's profile URL — only the @handle is
linked, the '<platform>:' label stays as text. A required colon/arrow separator + the
known-platform list keep false positives out; a bare @handle with no platform stays plain.
2026-07-19 21:05:00 +02:00
peter 36641b5bc0 feat: linkify also catches www.* and bare domain.tld/path URLs
The description linkifier only caught http(s):// URLs; extend it to www.* hosts and
bare domain.tld/path URLs (both get an https:// href prefix), so links like
www.amelielens.com and facebook.com/amelielensmusic become clickable too. A required
path + letters-only TLD keep false positives (version numbers, file names) out; bare
@handles and #hashtags stay plain (the platform is ambiguous).
2026-07-19 20:51:29 +02:00
peter b741a8fd28 feat(managers): clickable links in descriptions + real SVG country flags
- linkify: bare http(s) URLs inside channel descriptions become clickable links
  (new tab, rel=noopener noreferrer) — new lib/linkify.tsx, used in the shared
  ChannelAboutContent so both the About overlay and the channel detail page get it
- Country flag: the flag EMOJI never renders on Windows/Chrome (showed the small-caps
  'hu' fallback), so swap it for a real self-hosted SVG flag via the flag-icons package;
  applies to the About overlay + the channel detail page
2026-07-19 20:42:28 +02:00
peter 8abb78b0bd refactor(managers): full About overlay + center the wider channel content (E4 S2 follow-up)
- The About overlay now shows the FULL channel About (description, external links,
  country, language, topics, keywords) — the same content as the detail page's About
  tab, via a new shared ChannelAboutContent component (reused by ChannelPage + AboutCell)
- AboutCell fetches the channel detail ON DEMAND on hover (shared [channel,id] react-query
  cache with the channel page), so the list stays light; the overlay is interactive
  (scrollable + clickable links) via a small hover-bridge, and closes on page scroll/resize
- Center the content: max-w-7xl -> max-w-[96rem] on the channel tables + header, so the
  wider About table stays symmetric with the header (mx-auto handles the responsive centering)
- Topic chips are display-only for now; the future search epic makes them clickable
2026-07-19 20:25:06 +02:00
peter 9db1d3fba3 feat(managers): About column with hover overlay on both channel tables (E4 S2)
- Backend: add channel description to the shared _channel_summary projection, so both
  the subscribed list and the discovery list carry it (no migration; description is
  already stored from the channels.list call)
- New AboutCell: one truncated line in the table + full text in a portalled, always-on
  glass hover/focus overlay (wider than Tooltip, flips above the anchor near the bottom,
  closes on scroll/resize)
- About column (after Channel) on both the subscribed and discovery tables; hidden in the
  mobile card fallback
2026-07-19 19:35:07 +02:00
peter 669dc3f2a6 refactor(managers): tidy channel header + column filters + move Actions (E4)
- Drop the intro blurb (+ its orphan channels.intro i18n key and Trans import)
- Header is now two tight rows: tabs + stats (right), your-tags + sync/backfill (right),
  leaving room on the tab row for future tabs
- Add a funnel filter on the Prio / Channel / Sync / Tags columns (client-side, like
  the discovery table's Channel filter)
- Move the Actions column to 2nd position (after Prio, before Channel), left-aligned
2026-07-19 18:24:25 +02:00
peter 83b60df112 feat(managers): bottom pager on the channel tables (E4 S1)
DataTable gains a working controlsPosition="both": the leading controls
(e.g. the status chips) stay ONLY at the top; the bottom row is pager-only
(no duplicated chips). The subscribed + discovery channel tables opt in, so
the 33-page list has a pager at the bottom too — no scroll back up.
2026-07-19 15:45:09 +02:00
peter 97611be9c4 release: 0.45.1 — player & share fixes 2026-07-19 06:08:06 +02:00
peter 870cf7e52d Merge: player & share polish (bugs 5, 8, 9)
- Plex player fills the screen in native fullscreen (was 720p-capped, centred)
- YouTube modal reverted to its smaller base size
- iOS-safe clipboard copy helper, adopted across all 5 copy sites
2026-07-19 06:07:05 +02:00
peter f8826b846b fix(plex): fill the screen in native fullscreen
Bug 5: in browser fullscreen the video stayed small and centred instead
of filling the screen. Two causes:

1. The wrapper carries 80vw/80vh + transform:scale(1.25) for the windowed
   HTPC look; in native FS that scaled layer never filled. Size the
   wrapper to 100vw/100vh with NO transform while fs is on.
2. The real culprit: the <video> was `w-auto h-auto max-h-full max-w-full`,
   which caps at the stream's intrinsic resolution (720p -> 1280x720) and
   never scales UP. The windowed scale(1.25) hid this. Switch to
   `w-full h-full object-contain` so it fills the wrapper by aspect.

Verified visually in real Chrome native fullscreen: video rect 1920x1024
(fills), was 1280x720 centred.
2026-07-19 06:01:21 +02:00
peter 42ae451c1b fix(share): robust clipboard copy with an iOS-safe fallback
navigator.clipboard.writeText is intermittent on iOS Safari (bug 9: the
download share-link copy 'often does neither'). Add lib/clipboard.ts
copyText(): a gesture-safe execCommand path FIRST (before any await can
spend the transient user activation), async Clipboard API as fallback.
Migrate all five copy call sites to it.
2026-07-19 05:38:42 +02:00
peter 31a8835f7f fix(player): revert the YouTube modal to its smaller base size
The max-w-6xl bump was a quality lever (bigger pixel box → higher ABR);
the user prefers the smaller max-w-4xl base back. A user-selectable size
preset stays a future item.
2026-07-19 05:38:42 +02:00
peter 86a6d696b8 release: 0.45.0 — feed view modes + Plex cast-explore
Cuts the release for the unshipped stack since 0.44.0: E3 feed view modes, the
Platform refactor (S1–S6b, internal), and the Plex cast-explore epic. VERSION
0.44.0 -> 0.45.0; user-facing releaseNotes entry.
2026-07-19 04:58:36 +02:00
peter 901c952739 Merge: Plex cast-explore — full-cast filtering, AND/OR, person cards, backfill
Fixes the pre-existing Plex bug where clicking a lower-billed cast member emptied
the grid (the sync only stored the top ~3 cast, AND-matched). Now: the full cast
is persisted on info-view (lazy) + a batched rich re-sync backfills the whole
library (marker 0057); the actor filter defaults to OR with an AND toggle
(feed-rail pill style); the filtered actors show as person cards (photo + count +
remove); orphaned headshot-cache rows are pruned each sync. Shared app/plex/people.py
backs both enrichment paths. E2E 17/17; /code-review clean (2 fixed). UAT passed.
2026-07-19 04:51:35 +02:00
peter af6faf476f feat(plex): full-library cast backfill via a batched rich re-sync (S1b)
Lazy enrichment only covers viewed titles, so an actor's count/results were
partial. Add a background backfill: each plex_sync rich-fetches a bounded batch
(60) of not-yet-enriched movies/shows and persists their FULL cast, stamping
people_enriched_at so each is fetched once — the whole library is covered over
successive runs (migration 0057 adds the marker). Extracted the enrichment into a
shared app/plex/people.py (cast_from_meta / enrich_row_people / prune_orphan_people
+ the person-image host/proxy) so the info-page lazy path and the batch share ONE
implementation — no duplication; the info page also stamps the marker so the batch
skips it. Verified: an 8-item batch grows those movies' cast_names 3->24 and fills
plex_people (32->224); the info-page cast is intact after the _rich_meta refactor.
(Plex cast-explore S1b)
2026-07-19 04:50:45 +02:00
peter 12d17ec7b0 polish(plex): match the feed rail's segmented-pill look for the any/all toggle
The genre + actor MATCH toggles were a boxed button row (rounded-lg border, no
track); restyle them as the feed rail's tag-match toggle — a rounded-full track
(border + bg-card + p-0.5) with an inset rounded-full active pill, plus a MATCH
label. Extracted a shared MatchToggle so both read identically. i18n
plex.filter.matchLabel (en/hu). (Plex cast-explore polish)
2026-07-19 04:31:02 +02:00
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