Skip to content

Fix detached transcript words after DOM edits - #278

Open
happykawayigt wants to merge 1 commit into
hyperaudio:mainfrom
happykawayigt:fix/refresh-detached-words
Open

Fix detached transcript words after DOM edits#278
happykawayigt wants to merge 1 commit into
hyperaudio:mainfrom
happykawayigt:fix/refresh-detached-words

Conversation

@happykawayigt

Copy link
Copy Markdown

Summary

Fixes #265 by keeping transcript playback alive when a cached word has been detached from the DOM and by exposing a supported way for editors to rebuild transcript caches after mutations.

Changes

  • guard the active parent update when a cached word no longer has a parentNode
  • add public refreshWords() to rebuild wordArr and parentElements
  • reset prevWordIndex, activeWordElement, and activeParentElement during refresh
  • update the generated ESM build and TypeScript declaration
  • add regression coverage for detached cached words and post-edit cache rebuilding

Validation

  • node scripts/build-mjs.js
  • full Jest suite: 3 suites passed, 76 tests passed
  • git diff --check

@happykawayigt
happykawayigt marked this pull request as ready for review July 30, 2026 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Detached word node → TypeError on null parentNode silently kills the polling chain; no public API to refresh wordArr after DOM edits

1 participant