fix(cli): resolve relative data-start references in composition duration [P2]#2077
Open
miguel-heygen wants to merge 1 commit into
Open
fix(cli): resolve relative data-start references in composition duration [P2]#2077miguel-heygen wants to merge 1 commit into
miguel-heygen wants to merge 1 commit into
Conversation
`compositions --json` computed each timed child's start with a bare
parseFloat(data-start ?? "0") in parseCompositions (host duration) and
parseSubComposition (sub-comp duration). A relative reference like
data-start="s1" ("start when clip s1 ends") is not numeric, so parseFloat
returned NaN and that clip's contribution to the max-end was silently
dropped — a host with two 3s clips (2nd data-start="s1") reported duration 3
instead of 6, breaking compositions/inspect/snapshot for composition-clip
relative timing.
Resolve relative references the same way the extractor does (parseStartExpression
from @hyperframes/core + a findReferenceTargetEl/resolveReferencedStart port,
since the engine's referenceResolver isn't a public export across the package
boundary). Verified: host duration now 6; 3 tests pass.
(Implemented via Codex; verified independently.)
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.
Bug
compositions --json(and inspect/snapshot) computed a truncated duration when a clip'sdata-startwas a relative reference to another clip/sub-comp id.parseCompositions/parseSubCompositionreadparseFloat(data-start ?? "0")— a ref likedata-start="s1"is non-numeric →NaN→ that clip's contribution to the max-end was silently dropped. A host with two 3s clips (2nddata-start="s1") reported duration 3 instead of 6. Reported on 0.7.42.Fix
Resolve relative references the same way the frame extractor does (
parseStartExpressionfrom @hyperframes/core + afindReferenceTargetEl/resolveReferencedStartport, since the engine's resolver isn't a public export across the package boundary). Applied in both duration-computing spots.Verified
Host duration now 6 (was 3); 3 tests pass; oxfmt/oxlint clean; fallow exit 0 (deliberate mirror-not-import duplication at warn-level).