Skip to content

fix(engine): honor start_at/end_at visibility windows and wire timeline steps - #27

Merged
LeadcodeDev merged 1 commit into
mainfrom
fix/engine-timing-semantics
Jul 18, 2026
Merged

fix(engine): honor start_at/end_at visibility windows and wire timeline steps#27
LeadcodeDev merged 1 commit into
mainfrom
fix/engine-timing-semantics

Conversation

@LeadcodeDev

Copy link
Copy Markdown
Owner

Closes #5. Closes #6. Closes #7.

Goal: the timing schema stops lying — start_at/end_at gate painting for every component, timeline steps actually trigger animations, Caption/Positioned join the dispatch.

  • BoxNode gains a PaintWindow (from as_timed()); paint_node returns early outside [start_at, end_at) — subtree included, no hits recorded — while the node keeps its layout space (CSS visibility semantics, matching legacy counter behavior; siblings must not jump)
  • timeline: [{at, animation[]}] resolves as the step's animations with delay += at, merged after style.animation (AnimationEffect::shift_delay; glow/wiggle/orbit/motion-blur have no delay concept and are documented no-ops)
  • Caption gets a flattened TimingConfig; Positioned gets timing + timeline + animation support; both wired into as_timed/as_animatable
  • Skill rule timeline-sequencing.md rewritten: start_at = visibility, animation delay = motion, timeline = grouped timed phases

Tests: 3 new pixel-level regression tests (start_at hides before window, end_at hides after, timeline fade_in animates in its window) — written red first. 133 total, all green.

Verify: cargo test --workspace ✓ · cargo fmt --check ✓ · clippy 0 warnings ✓

start_at/end_at were silently ignored by the box pipeline (only Particle
was gated, on a legacy path) and timeline was consumed nowhere.

- BoxNode carries a PaintWindow built from as_timed(); paint_node skips
  the node and its subtree outside [start_at, end_at) while keeping its
  layout space (CSS visibility semantics — siblings don't jump)
- timeline steps resolve as their animations with delay += step.at,
  merged after style.animation (new AnimationEffect::shift_delay;
  continuous effects without a delay concept are unaffected)
- Caption gains flattened TimingConfig; Positioned gains timing,
  timeline and animation support; both join the timed/animatable
  dispatch (the last two components excluded from it)
- skill rule timeline-sequencing.md rewritten for the new semantics
@LeadcodeDev
LeadcodeDev merged commit 74111ab into main Jul 18, 2026
@LeadcodeDev
LeadcodeDev deleted the fix/engine-timing-semantics branch July 18, 2026 19:19
LeadcodeDev added a commit that referenced this pull request Aug 9, 2026
)

Eight confirmed audit findings. Six of them are dead knobs: a field the
author sets, the schema accepts, `validate` calls clean, and the engine
ignores. Nobody gets an error; the video simply lacks the animation that was
asked for. For a tool driven by generated JSON that is the worst failure
mode there is, because the correction loop never closes.

- `float_3d`'s `amplitude` never reached `PresetConfig`: `AnimationTiming`
  had no such field and the only converter wrote `None`. Every `float_3d`
  moved by the 12px default, so the documented parallax recipe produced no
  parallax. Measured: 60 requested, -12 delivered.
- `pulse` / `float` / `shake` / `spin` built keyframes at the literal times
  0.0 / 0.25 / 0.5 / 1.0 and never read `delay` or `duration`. With
  `delay: 1.0`, all four were already mid-animation at t=0.5s.
- `"loop": true` was inert on keyframe effects and `tilt_in`: the resolver
  was handed `None` for the preset config, fell back to `repeat: false`,
  and never called `loop_time`.
- `--strict-anim` resolved effects at global scene time while the engine
  resolves at remapped local time, so it flagged violations at instants
  that are never rendered — and missed real ones. It now reads the
  `time_params` the builder already computes.
