Skip to content

chore: add a CSS animation callbacks example - #10072

Merged
MatiPl01 merged 4 commits into
mainfrom
@matipl01/css-animation-callbacks-example
Aug 13, 2026
Merged

MatiPl01 merged 4 commits into
mainfrom
@matipl01/css-animation-callbacks-example

Conversation

@MatiPl01

@MatiPl01 MatiPl01 commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

Adds a screen under CSS > Animations > Miscellaneous that attaches all four animation callbacks and logs each event with its elapsedTime, so the timings can be checked against the spec.

Covers the cases that are easy to get wrong: a finite animation with a delay, an infinite one that never ends, and interrupting one mid-flight. The unmount button stays silent until #10255 lands, which is what makes that cancel reach the callback.

Stacked on #10071.

@coderabbitai

coderabbitai Bot commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 7d4ae335-6043-4299-a4fe-5a0d5ca2a703

📥 Commits

Reviewing files that changed from the base of the PR and between 8b8a522 and a86fc14.

📒 Files selected for processing (1)
  • apps/common-app/src/apps/css/examples/animations/screens/miscellaneous/AnimationCallbacks.tsx

📝 Walkthrough

Summary by CodeRabbit

  • New Features
    • Added an Animation Callbacks example to the CSS animations showcase.
    • Demonstrates finite and repeating animations with start, iteration, completion, and cancellation events.
    • Includes controls to restart, cancel, unmount, and clear the event log.
    • Displays elapsed callback times alongside an animated preview.

Walkthrough

Adds an AnimationCallbacks screen that demonstrates CSS animation lifecycle callbacks. Registers the screen in the miscellaneous animation collection and exposes it through the animation examples route.

Changes

Animation callbacks example

Layer / File(s) Summary
Animation callback demo and registration
apps/common-app/src/apps/css/examples/animations/screens/miscellaneous/AnimationCallbacks.tsx, apps/common-app/src/apps/css/examples/animations/screens/miscellaneous/index.ts, apps/common-app/src/apps/css/examples/animations/routes/index.ts
The new screen supports finite and infinite animations, cancellation, unmounting, restarting, event-log clearing, and elapsed-time callback logging. The screen is added to the miscellaneous animation registry and route list.

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

Sequence Diagram(s)

sequenceDiagram
  participant AnimationCallbacks
  participant CSSKeyframesAnimation
  participant EventLog
  AnimationCallbacks->>CSSKeyframesAnimation: Start, restart, or cancel animation
  CSSKeyframesAnimation-->>AnimationCallbacks: Emit lifecycle callback
  AnimationCallbacks->>EventLog: Record event and elapsed time
Loading

Possibly related PRs

Suggested labels: lib: Reanimated

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly and concisely identifies the addition of a CSS animation callbacks example.
Description check ✅ Passed The description accurately explains the new screen, callback logging, elapsed-time checks, and covered animation cases.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch @matipl01/css-animation-callbacks-example

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@MatiPl01 MatiPl01 self-assigned this Jul 27, 2026
@MatiPl01
MatiPl01 force-pushed the @matipl01/css-animation-callbacks-example branch from b7cf428 to 5b9b28c Compare July 27, 2026 13:28
@MatiPl01
MatiPl01 force-pushed the @matipl01/css-animation-callbacks-example branch from 5b9b28c to 9274a5a Compare July 27, 2026 14:02
@MatiPl01
MatiPl01 force-pushed the @matipl01/css-animation-callbacks-example branch from 9274a5a to ab07a04 Compare July 27, 2026 14:31
@MatiPl01
MatiPl01 force-pushed the @matipl01/css-animation-callbacks-example branch from ab07a04 to 880a804 Compare July 27, 2026 14:43
@MatiPl01
MatiPl01 force-pushed the @matipl01/css-animation-callbacks-example branch from 880a804 to c45580b Compare July 27, 2026 14:46
@MatiPl01
MatiPl01 force-pushed the @matipl01/css-animation-callbacks-example branch from c45580b to 76b6fd0 Compare July 28, 2026 07:07
@MatiPl01
MatiPl01 force-pushed the @matipl01/css-animation-callbacks-example branch from 76b6fd0 to aae81c9 Compare July 28, 2026 09:05
@MatiPl01
MatiPl01 force-pushed the @matipl01/css-animation-callbacks-example branch from aae81c9 to a5ed854 Compare July 30, 2026 09:23
@MatiPl01
MatiPl01 force-pushed the @matipl01/css-animation-callbacks-example branch from a5ed854 to d956cf4 Compare July 30, 2026 09:33
@MatiPl01
MatiPl01 force-pushed the @matipl01/css-animation-callbacks-example branch from d956cf4 to d1abfe7 Compare July 30, 2026 18:56
@MatiPl01
MatiPl01 force-pushed the @matipl01/css-animation-callbacks-example branch from d1abfe7 to 4ca4c34 Compare July 30, 2026 19:04
@MatiPl01
MatiPl01 force-pushed the @matipl01/css-animation-callbacks-example branch from 4ca4c34 to 3a4cf2e Compare July 30, 2026 20:55
@MatiPl01
MatiPl01 force-pushed the @matipl01/css-animation-callbacks-example branch from 3a4cf2e to 5dc5fd5 Compare July 30, 2026 21:04
@MatiPl01
MatiPl01 force-pushed the @matipl01/css-animation-callbacks-example branch from 9d902aa to 61636e6 Compare July 31, 2026 11:15
@MatiPl01
MatiPl01 force-pushed the @matipl01/css-animation-callbacks-example branch from 61636e6 to 22d859d Compare July 31, 2026 12:11
@MatiPl01
MatiPl01 force-pushed the @matipl01/css-animation-callbacks-example branch from 22d859d to 0c3e02d Compare July 31, 2026 12:35
@MatiPl01
MatiPl01 force-pushed the @matipl01/css-animation-callbacks-example branch from 0c3e02d to af43211 Compare July 31, 2026 12:48
@MatiPl01
MatiPl01 force-pushed the @matipl01/css-animation-callbacks-example branch 2 times, most recently from 955e8f9 to 19c603c Compare July 31, 2026 13:34
@MatiPl01
MatiPl01 force-pushed the @matipl01/css-animation-callbacks-example branch 5 times, most recently from 74c34b0 to 5d32d03 Compare July 31, 2026 15:30
@MatiPl01
MatiPl01 force-pushed the @matipl01/css-animation-callbacks-example branch from 5d32d03 to 5e3f6f1 Compare July 31, 2026 18:00

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@apps/common-app/src/apps/css/examples/animations/screens/miscellaneous/AnimationCallbacks.tsx`:
- Around line 50-60: Update the restart flow around restart and the
Cancel/Unmount handlers to store the requestAnimationFrame handle, cancel any
pending frame before cancelling or unmounting, and clean it up when the screen
unmounts. Ensure the queued callback cannot restore animation properties after
cancellation.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 78c3c4aa-6668-4654-86b0-5e396560f147

📥 Commits

Reviewing files that changed from the base of the PR and between ad289d9 and 8b8a522.

📒 Files selected for processing (3)
  • apps/common-app/src/apps/css/examples/animations/routes/index.ts
  • apps/common-app/src/apps/css/examples/animations/screens/miscellaneous/AnimationCallbacks.tsx
  • apps/common-app/src/apps/css/examples/animations/screens/miscellaneous/index.ts

@tjzel tjzel left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

I wonder if we could also add ReJest tests for these callbacks - seems like easy win, not a heavy lift with smoking gun test.

Adds a screen under CSS > Animations > Miscellaneous that attaches all four
animation callbacks and logs each event with its elapsedTime, so the
timings can be checked by eye against the spec.

It covers the cases that are easy to get wrong: a finite animation with a
delay, an infinite one that never ends, interrupting an animation mid
flight, and unmounting mid flight.
Cancel and Unmount left the pending frame armed, so it re-attached the
animation and the cancel appeared to do nothing.
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