Skip to content

Fix Pie event handlers type#6944

Merged
ckifer merged 1 commit intomainfrom
pie-events-any
Feb 1, 2026
Merged

Fix Pie event handlers type#6944
ckifer merged 1 commit intomainfrom
pie-events-any

Conversation

@PavelVanecek
Copy link
Collaborator

@PavelVanecek PavelVanecek commented Feb 1, 2026

Description

Switches from any to PieSectorDataItem

Related Issue

#6645

Summary by CodeRabbit

  • New Features

    • Pie component now supports comprehensive event handling (click, mouse interactions) with improved type safety
    • Enhanced tooltip integration for Pie charts with refined data structure
    • Coordinate type is now publicly exported for external use
  • Tests

    • Expanded test coverage for Pie component event handlers, tooltips, and accessibility scenarios

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 1, 2026

Walkthrough

The changes export the TooltipTriggerInfo type from the tooltip context and augment the Pie component's public type definitions to include tooltip trigger information and a consolidated PieEvents interface for event handlers. Test coverage for the Pie component is significantly expanded with scenarios for event handling, tooltip integration, and configuration variations. The Coordinate type is added to the library's public exports.

Changes

Cohort / File(s) Summary
Tooltip Type Exports
src/context/tooltipContext.tsx
Export TooltipTriggerInfo type to make it publicly available for use in other components.
Pie Component Types
src/polar/Pie.tsx
Extend PieSectorData to include TooltipTriggerInfo fields; introduce new PieEvents interface aggregating event handlers; update PieProps and InternalPieProps to extend PieEvents for consolidated event handler exposure.
Pie Component Tests & Public Exports
test/polar/Pie.spec.tsx
Expand test coverage with scenarios for event handlers (click, mouse events), tooltip integration, shape configurations, and data variations; add Coordinate type to public library exports.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • ckifer
🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description check ⚠️ Warning The description is incomplete. It lacks Motivation and Context, Testing section, and type of change checkboxes required by the repository template. Add sections explaining why the change was needed, how it was tested, and check appropriate box(es) under Types of changes. Consider expanding on the relationship to issue #6645.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title directly describes the main change: fixing Pie event handlers type to use PieSectorDataItem instead of any.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch pie-events-any

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 and usage tips.

@codecov
Copy link

codecov bot commented Feb 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.37%. Comparing base (e43875c) to head (971203f).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6944   +/-   ##
=======================================
  Coverage   91.37%   91.37%           
=======================================
  Files         505      505           
  Lines       37754    37754           
  Branches     5271     5271           
=======================================
  Hits        34497    34497           
  Misses       3248     3248           
  Partials        9        9           

☔ View full report in Codecov by Sentry.
📢 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.

@codecov
Copy link

codecov bot commented Feb 1, 2026

Bundle Report

Bundle size has no change ✅

@github-actions
Copy link
Contributor

github-actions bot commented Feb 1, 2026

Staging Deployment Details

These deployments will remain available for 30 days.

To update snapshots: Comment /update-snapshots on this PR to automatically update the baseline screenshots.

@ckifer ckifer merged commit 866f061 into main Feb 1, 2026
48 checks passed
@PavelVanecek PavelVanecek deleted the pie-events-any branch February 1, 2026 22:53
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