fix(engine): honor start_at/end_at visibility windows and wire timeline steps - #27
Merged
Merged
Conversation
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
This was referenced Jul 18, 2026
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.
LeadcodeDev added a commit
that referenced
this pull request
Aug 11, 2026
…ver render (#172) Two follow-ups the previous changes made possible but deliberately left out of their own scope, since both alter what `validate` does to a user's file. **`--fix` answers `ContentOverflowsBox` on text.** That arm did nothing because growing the box, shrinking the font and shortening the copy are all legitimate and produce different results — picking one was not the validator's call. `style.text-autofit` (#170) removed the dilemma: it states the author's intent without touching the declared box or the content, so nothing written by hand is overwritten. Same risk category as the two fixes already accepted, both of which also change the render. Scoped to `text`/`gradient_text`, the two components whose painters implement the field. Writing it anywhere else would be a no-op an author could reasonably read as a fix, which is worse than leaving the violation visible — a test pins that a `table` is left alone and nothing is claimed as applied. **`--strict-anim` stops at `freeze_at`.** Since #164 every render path clamps there, so samples beyond it evaluate transforms at instants the video cannot contain. It was reporting violations that cannot happen, which blocks a correct scenario and sends a generator "fixing" what was never wrong. Bounding the sample list rather than clamping each timestamp afterwards also avoids generating a run of identical post-freeze samples. `scene_duration` still reaches `BuildAnimationCtx` unchanged, so duration-relative effects keep their real window (contract from PR #27) — only the sampling ceiling moves. The mirror test matters as much as the new one: the same fixture without a freeze must still be caught, or the bound would be silencing real overflow instead of removing an unreachable sample.
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 freeto 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.
Closes#5. Closes#6. Closes#7.
Goal: the timing schema stops lying —
start_at/end_atgate painting for every component,timelinesteps actually trigger animations, Caption/Positioned join the dispatch.BoxNodegains aPaintWindow(fromas_timed());paint_nodereturns early outside[start_at, end_at)— subtree included, no hits recorded — while the node keeps its layout space (CSSvisibilitysemantics, matching legacy counter behavior; siblings must not jump)timeline: [{at, animation[]}]resolves as the step's animations withdelay += at, merged afterstyle.animation(AnimationEffect::shift_delay; glow/wiggle/orbit/motion-blur have no delay concept and are documented no-ops)TimingConfig; Positioned getstiming+timeline+ animation support; both wired intoas_timed/as_animatabletimeline-sequencing.mdrewritten: start_at = visibility, animation delay = motion, timeline = grouped timed phasesTests: 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 ✓