Skip to content

#267 fix - #270

Open
Pranav00076 wants to merge 1 commit into
hyperaudio:mainfrom
Pranav00076:main
Open

#267 fix#270
Pranav00076 wants to merge 1 commit into
hyperaudio:mainfrom
Pranav00076:main

Conversation

@Pranav00076

Copy link
Copy Markdown

Fix
Start at i = 0.

@maboa

maboa commented Jul 26, 2026

Copy link
Copy Markdown
Member

Thanks @Pranav00076 — the fix is correct: the share-match loop starting at i = 1 skipped words[0], so a share selection beginning at the first word was never highlighted. 👍

Two things to get it over the line:

  1. The .mjs build — CI is red because the ESM build (js/hyperaudio-lite.mjs) is generated from the CJS source and must be committed alongside it. Run npm run build and commit the regenerated js/hyperaudio-lite.mjs (it'll carry the same i = 0 change). That's what the failing git diff --exit-code js/hyperaudio-lite.mjs step is checking.
  2. A regression test in __TEST__/hyperaudio-lite.test.js — the repo keeps a test per fix and this is easy with the existing fixture: the first word is data-m="880" (0.88s), so set window.location.hash = "#hypertranscript=0.88,2.56", construct the instance, and assert the first [data-m] span gets the share-match class (fails on the old code, passes with your change). The Initial hash-based autoscroll never fires (init order) #246 test is a good pattern to copy.

With those two, CI should go green and this is ready to merge.

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.

2 participants