fix: settle tooltip animation lifecycle #218
main fromtaren/tooltip-animation-lifecycle·merged by tannerlinsley Changes#
- Keep a tooltip's running exit when hide is requested again, instead of restarting it on every presentation frame.
- Cancel finished entry, movement, and exit animations so their fill effects stop affecting the tooltip.
- Ignore stale completion callbacks after interruption, disabled motion, or destruction.
- Document the existing resize policy requested in #182, with tests for both settings. The default still snaps on a real resize;
resize: trueanimates from the painted geometry.
Fixes #209. Resolves the documentation follow-up in #182. Thanks @toomingos for the reports and reproductions.
Verification#
pnpm validatepasses all 19 tasks, including 2,220 main-suite tests, typechecks, packed consumers, docs, and size gates.- Six tooltip lifecycle regression tests, including repeated hide and reentrant completion, plus two resize policy tests.
- Real Web Animations checks in Chromium, Firefox, and WebKit: repeated hide completes once and finished animations leave no attached effects.
- Seven interleaved Chromium trials against main: 1,000 repeated hide calls took a median 98.4 ms before and 0.5 ms after, creating 1,002 versus 2 animations. This measures the repeated-hide path, not whole-chart performance.
- Maintained example builds pass.
- All 151 measured bundles compared with main. Only the isolated motion SVG bundle changes: 0.002 kB smaller gzip, 0.022 kB smaller minified. No budget increases.
- All 188 catalog previews regenerated with identical visuals. Comparison measurements are unchanged; only source provenance is refreshed.
Includes a patch Changeset for the existing fixed release group. No public API or default changes, dependencies, or additional CI jobs.
Summary by CodeRabbit#
- Bug Fixes
- Repeated tooltip hide requests no longer restart an active exit, and completed tooltip animations are properly cleaned up.
- Chart resizing during motion now follows the documented policy: animations continue when resize handling is enabled; otherwise, the final scene is shown immediately.
- Documentation
- Clarified how chart resizing affects motion and updated comparison data and benchmark references.
- 1
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
-
⚙️ Run configuration
-
- Configuration used: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
e02cbbad-d616-4473-9153-788de7b4eda4
📥 Commits
-
Reviewing files that changed from the base of the PR and between 57774e14a1a86081eddb3a23523724a40da05640 and 4581c339747910c73b30ef50da9f3ff93703abd8.
📒 Files selected for processing: 11
-
.changeset/quiet-tooltip-exits.mdAPI-FRICTION.mdbenchmarks/comparison/bundle-baseline.jsonbenchmarks/conformance/previews/manifest.jsondocs/comparison.mddocs/reference/motion.mdpackages/charts-core/docs/comparison.mdpackages/charts-core/docs/reference/motion.mdpackages/charts-core/src/motion.test.tspackages/charts-core/src/motion.tspackages/charts-core/src/tooltip-motion.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
-
📝 Walkthrough
-
The change updates tooltip exit and animation cleanup behavior, adds resize-during-motion regression coverage and documentation, and refreshes benchmark, preview, and comparison records.
Changes: Tooltip animation lifecycle
Layer / File(s) Summary Tooltip exit and animation cleanup
packages/charts-core/src/motion.ts,packages/charts-core/src/tooltip-motion.test.ts,.changeset/quiet-tooltip-exits.mdThe controller reuses an active exit on repeated hide()calls and cancels completed animations. Tests cover repeated hides, interrupted exits, cleanup, and completion callbacks. The changeset records the tooltip animation updates.Resize during motion
Layer / File(s) Summary Resize policy and regression coverage
packages/charts-core/src/motion.test.ts,docs/reference/motion.md,packages/charts-core/docs/reference/motion.md,API-FRICTION.mdThe test checks resize behavior during entrance motion with both resizesettings. The references document thatresize: falsecancels motion and paints the final scene after a real size change, whileresize: truecontinues from painted geometry.Comparison and preview evidence
Layer / File(s) Summary Benchmark and comparison records
benchmarks/comparison/bundle-baseline.json,benchmarks/conformance/previews/manifest.json,docs/comparison.md,packages/charts-core/docs/comparison.md,API-FRICTION.mdThe bundle baseline metadata, preview source hash, comparison revision, and baseline date are updated. The API friction record notes that test-file edits can invalidate the preview source fingerprint and advises regeneration after edits are final. Priority: ➖ Normal
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix · Severity of issue fixed: Medium
Suggested reviewers:
greglum
Merge Risk: ⚪ Minimal · up to
4581c-
No actionable merge-blocking issue is identified; the change is ready for normal merge checks.
Pre-merge checks:
3 · 2-
Failed checks: 2 warningsCheck name Status Explanation Resolution Out of Scope Changes check The tooltip lifecycle changes and their tests match #209. The PR also adds resize-policy behavior tests and documentation inpackages/charts-core/src/motion.test.tsand the motion reference files. I…Keep the #209lifecycle fix, its tests, and its changeset in this PR. Move the resize-policy work and unrelated comparison, preview, and provenance refreshes to a separate PR, or provide an active directly linked coding issue that requires …Docstring Coverage Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 3 files. (8 skipped: 8 … Write docstrings for the functions missing them to satisfy the coverage threshold. Passed checks: 3 passed-
Check name Status Explanation Description Check Check skipped - CodeRabbit’s high-level summary is enabled. Title check The title clearly and concisely describes the main change: fixing tooltip animation lifecycle behavior. Linked Issues check #209requires repeatedhide()calls to keep a running exit and requires finished tooltip animations to detach their effects.packages/charts-core/src/motion.tstracks an active exit, avoids restar…
Full details: Out of Scope Changes check
-
Explanation
The tooltip lifecycle changes and their tests match
#209. The PR also adds resize-policy behavior tests and documentation inpackages/charts-core/src/motion.test.tsand the motion reference files. It refreshes comparison baselines, comparison documentation, preview provenance, and catalog outputs. These changes do not implement repeated tooltip hides or finished tooltip animation cleanup required by#209. The supplied linked issues do not establish#182as an active direct target.Resolution
Keep the
#209lifecycle fix, its tests, and its changeset in this PR. Move the resize-policy work and unrelated comparison, preview, and provenance refreshes to a separate PR, or provide an active directly linked coding issue that requires them.
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 3 files. (8 skipped: 8 unsupported.)
-
- Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
-
📝 Generate docstrings: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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 `@coderabbitai help` to get the list of available commands.-
View your CI Pipeline Execution ↗ for commit 4581c339747910c73b30ef50da9f3ff93703abd8
Command Status Duration Result nx run charts-workspace:ci-distributed✅ Succeeded 2m 20s View ↗ nx run charts-workspace:package-check✅ Succeeded <1s View ↗ nx run charts-workspace:benchmark-check✅ Succeeded <1s View ↗
☁️ Nx Cloud last updated this comment at
2026-10-13 21:23:50UTCtannerlinsley merged this2f2d9d0
tannerlinsley closed this
Sign in to join this conversation.
🦋 Changeset detected#
Latest commit: 4581c339747910c73b30ef50da9f3ff93703abd8
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 12 packages
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR