Repository navigation
chore: add a CSS animation callbacks example - #10072
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughAdds an ChangesAnimation callbacks example
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
Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
b7cf428 to
5b9b28c
Compare
5b9b28c to
9274a5a
Compare
9274a5a to
ab07a04
Compare
ab07a04 to
880a804
Compare
880a804 to
c45580b
Compare
c45580b to
76b6fd0
Compare
76b6fd0 to
aae81c9
Compare
aae81c9 to
a5ed854
Compare
a5ed854 to
d956cf4
Compare
d956cf4 to
d1abfe7
Compare
d1abfe7 to
4ca4c34
Compare
4ca4c34 to
3a4cf2e
Compare
3a4cf2e to
5dc5fd5
Compare
9d902aa to
61636e6
Compare
61636e6 to
22d859d
Compare
22d859d to
0c3e02d
Compare
0c3e02d to
af43211
Compare
955e8f9 to
19c603c
Compare
74c34b0 to
5d32d03
Compare
5d32d03 to
5e3f6f1
Compare
There was a problem hiding this comment.
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
📒 Files selected for processing (3)
apps/common-app/src/apps/css/examples/animations/routes/index.tsapps/common-app/src/apps/css/examples/animations/screens/miscellaneous/AnimationCallbacks.tsxapps/common-app/src/apps/css/examples/animations/screens/miscellaneous/index.ts
tjzel
left a comment
There was a problem hiding this comment.
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.
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.