Files
iptvnator/libs
4grayandClaude Opus 4.8 d14c9a4a6f fix(epg): restore timeline position when the ribbon remounts
Collapsing the inline EPG panel unmounts the ribbon (`@if (!collapsed())`);
expanding recreates the scroller at scrollLeft 0. `maybeAutoFocus` deduped the
same programme set and skipped, so the user landed at the far-left of the
multi-day guide instead of back on the live programme. Flagged by Codex.

Distinguish a real remount (a *new* scroller element) from a data re-emit /
now-tick (same element): on a new element for an already-focused channel,
re-centre the currently-viewed day — "now" for today, else the viewed day —
without committing a day, so a user parked on another day is not snapped back.
The same-element case is still left alone. Empty-today channels never set
lastFocusKey, so the ① snap-back protection is untouched.

Tests: rework the remount spec into a collapse/expand restore case (asserts a
re-centre with no day commit) and extend the empty-day guard across a remount;
a commitDay spy locks in "restore never snaps a day". ui-epg 80 green, lint
clean, controller 153 lines.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-01 18:22:07 +02:00
..