Repository navigation
Animations: Anvil, the Keynote-style entrance - #1045
SimonGadgeteer wants to merge 1 commit into
Conversation
The shape free-falls from above the slide, squashes on landing with its base kept on the ground, then springs back while a puff of dust billows out sideways. It sits in the ribbon's quick gallery next to Zoom. - anim: "anvil" entrance (gravity drop, squash that rings out) and a new AnimState::dust progress, composed as the larger puff - render: ShapeState::dust draws soft radial-gradient clouds at the base of the shape's box (deterministic, no filters) - pptx: PowerPoint has no Anvil, so it is written as preset 1001 with behaviours PowerPoint can play: the drop as ppt_y key times and an animScale squash with autoRev; DeckCraft reads 1001 back as Anvil - docs: animation-parity (beyond PowerPoint, not scored) and ROADMAP log Tests: anvil_drops_from_above_squashes_and_puffs_dust; the existing every_animation_evaluates_finite and every_animation_effect_survives cover it too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
eliets2
left a comment
There was a problem hiding this comment.
First-pass review notes (automated; combined from specialist angles: tests). Please treat as suggestions and verify before acting.
What it does: Adds Anvil, a Keynote-style entrance animation where a shape free-falls from above the slide, squashes on landing with its base staying on the ground, springs back, and kicks up a dust puff at its base. It is added to the Animations ribbon quick gallery, full gallery, and animation.list, with a PowerPoint-compatible drop and squash exported using preset id 1001 and no dust in PowerPoint.
Logical units:
- anim:
anvilentrance ineffects.rs/lib.rs, newAnimState::dustwith clamping insanitizedand larger-puff-wins incompose - render:
ShapeState::dustanddust_puff()drawing deterministic radial-gradient clouds at the base of the possibly rotated box, passed through preview and slide show - pptx: preset id 1001 in the catalogue and writer in
write/timing.rsemittingppt_ykey times for the drop andanimScalesquash withautoRev, read back as Anvil - docs:
animation-parity.md"Beyond PowerPoint" note and revision row, andROADMAP.mdprogress-log row
Findings:
- [tests]
crates/anim/src/lib.rs,AnimState::sanitizedandAnimState::compose: dust clamping to 0..1, non-finite dust replaced with 0, and larger-puff-wins composition have no test. Add unit tests for out-of-range, NaN/infinite, and composed dust values. - [tests]
crates/pptx/src/write/timing.rs,anvil(): no test asserts the emittedppt_ykey times, the 45% landing time, theanimScalesquash withautoRev, or preset id 1001. Add a writer test parsing the generated timing XML for those values. - [tests]
crates/render/src/lib.rs,dust_puff(): no render test covers the new drawing code, including deterministic output for the same input, rotated boxes, and guards for non-finite or non-positive width/height. Add a render test comparing two renders of the same dust state and cases with rotated and degenerate boxes. - [tests]
crates/anim/src/effects.rs,"anvil"branch: the!exitcondition for dust is untested, so an exit animation using the same code path could incorrectly produce dust. Add a test evaluating Anvil as an exit and asserting dust stays 0. - [tests]
crates/anim/src/tests.rs,anvil_drops_from_above_squashes_and_puffs_dust: the test checks dust only at one drop time and one landing time, and does not check that dust returns to 0 before the end or that scale and offset return to identity during the squash phase. Add assertions at several times in the squash phase and just before the end. - [tests]
crates/anim/src/lib.rs,AnimStateserde: the#[serde(default)]ondustfor loading older files without the field is untested. Add a deserialization test for JSON withoutdustasserting it loads as 0.
Overlaps: None listed.
Verdict: Needs changes. The 3 most important points are: add tests for dust clamping and composition in sanitized/compose; add a writer test for the Anvil-specific ppt_y key times, 45% landing, animScale with autoRev, and preset id 1001; add render tests for dust_puff() covering determinism, rotated boxes, and degenerate boxes.
What
A new entrance effect, Anvil, the one Keynote users know and miss in PowerPoint. The shape
free-falls from above the slide, squashes on landing (its base stays on the ground), springs back,
and kicks up a puff of dust that billows out sideways. It's in the Animations ribbon's quick gallery
next to Zoom, and in the full gallery and
animation.list, like any other entrance.How
effects.rs,lib.rs): theanvilentrance. A gravity drop (distance ∝ t²) over thefirst 45 % of the effect, then a squash that rings out (
scale_ydown,scale_xup, offset sothe base stays put). New
AnimState::dust(0..1 puff progress,#[serde(default)]);composekeeps the larger puff, and
sanitizedclamps it.lib.rs):ShapeState::dustdraws soft radial-gradient clouds at the base of theshape's (possibly rotated) box. It's deterministic, so every frame and export of a moment match,
and it uses no filters. Preview and slide show pass
dustthrough.write/timing.rs): PowerPoint has no Anvil, so the catalogue gives it preset id1001 (outside PowerPoint's range) and the writer emits behaviours PowerPoint can play: the
drop as
ppt_ykey times and ananimScalesquash withautoRev. There's no dust in PowerPoint.DeckCraft reads 1001 back as Anvil, with no reader change.
animation-parity.mdgets a "Beyond PowerPoint" note (not counted in the parityscores) and a revision row, and
ROADMAP.mdgets a progress-log row.No new assets, and nothing taken from Keynote: the effect is drawn in code.
Tests
anvil_drops_from_above_squashes_and_puffs_dustchecks that the shape starts above theslide and accelerates, that it squashes on landing with the base on the ground, that dust appears
only after landing, and that the end state is identity.
every_animation_evaluates_finiteandevery_animation_effect_survives(PPTX round trip).cargo xtask ci: fmt, pdf-deps and clippy pass.cargo test --workspacehas one failure,replacefonts_tests::ribbon_button_opens_the_dialog_and_replaces, which fails onmainwithoutthis change too.
control_server::tests::a_line_that_is_not_a_request_closes_the_connectionfailed once under full CI and passes on rerun, so it looks timing-dependent.
.pptx/.deckcraft save and reopen.
🤖 Generated with Claude Code
Summary by CodeRabbit