Repository navigation
Conversation
In the Tauri teleprompter, pressing play after a pause jumped back to the start of the script. togglePlayback first calls resizeEditor, which sets the auto-sized script editor to 0px and reads scrollHeight. That forced layout makes the scroller's content shorter than its viewport, so the browser clamps scrollTop to 0, and restoring the height does not bring it back. Playback then started from the 0 it read. The same reset happened whenever the editor resized while paused (typing, font size, window resize). Keep the scroller's scrollTop across that measurement. The GPUI teleprompter already resumes from its live scroll offset. Pull that decision into playback_resume_position and test it, so the shipping app keeps this behaviour. Fixes CapSoftware#2081
AatmanAJ
marked this pull request as ready for review
October 11, 2026 09:03
This branch has not been deployed
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.
Fixes #2081
In the Tauri teleprompter, pressing play after a pause jumped back to the start of the script.
Cause
togglePlaybackfirst callsresizeEditor(), which sizes the script editor to fit its text: it sets the textarea to0pxand readsscrollHeight.scrollHeightforces a layout while the textarea is 0px tall.scrollTopto 0.playbackPosition = element.scrollTopthen reads 0.Any editor resize while paused had the same effect, including typing, changing the font size, and resizing the window. The first play was unaffected only because
scrollTopwas already 0.Fix
resizeEditornow keeps the scroller'sscrollTopacross that measurement, using a smallpreserveScrollTophelper inteleprompter-utils.ts.playback_resume_positionwith a test, to keep the shipping app correct.Testing
preserveScrollToptests use a fake scroller that clampsscrollTopthe way a browser does when its content shrinks. One of them fails if the helper doesn't restore the position. All 12 teleprompter-utils tests pass, along with Biome andtsc -p apps/desktop --noEmit.playback_resumes_where_it_was_pausedfails if resuming always restarts from the top.cargo test --bin cap-gpuipasses 1076 tests, and clippy reports nothing inteleprompter_window.rs.
Confidence Score: 5/5
The PR appears safe to merge; no actionable issues were found.Summary
Keeps the Tauri teleprompter’s scroll position while resizing its script editor, so playback can continue where it paused.
Reviews (1) · Last reviewed commit: "fix(teleprompter): resume playback where..." · Reviewed by Greptile