Skip to content

Fix PieLabel types#6313

Merged
ckifer merged 1 commit intomainfrom
label-type
Sep 14, 2025
Merged

Fix PieLabel types#6313
ckifer merged 1 commit intomainfrom
label-type

Conversation

@PavelVanecek
Copy link
Collaborator

Related Issue

Closes #6306
Fixes #6311

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Fixes TypeScript type definitions for PieLabel components by introducing proper type safety for pie label rendering props and removing unnecessary @ts-expect-error comments.

  • Introduces new PieLabelRenderProps type to properly type pie label functions
  • Updates PieLabel type from generic ImplicitLabelListType to specific pie label union type
  • Removes multiple @ts-expect-error suppressions that are no longer needed

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/state/selectors/pieSelectors.spec.tsx Removes @ts-expect-error comments and updates test types
test/polar/Pie.spec.tsx Adds test coverage for PieLabel props and updates type imports
src/state/types/PieSettings.ts Introduces typed PiePresentationProps for presentation properties
src/state/selectors/pieSelectors.ts Updates return type annotation to use ReadonlyArray
src/shape/Sector.tsx Excludes dangerouslySetInnerHTML from Props type
src/polar/Pie.tsx Major type improvements including new PieLabelRenderProps and updated PieLabel types
src/component/LabelList.tsx Updates Props type to exclude refs using PropsWithoutRef
Comments suppressed due to low confidence (1)

src/polar/Pie.tsx:535

  • Variable tooltipPayload is declared as TooltipPayload but assigned an array [{...}]. This should be declared as TooltipPayload[] or ReadonlyArray<TooltipPayload> to match the actual value being assigned.
      const tooltipPayload: TooltipPayload = [
        {
          name,
          value: val,
          payload: entryWithCellInfo,
          dataKey,
          type: tooltipType,
        },
      ];

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@codecov
Copy link

codecov bot commented Sep 14, 2025

Codecov Report

❌ Patch coverage is 94.73684% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 96.63%. Comparing base (1dfde1e) to head (d15f806).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/polar/Pie.tsx 92.85% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6313   +/-   ##
=======================================
  Coverage   96.63%   96.63%           
=======================================
  Files         221      221           
  Lines       20287    20289    +2     
  Branches     4157     4157           
=======================================
+ Hits        19604    19606    +2     
  Misses        676      676           
  Partials        7        7           

☔ 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 Sep 14, 2025

Bundle Report

Changes will increase total bundle size by 251 bytes (0.01%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
recharts/bundle-cjs 1.05MB 111 bytes (0.01%) ⬆️
recharts/bundle-es6 901.99kB 130 bytes (0.01%) ⬆️
recharts/bundle-umd 488.33kB 10 bytes (0.0%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: recharts/bundle-cjs

Assets Changed:

Asset Name Size Change Total Size Change (%)
polar/Pie.js -38 bytes 23.74kB -0.16%
component/LabelList.js 149 bytes 6.41kB 2.38%
view changes for bundle: recharts/bundle-es6

Assets Changed:

Asset Name Size Change Total Size Change (%)
polar/Pie.js -19 bytes 22.1kB -0.09%
component/LabelList.js 149 bytes 5.21kB 2.94%
view changes for bundle: recharts/bundle-umd

Assets Changed:

Asset Name Size Change Total Size Change (%)
Recharts.js 10 bytes 488.33kB 0.0%

Copy link
Member

@ckifer ckifer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏👏👏

@ckifer ckifer merged commit f9071c8 into main Sep 14, 2025
26 of 27 checks passed
@PavelVanecek PavelVanecek deleted the label-type branch September 14, 2025 06:02
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.

Release 3.2.0: Property 'percent' does not exist on type 'Props'.

3 participants