PlayheadClock: transcript follows the show #5
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
mobrule/kurageyomi#5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Parent
#1 — PRD: Kurageyomi
What to build
The transcript follows the show. This is the slice the first four exist to reach.
Add
PlayheadClock: it combines the last reported position, wall-clock elapsed time since thatreport, and paused state into a current position, and selects the Cue covering it. Pure and
testable — no network, no DOM at its boundary.
The page highlights the current Cue and keeps it in view, and holds a wake lock while playback
is running so the screen does not sleep mid-episode.
The reason interpolation is necessary: reports arrive on a 10-second throttle while playing, so
without a local clock the phone shows text up to ten seconds stale. Pause, unpause, and seeks
beyond about 5 seconds of drift arrive immediately, so those are resync points — the clock
should snap to them rather than easing toward them.
This slice answers the open question in the PRD: whether interpolated position feels tight
enough to read along with in practice. That is a judgement made by watching an episode with it,
not by a passing test. If it feels wrong, say so on this issue before building anything on top
of it — the answer changes what the rest of the app should be.
Acceptance criteria
PlayheadClockinterpolates between reports using wall-clock elapsed timePlayheadClockhas tests covering the above with injected timeBlocked by
Verdict given after watching: interpolating between the ten-second reports is tight enough to read along with. This was the riskiest assumption in the design and it holds.
The transcript-reset bug found during that session is fixed — the following screen was rebuilt on every 2s poll, discarding the scroll position, after which the highlight scrolled back to the current line. It is now built once and updated in place, with the cue list swapped only when the transcript actually changes.
Remaining imperfection is pause/unpause lag, which is polling latency rather than the clock. Tracked in #7.