Skip to content

Animations: fix Darken and Desaturate preset ids and 14 default durations - #1467

Merged
h-a-n-a-s-h-i merged 1 commit into
storytold:mainfrom
Harrison-Booth:dc-anim-presets
Oct 30, 2026
Merged

h-a-n-a-s-h-i merged 1 commit into
storytold:mainfrom
Harrison-Booth:dc-anim-presets

Conversation

@Harrison-Booth

@Harrison-Booth Harrison-Booth commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Darken and Desaturate used the wrong preset ids, and 14 effects got a different default duration from PowerPoint's.

What changed

  • Darken is now preset 24 and Desaturate 25, as PowerPoint saves them. Before, Darken wrote 25 and Desaturate 35, and a PowerPoint file's Darken (24) was read as Pulse.
  • Both now write PowerPoint's relative HSL shift (animClr clrSpc="hsl" with by, lightness -25098 for Darken, saturation -70588 for Desaturate) on text, fill and line colour. Before, Darken wrote a colour change to accent 2 and Desaturate wrote a 110% scale.
  • Default durations now match PowerPoint's AddEffect defaults: Grow & Turn, Shrink & Turn, Expand, Contract 1 s; Box, Circle, Diamond (in and out) and Bold Flash 2 s; Spinner in and out and Object Color 0.5 s; Color Pulse 0.25 s.

Not changed

Transparency's default in PowerPoint is "until end of slide" (indefinite). The model has no value for that, so it stays at 0.5 s.

Checked

  • New tests: preset ids and the HSL XML for both effects (with a round trip), the 14 durations. The id and XML tests fail on main.
  • cargo test for deckcraft-pptx, deckcraft-anim and deckcraft-model passes. cargo fmt --check is clean.
  • Real PowerPoint 16.0 over COM, temporary presentation closed without saving: a DeckCraft-written file reads back as EffectType 73 (Darken) and 74 (Desaturate), Grow & Turn lasts 1 s and Box 2 s, and AddEffect gives the same defaults.
  • Not run: Windows or macOS builds beyond the above.

Summary by CodeRabbit

  • Bug Fixes
    • Darken and desaturate emphasis animations now apply color changes more consistently across text, fills, and lines, with improved compatibility when exporting to PowerPoint.
    • Corrected animation preset mappings for darken and desaturate effects.
    • Updated default durations for several entrance, emphasis, and exit animations.

… shift, and 14 effects get its default durations
@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 55e5ee5 and 1e84213.

Files selected for processing: 4
  • crates/model/src/anim.rs
  • crates/pptx/src/maps.rs
  • crates/pptx/src/write/timing.rs
  • crates/pptx/tests/it/roundtrip.rs

Limit details: You’ve used all 10 included reviews currently available.

Walkthrough

Animation preset IDs and default durations change. PPTX export now writes relative HSL color shifts for darken and desaturate. Tests check the mappings, exported XML, round-trip effect names, and expected default durations.

Changes: Animation presets and PPTX export

Layer / File(s) Summary
Animation preset IDs and default durations
crates/model/src/anim.rs, crates/pptx/tests/it/roundtrip.rs
Default durations change for several animation effects. The preset IDs for darken and desaturate change. Tests assert expected durations.
PPTX effect mappings and color shifts
crates/pptx/src/maps.rs, crates/pptx/src/write/timing.rs, crates/pptx/tests/it/roundtrip.rs
PPTX mappings use the updated preset IDs. Export writes relative HSL shifts for darken and desaturate. Tests check the XML attributes and round-trip effect names.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~15 minutes

Change: Bug fix

Suggested reviewers: echelon, aiongg

Merge Risk: Minimal · up to 1e842

No confirmed issue blocks merging. Playback of Darken and Desaturate on explicitly colored text has not been verified.

Security architecture risk: Minimal · up to 1e842

The changes correct animation metadata and color encoding without adding executable entrypoints or expanding access to data or services. No material security regression was identified in the reviewed paths.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The changed behavior affects animation interpretation and generated color timing for referenced presentation shapes. The new branch emits three fixed color-property behaviors per resolved effect; it does not introduce another asset target or an external execution destination.

Security Findings and Attack Paths

  • inferred — Document-supplied preset identifiers still pass through the existing timing reader and catalog mapper. The corrected identifiers select animation semantics, while the new export branch produces fixed XML color shifts. No new command-execution or privilege-bearing path was identified in this flow.

Trust Boundaries and Controls

  • observed — The new HSL path preserves existing shape/paragraph targeting and clamps behavior duration to 1–3,600,000 milliseconds. Its property names and HSL shift values are constants rather than document-supplied expressions.

Resilience and Maintainability Implications

  • observed — The added branch reads borrowed animation data and advances identifiers owned by the current timing-export call. It does not mutate the presentation model or introduce shared persistent state, reservations, or a new recovery transition.
Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surv… 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 and concisely identifies the main changes: fixing Darken and Desaturate preset IDs and updating 14 animation default durations.
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 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 4 functions across 4 files.

Resolution

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

Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Usage-based review receipt

  • Mode: Continue automatically
  • Reviewed files: 4
  • Waived: $1.00 (charged $0.00)
  • View usage details

Note

This review exceeded your plan’s limits and used usage-based reviews—free during trial, billed after paid activation unless disabled. Manage usage-based reviews.

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

@h-a-n-a-s-h-i
h-a-n-a-s-h-i merged commit 2153f8a into storytold:main Oct 30, 2026
1 check passed
@echelon

echelon commented Oct 30, 2026

Copy link
Copy Markdown
Member

Landed on main, thank you @Harrison-Booth for the contribution! If you haven't already, come join us on Discord: https://discord.gg/artcraft

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.

3 participants