Repository navigation
fix(project): leave text holds past the end of the clips out of the timeline - #3362
Merged
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Member
Author
|
@greptileai review |
richiemcilroy
marked this pull request as ready for review
October 26, 2026 12:34
Comment on lines
+1997
to
+2005
| let clips_end = self.clips_duration(); | ||
| let mut held = 0.0; | ||
| windows.retain(|(start, end)| { | ||
| if start - held > clips_end + CLOSING_HOLD_TOLERANCE { | ||
| return false; | ||
| } | ||
| held += end - start; | ||
| true | ||
| }); |
Contributor
There was a problem hiding this comment.
Rust now drops past-end holds, but the Tauri editor's holdWindows() still counts them. With a 3.2-second clip and a one-second card at 5.4 seconds, totalDuration() still returns 4.2 seconds while Rust returns 3.2 seconds. The player displays the longer duration and lets users seek beyond the playable content.
Update the frontend hold calculation and its callers to use the same cutoff.
Knowledge Base Used: Export and editor rendering
Prompt To Fix With AI
This is a comment left during a code review.
Path: crates/project/src/configuration.rs
Line: 1997-2005
Comment:
**Editor shows extra time**
Rust now drops past-end holds, but the Tauri editor's `holdWindows()` still counts them. With a 3.2-second clip and a one-second card at 5.4 seconds, `totalDuration()` still returns 4.2 seconds while Rust returns 3.2 seconds. The player displays the longer duration and lets users seek beyond the playable content.
Update the frontend hold calculation and its callers to use the same cutoff.
**Knowledge Base Used:** [Export and editor rendering](https://app.greptile.com/cap/-/custom-context/knowledge-base/capsoftware/cap/-/docs/export-and-editor-rendering.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Member
Author
|
@greptileai review |
This branch was successfully 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.
Fullscreen text cards pause the recording clock, and
TimelineConfiguration::duration()adds their length to the timeline. Clip trims and deletes do not move text, so a card can end up after the last clip. Its length was still counted, but no frame maps there:hold_windows()now drops holds that start after the clips have ended. They hold no frame and are never reached, so they no longer count towardsduration(). A hold starting exactly at the end is still a closing title. Everything else derives fromhold_windows(): frame mapping, editor ripple maths, caption projection and audio. So the timeline length, playback, audio and export now agree. The Tauri editor'sholdWindows()gets the same cutoff for its total duration (timeline-holds.ts,context.ts); its other uses convert times inside the clips, where a hold past the end changes nothing.Exported pixels do not change: these exports already ended at the last clip. Only the length the timeline reports changes, for projects with a card past the end.
Tests
holds_left_past_the_end_of_the_clips_are_not_countedin cap-project: fails on main, passes here.editing/mapping/duration-coveredandediting/export/hold-past-endpass, so their strict xfails are removed. They were the known main bugs for this: 1876 of 20000 FULL sequences failed coverage on main.crates/verify/tests/edits) gets the same documented rule, written independently.editing/mapping/holdsandediting/mapping/allcompare engine and model on 20000 random edit sequences each at FULL.zoom_inputs_invalidate_when_framing_or_timing_changesadded its hold at 50 s, past the end of its 20 s clips. That hold now rightly changes nothing, so the test now adds it at 12 s, inside the clips, and still checks that a hold invalidates the cached zoom samples.timeline-holds.test.ts(Vitest) checks the TypeScript cutoff against the same cases.Not tested by hand: the editor UI with a card past the end. CI's GPUI unit tests cover the timeline model.


Confidence Score: 5/5
The PR appears safe to merge; the previous frontend duration mismatch is fixed, and no new actionable issues were found.Summary
Stops fullscreen text cards beyond the clips from adding unreachable time.
Reviews (3) · Last reviewed commit: "fix(desktop): leave text holds past the ..." · Reviewed by Greptile