feat(engine): wire stagger for container children#31
Merged
Conversation
The stagger field on flex/grid/card/container was documented and parsed but connected to nothing. Now: - effective_effects() (shared helper) folds style.animation, timeline steps (at-shifted) and the accumulated container-stagger delay into one effect list, with a borrow fast path when nothing merges - build_child threads index*stagger (cumulative across nesting) into the CSS override resolution, shifts start_at/end_at windows by the same amount, and records per-node delays in BuiltScene.stagger_delays - LegacyPaintDispatcher::for_scene() carries those delays so internal animations (draw_progress, char_*) shift identically, and finally feeds PaintCtx.stagger_offset (was hardcoded 0.0); this also closes the gap where timeline steps never reached internal animations
This was referenced Jul 18, 2026
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 free
to 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 #20.
Goal:
staggeron flex/grid/card/container appliesindex * staggerto each child's animations — the schema field existed (and was documented in the skill rules) but was wired to nothing.effective_effects()helper:style.animation+ timeline steps (shifted byat) + accumulated stagger delay, with a zero-copy fast path when nothing mergesstart_at/end_atwindows so hard-cut children stay in step with their staggered siblingsBuiltScenerecords per-node delays; the newLegacyPaintDispatcher::for_scene()consumes them so internal animations (draw_progress, char presets) shift exactly like the CSS overrides, andPaintCtx.stagger_offsetis finally fed (was hardcoded 0.0)Test: pixel regression — flex
stagger: 0.2, three fading children at t=0.25: first fully lit, second partially faded, third with zero pixels. Written red first (it failed with all three fully lit). 139 total, all green.Verify:
cargo test --workspace✓ ·cargo fmt --check✓ · clippy 0 warnings ✓