Skip to content

Animations: Anvil, the Keynote-style entrance - #1045

Open
SimonGadgeteer wants to merge 1 commit into
storytold:mainfrom
SimonGadgeteer:feat/anvil-animation
Open

SimonGadgeteer wants to merge 1 commit into
storytold:mainfrom
SimonGadgeteer:feat/anvil-animation

Conversation

@SimonGadgeteer

@SimonGadgeteer SimonGadgeteer commented Oct 19, 2026 •

Copy link
Copy Markdown

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

  • anim (effects.rs, lib.rs): the anvil entrance. A gravity drop (distance ∝ t²) over the
    first 45 % of the effect, then a squash that rings out (scale_y down, scale_x up, offset so
    the base stays put). New AnimState::dust (0..1 puff progress, #[serde(default)]); compose
    keeps the larger puff, and sanitized clamps it.
  • render (lib.rs): ShapeState::dust draws soft radial-gradient clouds at the base of the
    shape'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 dust through.
  • pptx (write/timing.rs): PowerPoint has no Anvil, so the catalogue gives it preset id
    1001 (outside PowerPoint's range) and the writer emits behaviours PowerPoint can play: the
    drop as ppt_y key times and an animScale squash with autoRev. There's no dust in PowerPoint.
    DeckCraft reads 1001 back as Anvil, with no reader change.
  • docs: animation-parity.md gets a "Beyond PowerPoint" note (not counted in the parity
    scores) and a revision row, and ROADMAP.md gets a progress-log row.

No new assets, and nothing taken from Keynote: the effect is drawn in code.

Tests

  • New: anvil_drops_from_above_squashes_and_puffs_dust checks that the shape starts above the
    slide 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.
  • Existing tests that now cover Anvil: every_animation_evaluates_finite and
    every_animation_effect_survives (PPTX round trip).
  • cargo xtask ci: fmt, pdf-deps and clippy pass. cargo test --workspace has one failure,
    replacefonts_tests::ribbon_button_opens_the_dialog_and_replaces, which fails on main without
    this change too. control_server::tests::a_line_that_is_not_a_request_closes_the_connection
    failed once under full CI and passes on rerun, so it looks timing-dependent.
  • Checked by hand: frames rendered at 0.05 s steps, a canvas preview in the app, and a
    .pptx/.deckcraft save and reopen.
  • Not checked: how PowerPoint itself plays the exported drop and squash (no PowerPoint run yet).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added the Anvil entrance animation to the quick animation gallery. Shapes drop in from above, squash on landing, and create a dust puff.
    • Anvil animations are saved in PowerPoint-compatible presentations with a drop and squash effect, and reopen as Anvil in DeckCraft. The dust puff is visible in DeckCraft but is not included in the PowerPoint animation.

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>
@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9de30867-757b-4555-9a33-c84cb2f58ed8
📥 Commits

Reviewing files that changed from the base of the PR and between f34f412 and 60c30df.

📒 Files selected for processing: 11
  • ROADMAP.md
  • crates/anim/src/effects.rs
  • crates/anim/src/lib.rs
  • crates/anim/src/tests.rs
  • crates/model/src/anim.rs
  • crates/pptx/src/write/timing.rs
  • crates/render/src/lib.rs
  • crates/ui-egui/src/preview.rs
  • crates/ui-egui/src/ribbon.rs
  • crates/ui-egui/src/show.rs
  • docs/animation-parity.md

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

📝 Walkthrough

The Anvil entrance effect drops from above the slide, squashes on landing, and emits dust during its post-impact phase. It is available in the quick gallery, renders dust in the UI, and writes a PowerPoint-compatible drop and squash animation under preset ID 1001.

Changes: Anvil entrance animation

Layer / File(s) Summary
Effect state and gallery entry
crates/anim/src/lib.rs, crates/anim/src/effects.rs, crates/model/src/anim.rs, crates/anim/src/tests.rs, crates/ui-egui/src/ribbon.rs, ROADMAP.md
AnimState now carries sanitized and composed dust progress. The Anvil entrance effect, preset ID 1001, quick-gallery entry, and effect test are added.
Dust rendering
crates/render/src/lib.rs, crates/ui-egui/src/preview.rs, crates/ui-egui/src/show.rs
The UI passes dust progress into ShapeState. The renderer draws a deterministic dust puff for progress values strictly between 0 and 1.
PPTX timing and parity documentation
crates/pptx/src/write/timing.rs, docs/animation-parity.md
The timing writer adds sampled drop-position keys and a delayed squash animation. The parity documentation describes the preset’s PPTX representation and its Anvil identifier.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant AnimState
  participant shape_state
  participant state_for
  participant ShapeState
  participant dust_puff
  AnimState->>shape_state: supply timeline dust progress
  AnimState->>state_for: supply animation dust progress
  shape_state->>ShapeState: copy dust progress
  state_for->>ShapeState: copy dust progress
  ShapeState->>dust_puff: draw puff when progress is between 0 and 1
Loading

Suggested reviewers: nikitkara, echelon

Merge Risk: ⚪ Minimal · up to 60c30

No actionable issue remains from this review; the change is mergeable after normal checks.

Security architecture risk: 🔵 Low · up to 60c30

The new effect adds bounded visual processing and a custom presentation-export identifier. No new privilege or data-access path was identified. Compatibility with external consumers and third-party playback remains unverified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — A document author can select the new preset and thereby reach an additional visual-processing and export path. The inspected additions act on the target shape’s geometry and generated timing values; they introduce no credential, network, filesystem, or tool-execution authority. The established exposure is the rendered presentation and its exported animation representation, not a demonstrated cross-tenant or privileged-system path.

Trust Boundaries and Controls

  • observed — Hidden, skipped, invisible, or nearly transparent shapes return before dust rendering. For remaining shapes, dust is anchored to the unanimated box and drawn after the shape’s partial-opacity and reveal-clip layer is removed. The helper generates fixed-colour clouds without sampling shape content. This establishes a visual-composition difference, not a verified confidentiality or authorization bypass.

Resilience and Maintainability Implications

  • inferred — Dust adds no independently owned persistent resource or cleanup transaction. Fresh state composition, current-time repeat calculations, and neutral terminal state prevent a prior puff from being retained after completion or a later query. This supports failure containment across interrupted or repeated evaluation, although dedicated interruption and repetition tests were not established.
Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 45.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 20 functions across 9 files. (2 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly identifies the main change: adding the Anvil entrance animation. It is specific, concise, and related to the pull request.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 45.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 20 functions across 9 files. (2 skipped: 2 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@eliets2 eliets2 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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: anvil entrance in effects.rs/lib.rs, new AnimState::dust with clamping in sanitized and larger-puff-wins in compose
  • render: ShapeState::dust and dust_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.rs emitting ppt_y key times for the drop and animScale squash with autoRev, read back as Anvil
  • docs: animation-parity.md "Beyond PowerPoint" note and revision row, and ROADMAP.md progress-log row

Findings:

  • [tests] crates/anim/src/lib.rs, AnimState::sanitized and AnimState::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 emitted ppt_y key times, the 45% landing time, the animScale squash with autoRev, 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 !exit condition 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, AnimState serde: the #[serde(default)] on dust for loading older files without the field is untested. Add a deserialization test for JSON without dust asserting 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.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants