Skip to content

[Omnidoc] Fix Dot and ErrorBar comments#6745

Merged
ckifer merged 2 commits intomainfrom
omnidoc
Dec 7, 2025
Merged

[Omnidoc] Fix Dot and ErrorBar comments#6745
ckifer merged 2 commits intomainfrom
omnidoc

Conversation

@PavelVanecek
Copy link
Collaborator

@PavelVanecek PavelVanecek commented Dec 6, 2025

Related Issue

#6069

Summary by CodeRabbit

Release Notes

  • New Features

    • ErrorBar component now supports customizable line width and color through new stroke-related properties.
    • Dot component now supports click event handling for improved interactivity.
  • Documentation

    • Refined descriptions for ErrorBar configuration properties to improve clarity.
    • Enhanced documentation for SunburstChart positioning properties and mouse event handlers throughout the API.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 6, 2025

Walkthrough

This PR adds public props to the ErrorBar component (stroke and strokeWidth) and the Dot component (onClick), updates related JSDoc and description documentation across storybook stories and API docs, and removes both components from the componentsWithInconsistentCommentsInApiDoc tracking list.

Changes

Cohort / File(s) Change Summary
ErrorBar component enhancements
src/cartesian/ErrorBar.tsx, storybook/stories/API/cartesian/ErrorBar.stories.tsx, www/src/docs/api/ErrorBar.ts
Added stroke and strokeWidth optional props to ErrorBarProps interface; updated descriptions in storybook and API docs for dataKey, width, strokeWidth, and stroke properties; adjusted phrasing and default value for stroke ('black' instead of '#ccc').
Dot component enhancements
src/shape/Dot.tsx
Added optional onClick prop with type RechartsMouseEventHandler<Props> to DotProps interface; added inline JSDoc comments for cx, cy, and r properties.
Type system and infrastructure updates
src/util/types.ts, omnidoc/componentsWithInconsistentCommentsInApiDoc.ts
Added documentation comments above mouse event props (onMouseDown, onMouseEnter, onMouseLeave, onMouseMove, onMouseOut, onMouseOver, onMouseUp) in DOMAttributesWithProps; removed 'Dot' and 'ErrorBar' entries from the componentsWithInconsistentCommentsInApiDoc array.
Documentation updates
src/chart/SunburstChart.tsx
Updated JSDoc comments for cx and cy props to clarify their meanings.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify that new props (stroke, strokeWidth, onClick) are correctly typed and properly exposed through component interfaces.
  • Cross-check consistency of prop descriptions across storybook stories and API documentation files.
  • Confirm that the onClick handler will be properly passed through adaptEventHandlers in the Dot component.
  • Ensure removing Dot and ErrorBar from componentsWithInconsistentCommentsInApiDoc is justified by the added documentation and prop consistency.

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 is incomplete, containing only a Related Issue link while lacking critical sections from the template such as Motivation and Context, How Has This Been Tested, Types of changes, and Checklist items. Complete the PR description by filling in all required template sections including motivation, testing details, change type classification, and relevant checklist items.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title '[Omnidoc] Fix Dot and ErrorBar comments' accurately describes the main changes across the PR, specifically addressing documentation and comment updates to Dot and ErrorBar components.
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 omnidoc

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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

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 (1)
src/chart/SunburstChart.tsx (1)

71-74: Optional: Remove trailing spaces in JSDoc comments.

The JSDoc comments for cx and cy contain trailing spaces before the closing */. These add no value and can be removed for consistency.

Apply this diff:

-  /** The x-coordinate of center  */
+  /** The x-coordinate of center */
   cx?: number;
-  /** The y-coordinate of center  */
+  /** The y-coordinate of center */
   cy?: number;
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0c77f1c and 8171b45.

📒 Files selected for processing (7)
  • omnidoc/componentsWithInconsistentCommentsInApiDoc.ts (0 hunks)
  • src/cartesian/ErrorBar.tsx (2 hunks)
  • src/chart/SunburstChart.tsx (1 hunks)
  • src/shape/Dot.tsx (1 hunks)
  • src/util/types.ts (1 hunks)
  • storybook/stories/API/cartesian/ErrorBar.stories.tsx (2 hunks)
  • www/src/docs/api/ErrorBar.ts (4 hunks)
💤 Files with no reviewable changes (1)
  • omnidoc/componentsWithInconsistentCommentsInApiDoc.ts
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.{ts,tsx}: Never use any type (implicit or explicit) in TypeScript code
Prefer unknown over any and refine the type in TypeScript
Type function parameters and return values explicitly in TypeScript, do not rely on implicit any or inference; exceptions are React components and trivial functions
Do not use as type assertions in TypeScript; the only exception is as const

