Skip to content

fix(calendar): clean up d3-tip tooltips#41589

Draft
sadpandajoe wants to merge 6 commits into
masterfrom
fix-calendar-heatmap-tooltip-cleanup-41583
Draft

fix(calendar): clean up d3-tip tooltips#41589
sadpandajoe wants to merge 6 commits into
masterfrom
fix-calendar-heatmap-tooltip-cleanup-41583

Conversation

@sadpandajoe

@sadpandajoe sadpandajoe commented Jun 30, 2026

Copy link
Copy Markdown
Member

fix(calendar): clean up d3-tip tooltips

SUMMARY

  • Adds Calendar Heatmap-specific d3-tip classes, including an owner-scoped class per mounted chart, so tooltip cleanup does not affect other chart instances.
  • Destroys previous Calendar Heatmap instances for the same container before redraw and sweeps disconnected chart tooltip nodes after unmount.
  • Destroys the vendor Calendar Heatmap cell and legend d3-tip instances when the calendar instance is destroyed.

Fixes #41583

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Not applicable; tooltip cleanup is covered by DOM-level regression tests.

TESTING INSTRUCTIONS

  • cd superset-frontend && NODE_ENV=test NODE_OPTIONS='--max-old-space-size=8192' npx jest --runInBand --silent plugins/legacy-plugin-chart-calendar/test/tooltip.test.ts plugins/legacy-plugin-chart-calendar/test/utils.test.ts
  • cd superset-frontend && npx oxlint --config oxlint.json plugins/legacy-plugin-chart-calendar/src/Calendar.ts plugins/legacy-plugin-chart-calendar/src/ReactCalendar.tsx plugins/legacy-plugin-chart-calendar/src/tooltip.ts plugins/legacy-plugin-chart-calendar/src/vendor/cal-heatmap.ts plugins/legacy-plugin-chart-calendar/test/tooltip.test.ts

ADDITIONAL INFORMATION

@sadpandajoe
sadpandajoe force-pushed the fix-calendar-heatmap-tooltip-cleanup-41583 branch from 8ef8473 to 6b01947 Compare July 1, 2026 17:20
@codecov

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 65.00000% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.40%. Comparing base (8ce6d42) to head (9ffca6d).

Files with missing lines Patch % Lines
...ugins/legacy-plugin-chart-calendar/src/Calendar.ts 0.00% 12 Missing ⚠️
...lugins/legacy-plugin-chart-calendar/src/tooltip.ts 91.30% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #41589      +/-   ##
==========================================
+ Coverage   64.44%   65.40%   +0.96%     
==========================================
  Files        2751     2695      -56     
  Lines      154313   149770    -4543     
  Branches    35362    34727     -635     
==========================================
- Hits        99440    97955    -1485     
+ Misses      52962    50049    -2913     
+ Partials     1911     1766     -145     
Flag Coverage Δ
javascript 70.75% <65.00%> (+0.25%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pull-request-size pull-request-size Bot added size/L and removed size/M labels Jul 1, 2026
@sadpandajoe
sadpandajoe force-pushed the fix-calendar-heatmap-tooltip-cleanup-41583 branch from 7c13a86 to 06f49e4 Compare July 3, 2026 14:10
@rusackas

rusackas commented Jul 5, 2026

Copy link
Copy Markdown
Member

This one looks pretty well buttoned up. Anything keeping it in draft? Happy to take a proper review pass whenever you flip it to mergeable.

@sadpandajoe
sadpandajoe force-pushed the fix-calendar-heatmap-tooltip-cleanup-41583 branch from 06f49e4 to 8d4dfba Compare July 7, 2026 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tooltips in the calendar heat map charts can remain in DOM even when navigating away from a dashboard

2 participants