Skip to content

chore(deps): upgrade recharts 2 → 3 (T02 It5)#82

Merged
EmiyaKiritsugu3 merged 2 commits into
mainfrom
feat/008-it5-recharts3
Apr 22, 2026
Merged

chore(deps): upgrade recharts 2 → 3 (T02 It5)#82
EmiyaKiritsugu3 merged 2 commits into
mainfrom
feat/008-it5-recharts3

Conversation

@EmiyaKiritsugu3

@EmiyaKiritsugu3 EmiyaKiritsugu3 commented Apr 22, 2026

Copy link
Copy Markdown
Owner

Summary

  • Upgrades recharts from ^2.15.4 to ^3.8.1
  • Migrates src/components/ui/chart.tsx to recharts 3 type API
  • Adds smoke test for DashboardCharts
  • ADR-005 written to docs/decisions/ADR-005-recharts3-upgrade.md

Breaking changes handled

recharts 3 break Fix applied
payload/label/active removed from TooltipProps Use TooltipContentProps for ChartTooltipContent
payload/verticalAlign removed from LegendProps Use Pick<DefaultLegendContentProps, ...> for ChartLegendContent
dataKey type widened to string | number | Function Coerce to string for React key

Quality gates

  • npm run typecheck — 0 errors
  • npm run lint — 0 errors
  • npm run test — 25/25 passing (3 new smoke tests)
  • npm run build — production build succeeds

Supersedes Dependabot PR #78.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores

    • Upgraded charting library dependency to version 3.8.1
    • Removed an unnecessary docstring language override in project config
  • Tests

    • Added test coverage for dashboard charts, including mock data and empty-state scenarios
  • Refactor

    • Improved chart tooltip and legend handling for more consistent rendering and typing

- 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>
@vercel

vercel Bot commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
smartmanagementsystem Ready Ready Preview, Comment Apr 22, 2026 3:24am

@coderabbitai

coderabbitai Bot commented Apr 22, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c40467be-f779-4fe2-9172-9c57dd91e6dc

📥 Commits

Reviewing files that changed from the base of the PR and between acb2ef3 and ad349de.

📒 Files selected for processing (2)
  • .coderabbit.yaml
  • src/components/ui/chart.tsx
💤 Files with no reviewable changes (1)
  • .coderabbit.yaml

Walkthrough

Upgrades 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 .coderabbit.yaml. (49 words)

Changes

Cohort / File(s) Summary
Dependency Update
package.json
Bumped recharts dependency from ^2.15.4^3.8.1.
Chart typings & implementation
src/components/ui/chart.tsx
Adjusted forwarded-ref prop generics: ChartTooltipContent uses TooltipContentProps; ChartLegendContent uses DefaultLegendContentProps. Switched tooltip-row React key to the computed string key.
Tests
src/components/dashboard/dashboard-charts.test.tsx
Added Vitest + React Testing Library test file that mocks Recharts primitives and verifies render, title text, and empty-data handling.
Config
.coderabbit.yaml
Removed code_generation.docstrings.language: typescript (docstring generation stays disabled).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: upgrading recharts from version 2 to 3, which is the primary objective of the pull request.
Description check ✅ Passed The description includes the required sections (summary, type of change, checklist) with substantive content. All quality gate checks are marked as passed, and breaking changes are documented with their fixes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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 feat/008-it5-recharts3

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 2dc556b and acb2ef3.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (3)
  • package.json
  • src/components/dashboard/dashboard-charts.test.tsx
  • src/components/ui/chart.tsx

Comment thread src/components/ui/chart.tsx Outdated
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>
@EmiyaKiritsugu3 EmiyaKiritsugu3 merged commit 2a8ce51 into main Apr 22, 2026
10 checks passed
@EmiyaKiritsugu3 EmiyaKiritsugu3 deleted the feat/008-it5-recharts3 branch April 22, 2026 03:42
EmiyaKiritsugu3 added a commit that referenced this pull request Apr 23, 2026
* 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>
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