Repository navigation
fix(project): leave text holds past the end of the clips out of the timeline #3362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
127c9fc
fix(project): leave text holds past the end of the clips out of the t…
richiemcilroy 7af0bc7
test(rendering): add the zoom invalidation hold inside the clips
richiemcilroy ccbbccf
fix(desktop): leave text holds past the end of the clips out of the e…
richiemcilroy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| import { describe, expect, it } from "vitest"; | ||
| import { holdWindows, totalHeldDuration } from "./timeline-holds"; | ||
|
|
||
| const fullscreen = (start: number, end: number) => ({ | ||
| start, | ||
| end, | ||
| layout: "fullscreen" as const, | ||
| }); | ||
|
|
||
| describe("holdWindows", () => { | ||
| const texts = [ | ||
| fullscreen(1, 2), | ||
| fullscreen(4.2, 5), | ||
| fullscreen(6.4, 7.4), | ||
| fullscreen(9, 9.5), | ||
| ]; | ||
|
|
||
| it("counts every hold without the clips' end", () => { | ||
| expect(holdWindows(texts)).toEqual([ | ||
| [1, 2], | ||
| [4.2, 5], | ||
| [6.4, 7.4], | ||
| [9, 9.5], | ||
| ]); | ||
| }); | ||
|
|
||
| it("leaves out holds that start after the clips have ended", () => { | ||
| const holds = holdWindows(texts, 3.2); | ||
| expect(holds).toEqual([ | ||
| [1, 2], | ||
| [4.2, 5], | ||
| ]); | ||
| expect(3.2 + totalHeldDuration(holds)).toBeCloseTo(5); | ||
| expect(holdWindows(texts, 2)).toEqual([[1, 2]]); | ||
| }); | ||
| }); |
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
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
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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