Repository navigation
fix(cli): timeline split keeps a sub-composition's place in both halves - #5410
Merged
Merged
Conversation
Contributor
Edit accuracy: accurate 2061 (base branch 2061), smooth 1484 of thoseThe gate passes. Quarantined, measured but not gated (0) |
jrusso1020
approved these changes
Oct 10, 2026
jrusso1020
left a comment
Collaborator
There was a problem hiding this comment.
Approve at 35a73998. Whether to stamp an in-point is now decided from the element itself, inside the one function every split goes through. The CLI, the single-split route and Studio's razor therefore get the same result.
Checked
- Second half's offset. For a host with no in-point,
data-playback-startis now chosen, the first half gets0, and the clone getscurrentTrim + firstDuration * rate. That comes fromreadMediaOffsetSecondsandreadPlaybackRate, unchanged.- An authored
data-playback-startor legacydata-media-startstill wins, as before. - Splitting a second half again starts from its own stamped in-point.
- A non-default
data-playback-rateon the host is read from the attribute, so the CLI (which passes no rate) still advances correctly.
- An authored
- Parity with the razor. Studio set
isCompositionfromkind === "composition", meaning a non-root element withdata-composition-id(timelineDOM.ts, andcore/runtime/timeline.ts). In the source file a host may carry onlydata-composition-src; the runtime adds the id when it loads it. The new selector[data-composition-src], [data-composition-id]covers both, so the razor's result is unchanged. The decision now lives only insplitElementInHtml, not in each caller. - Every caller.
- The CLI's
splitMutation(a2Shared.ts), the single-split route and the cut batch (files.ts) all reach the same branch. freezeFrame.tssplits only a<video>and its linked media, so it never reaches the new branch.- No
isCompositionorstampPlaybackStartis left anywhere.
- The CLI's
- Nested sub-compositions. The function is file-agnostic, so a host inside a sub-composition's own file is split the same way. The runtime already honours
data-playback-starton a nested host, as the razor relied on. - Undo. Nothing in the undo paths changes.
timeline undorestores the file from its receipt'sbackupPathand version (a2Commands.ts:284-327), so the new attribute goes away with the rest of the split. The razor's request loses only theisCompositionfield. - The tests catch it. Swapping the new selector for one that never matches fails both new split tests, the existing composition-offset test, and the new CLI test (
expected … to contain 'data-playback-start="0"').
Nit
- The selector also matches the root composition (
data-composition-idon the root). Splitting the root isn't a real operation, and a stamp there would be harmless, so this is only worth a comment if you want the selector to say "host".
Tests: studio-server split, files and freeze-frame pass 169/169, three runs in a row. CLI src/timeline passes 104/104 and Studio razorSplitTransaction 8/8.
No HeyGen calls and no real backend. I didn't run a real render of a split host.
— Rames
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.
What changes for a user
Splitting a sub-composition clip from the command line (
hyperframes timeline split <clip> <time>) now keeps the second half's place in the scene. Before, only Studio's razor marked where each half starts inside the sub-composition (data-playback-start), so after a CLI split the second half restarted the scene from the beginning.Why
Every split goes through
splitElementInHtml, but whether the element is a sub-composition was decided by each caller and passed in as a flag. Only Studio's razor passed it; the single-split route and the CLI did not. The split function now reads it off the element itself (data-composition-srcordata-composition-id, what the runtime treats as a composition), and the flag is gone, so every caller gets the same result. Studio's razor behaves as before. Freeze frame is unaffected: it only accepts a<video>and splits it with its linked media (usually audio), never a sub-composition.Checked
data-composition-srcordata-composition-id, split with no flag, getsdata-playback-start0and2on its halves. The existing composition-offset test now uses a real host instead of the flag.timeline spliton a sub-composition host writes both in-points.No visible change
The only Studio edit drops the
isCompositionfield from the razor's split request (razorSplitTransaction.ts, 2 lines), since the server now reads it off the element. The razor's result in the timeline is the same as before; the Studio razor tests pass unchanged.