Skip to content

fix(check): line_unread names the captions track that exempts a caption - #7703

Open
wonjangcloud9 wants to merge 1 commit into
heygen-com:mainfrom
wonjangcloud9:fix/check-caption-exemption-hint
Open

wonjangcloud9 wants to merge 1 commit into
heygen-com:mainfrom
wonjangcloud9:fix/check-caption-exemption-hint

Conversation

@wonjangcloud9

Copy link
Copy Markdown
Contributor

Context: I've been using HyperFrames every day for the past two weeks to make Korean Shorts and long-form videos, and it's been great to work with. This PR is one of a batch of fixes for things I ran into along the way, so you'll see several PRs from me at once — sorry for the pile-up, and thanks for your patience. Each one is reproduced on current main, independent of the others, and can be reviewed, merged or closed on its own.

What

The line_unread message now says how to exempt a caption timed to speech: put data-track-kind="captions" on its clip or host. The captions reference now says that check skips that track.

Why

A caption timed to speech cannot stay on screen longer than its words take. A voice-synced Short whose captions were plain clips (<div class="cap clip" data-start … data-track-index="2">) got a line_unread warning on almost every caption line, tens per video:

"만오천 원 정도 받은 것 같아요" (6 words) is on screen 1.67 s (±0.01 s), under its 1.72 s floor: hold it about 0.5 s + 0.3 s a word (2.30 s here) before it leaves or changes; see references/motion.md.

check already skips text under data-track-kind="captions" (isCaptionsText in layout-audit.browser.js). That exemption was only mentioned in a sentence under the craft table in docs/packages/cli.mdx. The message pointed only at holding the line longer, which the voice timing does not allow. caption_track_kind_missing does not help here either, because it only looks at sub-composition hosts.

Related work

  • No open issue or PR (searched line_unread captions, craft).
  • text_below_floor already offers its opt-out (data-layout-ignore) in its message. This brings line_unread in line with it.

How

  • packages/cli/src/utils/craftAudit.ts: both line_unread messages (mid-film and the film's last line) end with …, or, if it is a caption timed to speech, put data-track-kind="captions" on its clip or host so this check skips it; see references/motion.md.
  • skills/hyperframes/references/captions.md: the captions-track bullet says check does not time its lines against the reading floor. Skills manifest regenerated.

Test plan

  • New unit test names the captions track as the way to exempt a caption timed to speech fails on main and passes with the fix. craftAudit.test.ts: 28 passed.
  • Real CLI on a five-caption repro (hyperframes check --no-cache --json):
    • main: 4 line_unread warnings, and the messages do not mention captions.
    • this branch: the same 4 warnings, each naming data-track-kind="captions".
    • Following the hint (the same file with data-track-kind="captions" on each .cap clip): 0 craft findings, on main too.
  • oxlint, oxfmt, comment ratchet, fallow audit, typecheck (pre-commit).

🤖 Generated with Claude Code

A caption timed to speech cannot stay on screen longer than its words take,
so line_unread warned on every caption line of a voice-synced video (tens per
Short) when the captions were plain clips. check already skips text under
data-track-kind="captions", but the message never said so, and the only
pointer was a sentence in the CLI docs.

The message now offers the exemption next to the hold advice, the way
text_below_floor offers data-layout-ignore, and the captions reference says
check skips the captions track.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

This branch has not been deployed

No deployments
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.

1 participant