fix(producer): render -c <scene> uses the scene's own duration, not the project's#2087
Draft
miguel-heygen wants to merge 1 commit into
Draft
fix(producer): render -c <scene> uses the scene's own duration, not the project's#2087miguel-heygen wants to merge 1 commit into
miguel-heygen wants to merge 1 commit into
Conversation
…he project's When rendering a single sub-composition standalone (`hyperframes render -c compositions/scene.html`), the producer extracts the scene's mount from index.html and wraps it in a shallow clone of the master root. That clone kept the master's `data-duration`, so the standalone composition advertised the whole project's length instead of the scene's own: a 2s scene rendered for the full 12s project, and a master that derives its length from sibling mounts (now removed) produced "Composition has zero duration". Re-point the extracted wrapper's `data-duration` at the scene's own, read from the scene file's `<template>` root (the source of truth for that scene), with a fallback to the mount's `data-duration`. Full-project renders are unaffected — they never take the extraction branch. Verified end-to-end via the pre-capture duration gate: a 2s scene now resolves to 2s and a 10s scene to 10s (both were 12s), while the full index render stays at 12s. Adds unit coverage for both the scene-file and mount-fallback paths.
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.
Problem
Rendering a single sub-composition standalone —
— renders it for the whole project's duration instead of the scene's own. A 2s scene mounted in a 12s project renders as 12s. When the project's master root derives its length from sibling mounts (rather than a literal
data-duration), the same path instead throws:This is a false-negative against the documented QA flow: the scene
snapshots andvalidates correctly standalone, so the wrong length only shows up in the final render.Root cause
To render a scene standalone, the producer reuses the real
index.htmlshell and isolates the matching mount (extractStandaloneEntryFromIndex→createStandaloneEntryRenderClone). It shallow-clones the master root and hangs only the scene's mount under it — but the shallow clone keeps the master'sdata-duration, so the extracted composition advertises the project length. The compiler reads that root duration verbatim.Fix
Re-point the extracted wrapper's
data-durationat the scene's own, read from the scene file's<template>root (the source of truth for that scene), with a fallback to the mount'sdata-duration. Full-project renders never take the extraction branch, so they're unaffected.Verification
End-to-end via the pre-capture duration gate on a 3-scene project (master 12s; scene1 2s; scene2 10s):
-c scene1(own 2s)-c scene2(own 10s)index.html(master)Adds unit coverage for both the scene-file and mount-fallback paths.