fix(Sankey): add accessibilityLayer, title, and desc prop support#7153
fix(Sankey): add accessibilityLayer, title, and desc prop support#7153mixelburg wants to merge 1 commit intorecharts:mainfrom
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 (2)
WalkthroughThe PR restores accessibility features to the Sankey component by re-introducing Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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 Tip You can make CodeRabbit's review stricter and more nitpicky using the `assertive` profile, if that's what you prefer.Change the |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7153 +/- ##
=======================================
Coverage 89.61% 89.61%
=======================================
Files 536 536
Lines 40479 40496 +17
Branches 5519 5519
=======================================
+ Hits 36275 36292 +17
Misses 4196 4196
Partials 8 8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Bundle ReportChanges will increase total bundle size by 1.26kB (0.02%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: recharts/bundle-cjsAssets Changed:
view changes for bundle: recharts/bundle-es6Assets Changed:
view changes for bundle: recharts/bundle-umdAssets Changed:
|
Fixes #7151
Problem
The
Sankeychart was missing theaccessibilityLayer,title, anddescprops that all other Recharts chart types support. This caused TypeScript errors and the<title>element was not rendered in the SVG when provided.Root causes:
SankeyPropsdid not declareaccessibilityLayer,title, ordescReportChartPropswas never called, soaccessibilityLayerwas never dispatched to the Redux storeSankeyImplused raw<Surface>instead of<RootSurface>, which handlestitle/descrendering andaccessibilityLayer-basedrole/tabIndexattributesChanges
SurfacewithRootSurfaceinSankeyImplsotitle,desc, and accessibility attributes are handled consistently with all other chartsaccessibilityLayer,title, anddesctoSankeyPropsaccessibilityLayer: truetosankeyDefaultPropsReportChartPropsin theSankeywrapper component to dispatchaccessibilityLayerto the Redux storeSurfaceimportTests
Added 4 new tests to
test/chart/Sankey.spec.tsx:role=applicationandtabIndex=0by default (accessibilityLayer=true)role/tabIndexwhenaccessibilityLayer=falsetitleprop renders a<title>elementdescprop renders a<desc>elementAll 27 tests pass.
Summary by CodeRabbit
Release Notes
New Features
Tests