Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Preview: tl.set holds never render when the root timeline has zero duration

未关闭
#4,519 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

  • #4521 来自 @Harlan66 —— 已关闭,未合并

评估

难度
3/5
预计耗时
1-2 天
新手友好度
76/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
html, typescript
领域
tooling, web-dev

调研方向

Start in packages/core/src/runtime/init.ts and compare the createDurationFloorTimeline path with ensureChildCandidatesActive. Reproduce the supplied static tl.set example or a Studio resize, then verify that preview renders #box at 200×150 at any playhead position while snapshot behavior remains correct.

由索引模型根据 Issue 内容生成。

描述

Describe the bug

A root timeline whose own duration is 0 — e.g. one that only holds tl.set(...) at position 0, which is exactly what Studio writes for a static resize — never renders its sets in the preview. After resizing an element in Studio the file is correct, but the element snaps back to its authored size in the preview (keeping the drag offset), so it looks like the resize was lost.

Cause: in packages/core/src/runtime/init.ts, an unusable (zero) root duration takes the createDurationFloorTimeline fallback: the root timeline is added to a new paused wrapper padded to the composition duration. The author's root was created gsap.timeline({ paused: true }) and stays paused, and a paused child is never rendered when its parent is seeked. The nested-composition path already unpauses held children (ensureChildCandidatesActive); the floor wrapper does not.

Minimal reproduction
<div id="root" data-composition-id="main" data-start="0" data-duration="2" data-width="1920" data-height="1080">
  <div id="box" class="clip" data-start="0" data-duration="2" data-track-index="1"
       style="position:absolute; left:100px; top:100px; width:400px; height:300px; background:tomato"></div>
</div>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/gsap.min.js"></script>
<script>
  window.__timelines = window.__timelines || {};
  const tl = gsap.timeline({ paused: true });
  tl.set("#box", { width: 200, height: 150 }, 0);
  window.__timelines["main"] = tl;
</script>
Steps to reproduce
  1. npx hyperframes preview on the composition above (or produce it by resizing an element in Studio in a composition without tweens).
  2. Look at #box at any playhead position.
Expected behavior

#box renders at 200×150.

Actual behavior

#box stays at 400×300. In the preview iframe, __timelines.main.paused() is true, its children are never initialised, and __player.seek(t) has no effect on it. After __timelines.main.paused(false), __player.seek(0.5) renders 200×150. A single tween in the timeline (non-zero duration) avoids the fallback and the bug. hyperframes snapshot --at 0.5 of the same file renders 200×150 correctly, so only the preview runtime is affected.

Environment

hyperframes CLI 0.8.77 (also on main @ 0985b45), GSAP 3.12.5 and 3.15.0, macOS, Chrome (headed and headless).

Additional context

Fix PR to follow: unpause the root timeline once the floor wrapper actually holds it, mirroring ensureChildCandidatesActive.

主要语言
TypeScript
星标
54.1k
派生
4.9k
平均合并
7 小时 21 分钟
30 天内合并 PR
722

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

heygen-com/hyperframes 的其他 Issue

查看 heygen-com/hyperframes 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。