Skip to content

fix: settle tooltip animation lifecycle - #218

Merged
tannerlinsley merged 6 commits into
mainfrom
taren/tooltip-animation-lifecycle
Oct 13, 2026
Merged

tannerlinsley merged 6 commits into
mainfrom
taren/tooltip-animation-lifecycle

Conversation

@tannerlinsley

@tannerlinsley tannerlinsley commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

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 Renderer treats a sub-pixel width difference as a resize, which cancels the motion() entrance #182, with tests for both settings. The default still snaps on a real resize; resize: true animates from the painted geometry.

Fixes #209. Resolves the documentation follow-up in #182. Thanks @toomingos for the reports and reproductions.

Verification

  • pnpm validate passes 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.

@changeset-bot

changeset-bot Bot commented Oct 13, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4581c33

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 12 packages
Name Type
@tanstack/charts Patch
@tanstack/alpine-charts Patch
@tanstack/angular-charts Patch
@tanstack/lit-charts Patch
@tanstack/octane-charts Patch
@tanstack/preact-charts Patch
@tanstack/react-charts Patch
@tanstack/react-native-charts Patch
@tanstack/solid-charts Patch
@tanstack/svelte-charts Patch
@tanstack/vue-charts Patch
@tanstack/charts-scales Patch

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

@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

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: e02cbbad-d616-4473-9153-788de7b4eda4
📥 Commits

Reviewing files that changed from the base of the PR and between 57774e1 and 4581c33.

📒 Files selected for processing: 11
  • .changeset/quiet-tooltip-exits.md
  • API-FRICTION.md
  • benchmarks/comparison/bundle-baseline.json
  • benchmarks/conformance/previews/manifest.json
  • docs/comparison.md
  • docs/reference/motion.md
  • packages/charts-core/docs/comparison.md
  • packages/charts-core/docs/reference/motion.md
  • packages/charts-core/src/motion.test.ts
  • packages/charts-core/src/motion.ts
  • packages/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.md
The 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.md
The test checks resize behavior during entrance motion with both resize settings. The references document that resize: false cancels motion and paints the final scene after a real size change, while resize: true continues 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.md
The 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: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Out of Scope Changes check Warning The tooltip lifecycle changes and their tests match #209. The PR also adds resize-policy behavior tests and documentation in packages/charts-core/src/motion.test.ts and the motion reference files. I… Keep the #209 lifecycle 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 Warning 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 Passed checks: 3 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 describes the main change: fixing tooltip animation lifecycle behavior.
Linked Issues check Passed #209 requires repeated hide() calls to keep a running exit and requires finished tooltip animations to detach their effects. packages/charts-core/src/motion.ts tracks 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 in packages/charts-core/src/motion.test.ts and 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 #182 as an active direct target.

Resolution

Keep the #209 lifecycle 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.

❤️ Share

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

@nx-cloud

nx-cloud Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 4581c33

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:50 UTC

@tannerlinsley
tannerlinsley merged commit 2f2d9d0 into main Oct 13, 2026
19 checks passed
@github-actions github-actions Bot mentioned this pull request Oct 13, 2026
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.

[Bug] Tooltip exit: a repeated hide() restarts the exit, and finished animations stay attached

1 participant