Skip to content

Remove more non-existent props from documentation#6590

Merged
ckifer merged 5 commits into
mainfrom
more-props-cleanup
Nov 9, 2025
Merged

Remove more non-existent props from documentation#6590
ckifer merged 5 commits into
mainfrom
more-props-cleanup

Conversation

@PavelVanecek

@PavelVanecek PavelVanecek commented Nov 9, 2025

Copy link
Copy Markdown
Collaborator

Related Issue

#6069

Summary by CodeRabbit

  • Documentation

    • Removed deprecated and unused properties from API documentation across multiple components (RadialBar, Sankey, ScatterChart).
    • Simplified component configuration documentation in Storybook.
  • Tests

    • Updated test assertions to improve clarity and reduce unnecessary logging.
  • Chores

    • Refined internal prop configurations and removed redundant property definitions.

these are properties of the data object, not Sankey Component
we already have documented Enter+Leave which are better behaving anyway so let's promote that variant.
@coderabbitai

coderabbitai Bot commented Nov 9, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

This PR removes several documented and storybook props across multiple components while refactoring Funnel story argTypes to consolidate shape-related properties. Changes include eliminating activeIndex from ActiveShapeProps, removing activeShape from CartesianComponentShared, and deleting unused props from API documentation for RadialBar, Sankey, and ScatterChart components.

Changes

Cohort / File(s) Summary
Omnidoc test updates
omnidoc/omnidoc.spec.ts
Simplified API doc props test by removing logging and snapshot verification to assert missingProps equals empty array; updated Storybook props test to remove previously asserted missing Funnel and FunnelChart entries.
Storybook props definitions
storybook/stories/API/props/ActiveShapeProps.ts, storybook/stories/API/props/CartesianComponentShared.ts
Removed activeIndex property from ActiveShapeProps; removed activeShape property from CartesianComponentShared.
Storybook stories
storybook/stories/API/cartesian/Funnel.stories.tsx, storybook/stories/API/chart/FunnelChart.stories.tsx
Consolidated shape-related props in Funnel story by introducing ActiveShapeProps spread and adding explicit dataKey/General props; simplified FunnelChart story argTypes to use only CategoricalChartProps instead of spreading both CategoricalChartProps and ActiveShapeProps.
API documentation
www/src/docs/api/RadialBar.ts, www/src/docs/api/Sankey.ts, www/src/docs/api/ScatterChart.ts
Removed documented props: maxAngle and minAngle from RadialBar; linkWidth and axis-related sourceX/sourceY/sourceControlX/targetControlX/targetX/targetY from Sankey; onMouseOver and onMouseOut from ScatterChart.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Verification of prop removals across files: Ensure that each prop removal from storybook definitions and API docs is intentional and aligns with actual component implementations.
  • Storybook story refactoring consistency: Confirm that the consolidation of shape-related props in Funnel story and the argTypes simplification in FunnelChart story are consistent with each other and with the props definitions.
  • Test assertions alignment: Verify that the omnidoc test updates correctly reflect all prop changes and that the expected empty missingProps array is accurate given all removals.

Possibly related PRs

Suggested reviewers

  • ckifer

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description only includes a related issue link but is missing key template sections like motivation, testing details, and change type classification. Add motivation/context explaining why these props are being removed, describe how changes were tested, and check the appropriate types of changes boxes.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and directly describes the main objective of the changeset - removing non-existent props from documentation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch more-props-cleanup

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
omnidoc/omnidoc.spec.ts (1)

74-74: Consider adding console.error logging before the assertion for easier debugging.

The strict toEqual([]) check aligns well with the PR's goal of cleaning up non-existent props. However, unlike the Storybook props test (lines 96-101), this test no longer logs missing props before failing, making future debugging harder.

Apply this diff to add back the logging:

+    if (missingProps.length > 0) {
+      console.error(
+        `Found ${missingProps.length} prop(s) documented in API docs but not exported from the project:`,
+        missingProps,
+      );
+    }
+
     expect(missingProps).toEqual([]);
storybook/stories/API/chart/FunnelChart.stories.tsx (1)

14-14: Consider clarifying the Simple story's component type.

The Simple story is typed as StoryObj<FunnelProps> while the default export declares component: FunnelChart. This creates a mismatch where the story is documenting Funnel props but is part of FunnelChart stories. This might confuse developers about which component's props are being demonstrated.

Consider either:

  1. Changing the type to StoryObj<FunnelChartProps> if this story is meant to demonstrate FunnelChart usage
  2. Moving this story to Funnel.stories.tsx if it's primarily demonstrating Funnel props
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d3564e3 and 3e85208.

