Repository navigation
Description
Describe the bug
In preview, a layer whose first tween is a deferred autoAlpha cut (fromTo(el, { autoAlpha: 1 }, { autoAlpha: 0, immediateRender: false }, T)) is missing from the start of its scene. Render shows it. This happens when the page has an <audio>/<video> and any tween targets an object with a property setter, such as a count-up through { get v(), set v() }.
Minimal reproduction
https://github.com/ArcadeHQ/hyperframes-repros/tree/patch/volume-probe-autoalpha
Steps to reproduce
git checkout patch/volume-probe-autoalphanpx hyperframes@0.9.13 check(passes)npx hyperframes@0.9.13 preview, then scrub to 6.5s.npx hyperframes@0.9.13 render --quality draft -o renders/render.mp4, then look at the frame at 6.5s.
Expected behavior
The yellow box in compositions/scene3.html shows from 6s to 7.5s, in preview and in render.
Actual behavior
Render shows the box at 6.5s. Preview never shows it. At 6.5s it carries inline opacity: 0; visibility: hidden.
Preview matches render if you do either of these:
- Drive the count-up with
onUpdateon a plain object instead of a setter. - Remove the
<audio>.
Environment
hyperframes 0.9.13 (latest), Node 25.6.1, macOS arm64 (Apple M2 Max), chrome-headless-shell 152.0.7977.30, GSAP 3.14.2.
Additional context
With a media element on the page, the preview runtime samples the element's volume automation by seeking the live root timeline through its window (probeAndCacheElementVolume, packages/core/src/runtime/mediaVolumeEnvelope.ts). volumeMoversOf skips that sweep only when it can rule out a volume change. A tween on any object with a setter counts as a possible volume change.
The sweep runs before the first visibility pass. At that point the until-first-pass sheet ([data-start]:not(video, audio, img) { visibility: hidden !important }) hides every clip. The sweep is the box's tween's first render, so GSAP records the inherited hidden as the value to restore, and every later seek before T writes it back. Render skips the sweep (allowLiveTimelineSeek: !__HF_RENDER_CAPTURE_MODE), so render is right.
#5690 fixed this pattern for jump seeks with showHiddenClips(), but the volume probe doesn't use it. A fix that works in our fork:
- Wrap the probe's sweep and its restore seek in
showHiddenClips(). - Have
showHiddenClips()also detach the until-first-pass sheet, and restore it unless the first pass has lifted it in the meantime.
It has a jsdom test that fails without the fix and passes with it, and the full packages/core/src/runtime suite passes. Happy to open a PR if that's useful.
Activity
fix(core): trim added comments tripping the comment ratchet (heygen-c…