Files:

  • src/chart/SunburstChart.tsx
  • src/cartesian/ErrorBar.tsx
  • storybook/stories/API/cartesian/ErrorBar.stories.tsx
  • src/util/types.ts
  • src/shape/Dot.tsx
  • www/src/docs/api/ErrorBar.ts
**/*.{js,ts,tsx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Ensure code lints by running npm run lint and follows Airbnb's Style Guide

Files:

  • src/chart/SunburstChart.tsx
  • src/cartesian/ErrorBar.tsx
  • storybook/stories/API/cartesian/ErrorBar.stories.tsx
  • src/util/types.ts
  • src/shape/Dot.tsx
  • www/src/docs/api/ErrorBar.ts
src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Do not hardcode any strings or formatting choices in library code; users should provide localized strings as desired

Files:

  • src/chart/SunburstChart.tsx
  • src/cartesian/ErrorBar.tsx
  • src/util/types.ts
  • src/shape/Dot.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (DEVELOPING.md)

All imports from recharts must use the public API entry point; imports from internal paths like recharts/types/* or recharts/src/* are not allowed

Files:

  • src/chart/SunburstChart.tsx
  • src/cartesian/ErrorBar.tsx
  • storybook/stories/API/cartesian/ErrorBar.stories.tsx
  • src/util/types.ts
  • src/shape/Dot.tsx
  • www/src/docs/api/ErrorBar.ts
storybook/stories/**/*.stories.tsx

📄 CodeRabbit inference engine (CONTRIBUTING.md)

storybook/stories/**/*.stories.tsx: Use Storybook for smoke tests and add play functions with assertions for actual tests
Update Storybook stories when APIs have been changed to ensure they work as expected

Files:

  • storybook/stories/API/cartesian/ErrorBar.stories.tsx
**/storybook/**/*.stories.{ts,tsx}

📄 CodeRabbit inference engine (DEVELOPING.md)

When adding new Storybook stories, prioritize high fidelity examples intended for publication on the website and in Storybook UI; use unit tests or VR tests for low fidelity tests

Files:

  • storybook/stories/API/cartesian/ErrorBar.stories.tsx
🧠 Learnings (1)
📚 Learning: 2025-11-25T01:22:59.729Z
Learnt from: CR
Repo: recharts/recharts PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-11-25T01:22:59.729Z
Learning: Applies to storybook/stories/**/*.stories.tsx : Update Storybook stories when APIs have been changed to ensure they work as expected

Applied to files:

  • storybook/stories/API/cartesian/ErrorBar.stories.tsx
🧬 Code graph analysis (1)
src/shape/Dot.tsx (2)
src/util/types.ts (1)
  • RechartsMouseEventHandler (181-181)
src/cartesian/ReferenceDot.tsx (1)
  • Props (63-63)
⏰ 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 (7)
src/shape/Dot.tsx (2)

6-6: LGTM!

The import of RechartsMouseEventHandler is appropriate for typing the new onClick prop.


11-30: LGTM!

The JSDoc comments for cx, cy, r, and onClick are clear and follow recharts documentation patterns. The onClick prop type is correctly specified as RechartsMouseEventHandler<Props>, which will be properly handled by adaptEventHandlers.

src/util/types.ts (1)

316-347: LGTM!

The JSDoc comments for mouse event handlers are consistent and improve API documentation. The pattern "The customized event handler of [event] in this chart" aligns with the documentation added to other components in this PR.

src/cartesian/ErrorBar.tsx (2)

48-53: LGTM!

The JSDoc comment for dataKey clearly explains both symmetric (single value) and asymmetric (array) error bar modes.


81-90: LGTM!

The new public props strokeWidth and stroke are properly typed and documented. They will correctly flow through to the SVG line elements via svgPropertiesNoEvents, and the default values in errorBarDefaultProps match the JSDoc annotations.

www/src/docs/api/ErrorBar.ts (1)

9-42: LGTM!

The documentation updates improve consistency and conciseness. The semicolon in the dataKey description enhances readability, and removing "The" prefix aligns with modern API documentation style. All default values match the implementation.

storybook/stories/API/cartesian/ErrorBar.stories.tsx (1)

9-51: LGTM!

The Storybook story updates properly reflect the API changes and maintain consistency with the updated documentation. The default value for stroke now correctly shows 'black' to match the component defaults, and all descriptions align with the API documentation.

As per coding guidelines, the Storybook stories have been appropriately updated when APIs were changed.

@codecov
Copy link

codecov bot commented Dec 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.96%. Comparing base (6026053) to head (8171b45).
⚠️ Report is 11 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6745      +/-   ##
==========================================
+ Coverage   93.92%   93.96%   +0.04%     
==========================================
  Files         502      504       +2     
  Lines       41978    42177     +199     
  Branches     4908     4925      +17     
==========================================
+ Hits        39427    39633     +206     
+ Misses       2546     2539       -7     
  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
Copy link

codecov bot commented Dec 6, 2025

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