Fix Legend type#7560
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe PR adds an HTML presentation attribute type for legend props, strengthens legend click-event assertions, removes offset-based visual alignment coverage, and simplifies an example callback signature. ChangesLegend updates
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Bundle ReportChanges will increase total bundle size by 576 bytes (0.01%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: recharts/bundle-umdAssets Changed:
view changes for bundle: recharts/bundle-cjsAssets Changed:
view changes for bundle: recharts/bundle-es6Assets Changed:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/util/types.ts`:
- Around line 106-110: Update the PresentationAttributesForHTML type alias to
intersect React’s HTMLAttributes<T> alongside AriaAttributes and
DOMAttributesAdaptChildEvent<P, T>, preserving standard attributes such as
className, style, and id for HTML-rendering components.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 52891b0e-6f39-40b2-9109-625f36b151a2
⛔ Files ignored due to path filters (3)
test-vr/__snapshots__/tests/LegendPosition.spec-vr.tsx-snapshots/Legend-align-with-offset-1-chromium-linux.pngis excluded by!**/*.pngtest-vr/__snapshots__/tests/LegendPosition.spec-vr.tsx-snapshots/Legend-align-with-offset-1-firefox-linux.pngis excluded by!**/*.pngtest-vr/__snapshots__/tests/LegendPosition.spec-vr.tsx-snapshots/Legend-align-with-offset-1-webkit-linux.pngis excluded by!**/*.png
📒 Files selected for processing (6)
src/component/DefaultLegendContent.tsxsrc/util/types.tstest-vr/tests/LegendPosition.spec-vr.tsxtest-vr/tests/LegendPositionComponents.tsxtest/component/Legend.spec.tsxwww/src/docs/exampleComponents/ComposedChart/BandedChart.tsx
|
Tip All tests passed and all changes approved!🟢 UI Tests: 198 tests unchanged |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7560 +/- ##
=======================================
Coverage 88.20% 88.20%
=======================================
Files 615 615
Lines 14272 14272
Branches 3587 3588 +1
=======================================
Hits 12588 12588
Misses 1494 1494
Partials 190 190 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Staging Deployment Details
These deployments will remain available for 30 days. |
|
Staging Deployment Details
These deployments will remain available for 30 days. |
Description
I noticed that Legend has SVG props available on it even though it renders an HTML element. So I fixed the type to remove the SVG things and also changed the
anyto LegendPayload type to reflect what is going on.Related Issue
Nobody reported this!
Motivation and Context
Strong typing
How Has This Been Tested?
Unit tests + TS
Screenshots (if appropriate):
Types of changes
Checklist:
Summary by CodeRabbit
Legenddoes not forwardidandclassNameto the DOM.mouseevent details.