chore(deps): upgrade recharts 2 → 3 (T02 It5)#82
Conversation
- recharts ^2.15.4 → ^3.8.1 - chart.tsx: replace ComponentProps<Tooltip> with TooltipContentProps, LegendProps pick with DefaultLegendContentProps pick, coerce dataKey to string for React key - add smoke test for DashboardCharts render (3 assertions) - ADR-005 written to docs/decisions/ (gitignored docs vault) Supersedes Dependabot PR #78 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
💤 Files with no reviewable changes (1)
WalkthroughUpgrades Recharts from v2.15.4 to v3.8.1, updates chart component typings to align with Recharts v3, adds Vitest + RTL tests for DashboardCharts, and removes a generated-docstrings language override in Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/components/ui/chart.tsx`:
- Line 178: The JSX uses key={`${item.dataKey}`} which can be undefined or
duplicate; instead use the precomputed key variable (const key = `${nameKey ||
item.name || item.dataKey || 'value'}`) for the element's key prop (or ensure an
equivalent fallback is applied) so that the key is stable and matches the
intended uniqueness for each mapped item (replace key={`${item.dataKey}`} with
key={key} or an equivalent expression using
nameKey/item.name/item.dataKey/'value').
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: 55931d30-2510-4f79-bd4a-04feb52e9169
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (3)
package.jsonsrc/components/dashboard/dashboard-charts.test.tsxsrc/components/ui/chart.tsx
CodeRabbit: item.dataKey can be undefined or Function in recharts 3, causing duplicate/invalid React keys. Use the already-computed `key` variable (nameKey || item.name || item.dataKey || 'value') instead. Also remove invalid `language: typescript` from .coderabbit.yaml code_generation.docstrings — not a valid enum value (docstrings disabled anyway). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* chore(deps): upgrade recharts 2 → 3 with chart.tsx type migration - recharts ^2.15.4 → ^3.8.1 - chart.tsx: replace ComponentProps<Tooltip> with TooltipContentProps, LegendProps pick with DefaultLegendContentProps pick, coerce dataKey to string for React key - add smoke test for DashboardCharts render (3 assertions) - ADR-005 written to docs/decisions/ (gitignored docs vault) Supersedes Dependabot PR #78 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(chart): use precomputed key var for tooltip item stability CodeRabbit: item.dataKey can be undefined or Function in recharts 3, causing duplicate/invalid React keys. Use the already-computed `key` variable (nameKey || item.name || item.dataKey || 'value') instead. Also remove invalid `language: typescript` from .coderabbit.yaml code_generation.docstrings — not a valid enum value (docstrings disabled anyway). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Emiya Kiritsugu <emiyakiritsugu3@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Summary
rechartsfrom^2.15.4to^3.8.1src/components/ui/chart.tsxto recharts 3 type APIDashboardChartsdocs/decisions/ADR-005-recharts3-upgrade.mdBreaking changes handled
payload/label/activeremoved fromTooltipPropsTooltipContentPropsforChartTooltipContentpayload/verticalAlignremoved fromLegendPropsPick<DefaultLegendContentProps, ...>forChartLegendContentdataKeytype widened tostring | number | FunctionQuality gates
npm run typecheck— 0 errorsnpm run lint— 0 errorsnpm run test— 25/25 passing (3 new smoke tests)npm run build— production build succeedsSupersedes Dependabot PR #78.
🤖 Generated with Claude Code
Summary by CodeRabbit
Chores
Tests
Refactor