Skip to content

fix(cli): retain WebVTT timestamps before cue settings - #5224

Merged
jrusso1020 merged 1 commit into
heygen-com:mainfrom
user-github-me:fix/cli-vtt-cue-setting-timestamps
Oct 8, 2026
Merged

jrusso1020 merged 1 commit into
heygen-com:mainfrom
user-github-me:fix/cli-vtt-cue-setting-timestamps

Conversation

@user-github-me

Copy link
Copy Markdown
Contributor

Importing WebVTT cues with settings such as align:start or line:90% replaces their end timestamp with zero. For example, 00:01.000 --> 00:03.500 align:start becomes { start: 1, end: 0 } and exports an SRT cue ending before it starts.

Read the timestamp token before the whitespace-separated cue settings. Keep both supported timestamp forms and the existing plain-timestamp behavior.

Validation:

  • Five fail-first tests cover full/short timestamps, alignment, multiple settings, tabs, region references and SRT export.
  • All 219 transcription/Whisper tests pass (one existing skip) with a canonical macOS temporary path.
  • Built CLI imports and exports correct 3.5 s end times across four settings fixtures and two plain controls. The input bytes are preserved.
  • Native Chromium's text-track parser reports the same cue text and times for all six fixtures.
  • CLI build/typecheck, repository lint, formatting, commit hooks and comment checks pass.

@jrusso1020 jrusso1020 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed on main: a WebVTT cue with settings after the end time, like align:start, gets an end time of 0, because the whole tail is passed to the timestamp parser. Taking only the timestamp token fixes both the long and short forms and leaves SRT parsing alone. The new cases fail on main and pass with the change. Note that this conflicts textually with #5223 in the test file.

— Rames

@jrusso1020
jrusso1020 enabled auto-merge October 8, 2026 19:34
@jrusso1020
jrusso1020 added this pull request to the merge queue Oct 8, 2026
Merged via the queue into heygen-com:main with commit f5aeecd Oct 8, 2026
80 checks passed
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