- The completion budget added `start_at` to `delay + duration`, which the
  engine does not do: since PR #27 `start_at` gates visibility only and
  `delay` is absolute scene time. A 1s animation at `start_at: 1.5` in a 2s
  scene was reported as overrunning.
- Two keyframe animations on the same property summed or overwrote each
  other depending on whether one carried a `delay` — a field with nothing
  to do with composition, routing effects into two separately-resolved
  buckets. Now a single bucket with one rule: last declared wins, the CSS
  cascade rule, which was already the behaviour within a bucket.
- The spring solver returned NaN for `mass: 0` or `stiffness: 0` and
  diverged on negative damping, with no validation anywhere. A NaN reaching
  layout contaminates the whole tree. Both ends are handled: the solver
  floors its inputs, and `validate` now rejects the configs outright.
- Unknown keys inside `style.animation[*]` were never reported.

That last one has a deliberate consequence worth stating: `deny_unknown_fields`
on the nine effect-config structs means a typo now fails deserialization, and
`deserialize_children` skips a child it cannot parse. A misspelled key stops
producing a default-valued animation and starts removing the component, with
a stderr warning. That is the same contract `CssStyle` has carried all along
— it is why `margin-top` drops a component — so this extends an existing
policy rather than inventing one, and `validate` catches it first.

Tests: full workspace green on this branch alone.
LeadcodeDev added a commit that referenced this pull request Aug 10, 2026
)

Eight confirmed audit findings. Six of them are dead knobs: a field the
author sets, the schema accepts, `validate` calls clean, and the engine
ignores. Nobody gets an error; the video simply lacks the animation that was
asked for. For a tool driven by generated JSON that is the worst failure
mode there is, because the correction loop never closes.

- `float_3d`'s `amplitude` never reached `PresetConfig`: `AnimationTiming`
  had no such field and the only converter wrote `None`. Every `float_3d`
  moved by the 12px default, so the documented parallax recipe produced no
  parallax. Measured: 60 requested, -12 delivered.
- `pulse` / `float` / `shake` / `spin` built keyframes at the literal times
  0.0 / 0.25 / 0.5 / 1.0 and never read `delay` or `duration`. With
  `delay: 1.0`, all four were already mid-animation at t=0.5s.
- `"loop": true` was inert on keyframe effects and `tilt_in`: the resolver
  was handed `None` for the preset config, fell back to `repeat: false`,
  and never called `loop_time`.
- `--strict-anim` resolved effects at global scene time while the engine
  resolves at remapped local time, so it flagged violations at instants
  that are never rendered — and missed real ones. It now reads the
  `time_params` the builder already computes.
- The completion budget added `start_at` to `delay + duration`, which the
  engine does not do: since PR #27 `start_at` gates visibility only and
  `delay` is absolute scene time. A 1s animation at `start_at: 1.5` in a 2s
  scene was reported as overrunning.
- Two keyframe animations on the same property summed or overwrote each
  other depending on whether one carried a `delay` — a field with nothing
  to do with composition, routing effects into two separately-resolved
  buckets. Now a single bucket with one rule: last declared wins, the CSS
  cascade rule, which was already the behaviour within a bucket.
- The spring solver returned NaN for `mass: 0` or `stiffness: 0` and
  diverged on negative damping, with no validation anywhere. A NaN reaching
  layout contaminates the whole tree. Both ends are handled: the solver
  floors its inputs, and `validate` now rejects the configs outright.
- Unknown keys inside `style.animation[*]` were never reported.

That last one has a deliberate consequence worth stating: `deny_unknown_fields`
on the nine effect-config structs means a typo now fails deserialization, and
`deserialize_children` skips a child it cannot parse. A misspelled key stops
producing a default-valued animation and starts removing the component, with
a stderr warning. That is the same contract `CssStyle` has carried all along
— it is why `margin-top` drops a component — so this extends an existing
policy rather than inventing one, and `validate` catches it first.

Tests: full workspace green on this branch alone.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant