Files
siftlode/frontend/e2e
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
..

E2E characterization (golden-master) net

Playwright tests that lock the app's five core flows — feed (scroll + filter), channel (open → back), player (open/close), settings (dirty-save + guard), and page switching — so the Platform refactor can prove it changed nothing. They assert current, correct behavior; they deliberately do not encode the known Platform bugs (those get their own specs when the sprints that fix them land).

Run

siftlode e2e            # against the baked localdev :8080 stack (authoritative)
siftlode e2e-ui         # same, Playwright UI mode
siftlode e2e-seed       # (re)seed the test account only, no tests

The localdev stack must be up (siftlode dev). global.setup.ts reseeds the account and logs in once, sharing the session via e2e/.auth/state.json (git-ignored).

TargetPW_BASE_URL (default http://127.0.0.1:8080):

  • :8080 (baked SPA) is authoritative and same-origin. After a frontend change you must siftlode dev (rebuild) for its baked SPA to carry the latest test hooks.

  • :5173 (Vite dev) serves source live — the fast refactor loop; it proxies /api to :8080, so the stack must still be up. All five flows are proxy-safe (none use the WebSocket):

    PW_BASE_URL=http://localhost:5173 siftlode e2e
    

Account & fixture

Tests run as a dedicated, non-demo admin account e2e@siftlode.local (never a real account; admin so the suite can reach the admin-only pages / render branches, matching the real primary user), reset to a deterministic baseline every run by scripts/e2e_seed.py (run in-container so it reuses the app's models + argon2 hasher): the top-3 organic channels subscribed, one in-progress + one watched + one saved video, prefs pinned to language: en. Credentials come from E2E_EMAIL / E2E_PASSWORD (local-only defaults). Override the container name with E2E_API_CONTAINER; skip the in-container seed with E2E_SKIP_SEED=1.

Selectors

The app has no data-testids of its own and all copy is i18n (en/hu), so the specs key on a thin data-testid layer (added with this sprint) plus the locale pinned to en. Stable ARIA hooks that already existed are used directly (role="dialog" on the player, aria-current="page" on the active nav row, aria-pressed on the feed toggles).

Typecheck

npx tsc -p e2e/tsconfig.json --noEmit (the specs are outside the app's src tsconfig).