Skip to content

refactor(Pie): simplify InternalPieProps type#7217

Merged
PavelVanecek merged 1 commit into
mainfrom
pie-props-dry
Apr 5, 2026
Merged

refactor(Pie): simplify InternalPieProps type#7217
PavelVanecek merged 1 commit into
mainfrom
pie-props-dry

Conversation

@PavelVanecek

@PavelVanecek PavelVanecek commented Apr 5, 2026

Copy link
Copy Markdown
Collaborator

This pull request refactors the Pie.tsx component to simplify and clarify the typing of its internal props. The main focus is on consolidating and streamlining the internal prop types by removing redundancy and leveraging existing utility types. This should make the codebase easier to maintain and less error-prone.

Type refactoring and simplification:

  • Replaced the verbose InternalPieProps interface with a more concise PropsWithResolvedDefaults type, removing many manually-listed properties in favor of a unified type.
  • Updated the PieImpl function signature to use WithIdRequired<PropsWithResolvedDefaults> instead of a custom omit type, further simplifying type usage.
  • Added the WithIdRequired import from ../util/useUniqueId to support the new prop typing approach.## Description

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Type refactor

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • I have added a storybook story or VR test, or extended an existing story or VR test to show my changes

Summary by CodeRabbit

Release Notes

This release contains internal code improvements with no user-facing changes or impact on functionality.

@coderabbitai

coderabbitai Bot commented Apr 5, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9bed0b6e-78bf-482c-a570-ba76cc750d05

📥 Commits

Reviewing files that changed from the base of the PR and between 3f25c0d and de292ad.

📒 Files selected for processing (1)
  • src/polar/Pie.tsx

Walkthrough

The InternalPieProps type in src/polar/Pie.tsx was refactored to extend PropsWithResolvedDefaults instead of directly extending multiple interfaces, reducing explicit property declarations. The PieImpl parameter type was updated to reflect this composition, maintaining the same destructuring pattern.

Changes

Cohort / File(s) Summary
Pie component type refactoring
src/polar/Pie.tsx
Refactored InternalPieProps to extend PropsWithResolvedDefaults instead of explicitly extending multiple interfaces (DataProvider, PieDef, ZIndexable, PieEvents). Updated PieImpl parameter type from Omit<InternalProps, 'sectors'> to WithIdRequired<PropsWithResolvedDefaults>, simplifying type composition while maintaining existing behavior.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

refactor

Suggested reviewers

  • ckifer
🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The description covers the refactoring objectives and key changes, but is missing required template sections like Related Issue, Motivation and Context, and How Has This Been Tested. Add the missing required sections: Related Issue link, Motivation and Context explaining why this refactor is needed, and How Has This Been Tested with details of testing approach.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely summarizes the main change: refactoring the InternalPieProps type to be simpler.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch pie-props-dry

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

codecov Bot commented Apr 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.07%. Comparing base (3f25c0d) to head (de292ad).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7217   +/-   ##
=======================================
  Coverage   89.07%   89.07%           
=======================================
  Files         539      539           
  Lines       41014    41014           
  Branches     5555     5555           
=======================================
  Hits        36532    36532           
  Misses       4474     4474           
  Partials        8        8           

☔ 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.

@github-actions

github-actions Bot commented Apr 5, 2026

Copy link
Copy Markdown
Contributor

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.

@codecov

codecov Bot commented Apr 5, 2026

Copy link
Copy Markdown

Bundle Report

Bundle size has no change ✅

@PavelVanecek
PavelVanecek merged commit 52421f1 into main Apr 5, 2026
59 checks passed
@PavelVanecek
PavelVanecek deleted the pie-props-dry branch April 5, 2026 12:08
@coderabbitai coderabbitai Bot mentioned this pull request May 26, 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.

1 participant