Skip to content

Preserve script line breaks in teleprompter views - #74

Open
justincone wants to merge 1 commit into
f:masterfrom
justincone:preserve-line-breaks
Open

Preserve script line breaks in teleprompter views#74
justincone wants to merge 1 commit into
f:masterfrom
justincone:preserve-line-breaks

Conversation

@justincone

@justincone justincone commented Jul 24, 2026

Copy link
Copy Markdown

Currently splitTextIntoWords replaces newlines with spaces, so a script with intentional line breaks renders as one continuously wrapped paragraph in the overlay.

This PR preserves the author's line structure. lineBreakIndices() computes which word indices are followed by a hard break (and which by a blank line), and passes that alongside the existing words array — which stays byte-identical, so char-offset-based speech tracking, tap-to-jump, and the remote/director sync protocol are unaffected. WordFlowLayout starts a new line at each break and renders paragraph breaks as a blank line of exactly one line-height, keeping the visibility-culling math uniform.

Applies to the notch overlay, floating window, fullscreen, and external display views, including director-mode live updates. Long lines still word-wrap by width as before. The browser remote view is unchanged (its renderer is separate).

Tested: word-array equivalence and break positions verified against multi-paragraph, whitespace-only-line, consecutive-blank-line, and CJK inputs.

The word splitter collapsed newlines into spaces, so scripts rendered
as one wrapped paragraph. Line and paragraph break positions are now
computed per word index (lineBreakIndices) and passed alongside the
words array, which stays unchanged so char-offset-based speech
tracking, tap-to-jump, and remote sync are unaffected.

WordFlowLayout starts a new line at each break and renders paragraph
breaks as one blank line of matching height to keep scroll culling
uniform. Applies to notch, floating, fullscreen, and external display
views, including director mode updates.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@justincone justincone mentioned this pull request Jul 24, 2026
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