Redesign live subtitles: roll-up display + provisional simultaneous translation - #10
Merged
Conversation
The two-line clamp from the previous attempt anchored the window to the head of the text, so once an utterance wrapped past two lines the newest words (the ones matching the audio) were hidden. And the translation line only started after ElevenLabs committed an utterance on VAD silence, leaving it a full sentence behind the original. Display: each line is now a fixed two-line viewport over a growing scroller that is translated up so the freshest words always sit at the bottom edge, animating on roll-up and snapping on resets. Live mode left-aligns inside a fixed-width block so rendered words never rewrap, and the original line renders previous + current utterance as one continuous transcript stream across commits. Alignment: a bounded slice of the growing partial is re-translated on a 1.2s throttle (transient units that bypass the translation cache) and shown as a provisional translation until the committed cue's real translation streams in, so both lines track the same utterance. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problems
-webkit-line-clamp: 2anchored the visible window to the head of the text, so once a live utterance wrapped past two lines, everything currently being spoken was clipped out of view.commit_strategy=vad, so the fix has to happen on our side.)Design
Broadcast-style roll-up captions (CEA-608 style), built around how people actually read live text:
transientand bypass the translation cache.Testing
live-text.tswith 10 unit tests (tail/word-boundary, transcript join, translation slice); full content-script suite passes (35 tests).type-check,lint, and fullpnpm buildpass.🤖 Generated with Claude Code