📒 Files selected for processing (8)
  • omnidoc/omnidoc.spec.ts (1 hunks)
  • storybook/stories/API/cartesian/Funnel.stories.tsx (2 hunks)
  • storybook/stories/API/chart/FunnelChart.stories.tsx (1 hunks)
  • storybook/stories/API/props/ActiveShapeProps.ts (0 hunks)
  • storybook/stories/API/props/CartesianComponentShared.ts (0 hunks)
  • www/src/docs/api/RadialBar.ts (0 hunks)
  • www/src/docs/api/Sankey.ts (0 hunks)
  • www/src/docs/api/ScatterChart.ts (0 hunks)
💤 Files with no reviewable changes (5)
  • storybook/stories/API/props/CartesianComponentShared.ts
  • www/src/docs/api/ScatterChart.ts
  • www/src/docs/api/RadialBar.ts
  • www/src/docs/api/Sankey.ts
  • storybook/stories/API/props/ActiveShapeProps.ts
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-10-25T07:36:02.229Z
Learnt from: CR
Repo: recharts/recharts PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-10-25T07:36:02.229Z
Learning: Recharts aims for simple, declarative, and composable charts; prioritize consistency, usability, performance, and accessibility

Applied to files:

  • storybook/stories/API/chart/FunnelChart.stories.tsx
  • storybook/stories/API/cartesian/Funnel.stories.tsx
📚 Learning: 2025-10-25T07:35:46.188Z
Learnt from: CR
Repo: recharts/recharts PR: 0
File: test/README.md:0-0
Timestamp: 2025-10-25T07:35:46.188Z
Learning: Applies to test/**/*.test.{ts,tsx} : Mock getBoundingClientRect using test/helper/MockGetBoundingClientRect.ts when rendering Recharts components (e.g., Tooltip, Legend, charts)

Applied to files:

  • storybook/stories/API/cartesian/Funnel.stories.tsx
🧬 Code graph analysis (2)
storybook/stories/API/chart/FunnelChart.stories.tsx (1)
storybook/stories/API/props/ChartProps.ts (1)
  • CategoricalChartProps (72-220)
storybook/stories/API/cartesian/Funnel.stories.tsx (2)
storybook/stories/API/props/ActiveShapeProps.ts (1)
  • ActiveShapeProps (3-24)
storybook/stories/API/props/CartesianComponentShared.ts (1)
  • General (33-57)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Build, Test, Pack
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (4)
omnidoc/omnidoc.spec.ts (1)

103-126: Note the different validation approach between API docs and Storybook tests.

The API docs test (line 74) now strictly expects zero missing props, while this Storybook test continues to allow 5 known missing props via inline snapshot. This asymmetry may be intentional if different standards apply, but it's worth confirming that this is the desired behavior.

storybook/stories/API/cartesian/Funnel.stories.tsx (2)

3-3: LGTM: Proper imports for consolidated prop definitions.

The addition of dataKey from CartesianComponentShared and ActiveShapeProps imports correctly support the argTypes consolidation changes below.

Also applies to: 24-24


30-34: LGTM: Improved argTypes organization.

The changes consolidate shape-related props by spreading ActiveShapeProps instead of defining them individually, and make dataKey, id, and name explicit in the argTypes. This improves maintainability by using centralized prop definitions while ensuring these important props are clearly visible in the Storybook documentation.

storybook/stories/API/chart/FunnelChart.stories.tsx (1)

10-10: The review comment is valid—verify the intent of this change with the team.

The Simple story (lines 25-26, 37-38) indeed still references args.shape and args.activeShape, but these props will no longer have interactive Storybook controls after removing ActiveShapeProps from argTypes on line 10. The story will render with hardcoded values, but developers won't be able to adjust these props via the Storybook UI.

Additionally, the Simple story is typed as StoryObj<FunnelProps> while rendering inside FunnelChart—this type mismatch should also be reviewed.

Confirm whether this removal is intentional. If shape/activeShape should remain controllable, apply one of the suggested approaches from the original review comment.

@codecov

codecov Bot commented Nov 9, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.51%. Comparing base (d3564e3) to head (3e85208).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6590      +/-   ##
==========================================
- Coverage   94.53%   94.51%   -0.02%     
==========================================
  Files         491      491              
  Lines       40761    40665      -96     
  Branches     4752     4752              
==========================================
- Hits        38532    38436      -96     
  Misses       2224     2224              
  Partials        5        5              

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

@codecov

codecov Bot commented Nov 9, 2025

Copy link
Copy Markdown

Bundle Report

Bundle size has no change ✅

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.

2 participants