fix(blog): correct read-along alignment and clear stale highlights #16
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/audiobook-highlight-sync"
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?
Fixes two bugs Phil spotted on the live read-along:
Desync from paragraph 2 on — the difflib longest-match port merged the
j2lenrun-length map across rows instead of replacing it, leaking stale run lengths and producing wrong narration→body matches. Fixed to difflib semantics (j2len = newj2lenper row). Verified: assigned word times are now strictly monotonic in DOM order (0 backward steps across 2549 timed words).Words stayed highlighted after a seek — the
seekedhandler reset the tracking index but never cleared the orphaned.is-activespan, so every seek left a stuck highlight. The highlighter now tracks the active element directly and reconciles read-state via a moving boundary → at most one active word at any time (verified across click/±15s/drag seeks).🤖 Generated with Claude Code