Skip to content

fix(registry): register device timeline synchronously - #2546

Merged
miga-heygen merged 1 commit into
heygen-com:mainfrom
tianma-if:codex/vfx-iphone-sync-timeline
Jul 28, 2026
Merged

miga-heygen merged 1 commit into
heygen-com:mainfrom
tianma-if:codex/vfx-iphone-sync-timeline

Conversation

@tianma-if

Copy link
Copy Markdown
Contributor

Summary

  • register the vfx-iphone-device paused timeline synchronously
  • keep model readiness limited to screen capture setup
  • remove the double requestAnimationFrame gate from composition startup

Why

The block previously exposed window.__timelines["devices-canvas"] only after both GLTF models loaded and two animation frames elapsed. That violates the synchronous timeline contract and can make renderers wait for the sub-composition polling timeout.

Fixes the device-timeline portion of #2107.

Validation

  • bunx oxfmt registry/blocks/vfx-iphone-device/vfx-iphone-device.html
  • direct lintHyperframeHtml: 0 errors (2 existing tween-overlap warnings)
  • npx hyperframes check against a temporary project copy: Runtime 0 errors, Motion 0 errors; the overall command remains non-zero because the existing hidden screen-texture DOM triggers 18 layout occlusion findings unrelated to this change

@miga-heygen miga-heygen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SSOT — determinism contract violation fixed

Clean fix. The timeline registration was deferred behind a double requestAnimationFrame inside onReady(), violating the synchronous timeline contract (determinism-rules.md: "Build timelines synchronously at page load"). The renderer's sub-composition poll could time out waiting for a timeline that only appeared after two animation frames — frames that headless Chrome may never fire reliably.

Verified

  • Timeline still paused: true ✓
  • Registration now synchronous (inline script, right after tl = gsap.timeline(...)) ✓
  • onReady() retains only model-readiness concerns (paintReady, captureScreens()) — good separation of framework contract vs composition state ✓
  • Stale comments removed ✓
  • All 40 CI checks green ✓

No issues found. Ship it.

— Miga

@miga-heygen
miga-heygen merged commit 2bb6205 into heygen-com:main Jul 28, 2026
40 checks passed
dahans-msft2 pushed a commit to dahans-msft2/hyperframes that referenced this pull request Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants