Skip to content

[Omnidoc] Add script for generating storybook arg types and docs#6845

Merged
ckifer merged 3 commits intomainfrom
generateStorybookArgs
Jan 4, 2026
Merged

[Omnidoc] Add script for generating storybook arg types and docs#6845
ckifer merged 3 commits intomainfrom
generateStorybookArgs

Conversation

@PavelVanecek
Copy link
Collaborator

@PavelVanecek PavelVanecek commented Jan 3, 2026

Description

Uses the typescript comments to generate storybook arg types, and storybook documentation page.

Includes autogenerated Area docs as the first sample.

Related Issue

#6069

Summary by CodeRabbit

  • New Features

    • Added strokeDasharray prop across chart components (Area/Line/Curve) for customizable SVG dash patterns
  • Documentation

    • Auto-generated Storybook ArgTypes and MDX for component props
    • Expanded and clarified API docs with explicit example metadata and external/internal flags
  • Tests

    • New and updated tests for link parsing and doc generation
  • Chores

    • Tooling script expanded to include Storybook arg generation and formatting

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 3, 2026

Walkthrough

Adds automated Storybook ArgTypes/MDX generation, exports new omnidoc helpers (buildContextMap, parseJSDocLinkTag, getTagText), tightens Storybook default-value logic, introduces strokeDasharray prop, updates many generated API docs and tests with null checks and explicit isExternal flags, and adjusts omnidoc linting to allow awaits in loops.

Changes

Cohort / File(s) Summary
ESLint config
eslint.config.mjs
Disable no-await-in-loop for omnidoc group to allow sequential docs generation.
Omnidoc core & exports
omnidoc/generateApiDoc.ts, omnidoc/readProject.ts
Exported buildContextMap and getTagText; made parseJSDocLinkTag exported/strongly typed and improved link parsing/normalization.
New Storybook generator
omnidoc/generateStorybookArgs.ts, package.json
New module to generate Storybook ArgTypes and MDX; added STORYBOOK_AUTOMATED_ARG_COMPONENTS, generateStorybookArgs, writeStorybookArgsFile, generateMdx, main; package script updated to run it and format arg-types.
Storybook arg-types (generated)
storybook/stories/API/arg-types/AreaArgs.ts, storybook/stories/API/arg-types/index.ts
New auto-generated Area ArgTypes and index re-export.
Storybook stories & MDX
storybook/stories/API/cartesian/Area.mdx, storybook/stories/API/cartesian/Area.stories.tsx
MDX updated to list more parents/children and use Controls component; stories switched to use generated AreaArgs.
Storybook reading logic & tests
omnidoc/readStorybookDoc.ts, omnidoc/readStorybookDoc.spec.ts, omnidoc/parseJSDocLinkTag.spec.ts
getDefaultValueOf() now prefers argType.defaultValue; tests adjusted to looser snapshots and added parseJSDocLinkTag unit tests.
Omnidoc tests – null-safety
omnidoc/cross-component-prop-comments.spec.ts, omnidoc/readProject.spec.ts, omnidoc/generateApiDoc.spec.ts
Added runtime null assertions (assertNotNull) and optional chaining; one test expectation changed to explicit false for isExternal.
Component prop addition
src/shape/Curve.tsx
Added optional `strokeDasharray?: string
API docs updates (many files)
www/src/docs/api/... (e.g., AreaAPI.tsx, LineAPI.tsx, TooltipAPI.tsx, BrushAPI.tsx, LabelAPI.tsx, LabelListAPI.tsx, PieChartAPI.tsx, Polar*API.tsx, RadarChartAPI.tsx, RadialBarChartAPI.tsx, Reference*.tsx, SankeyAPI.tsx, ScatterAPI.tsx, etc.)
Numerous API doc objects augmented: added isExternal: false to many example/link entries, added strokeDasharray docs where applicable, and adjusted examples/format lists. Changes alter exported doc data shape.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant CLI as omnidoc CLI (main)
  participant Reader as ProjectDocReader
  participant Gen as generateStorybookArgs
  participant FS as File System

  Note over CLI,Gen: main() orchestration (new)
  CLI->>Reader: buildContextMap(componentNames)
  Reader-->>CLI: context map (parents/children)
  CLI->>Gen: generateStorybookArgs(componentName, projectReader)
  Gen->>Reader: read component prop/meta
  Reader-->>Gen: prop metadata & docs
  Gen->>Gen: infer controls, categories, defaults
  Gen->>FS: writeStorybookArgsFile(componentName, args)
  FS-->>Gen: file written
  Gen->>FS: write MDX adjacent to story file
  FS-->>Gen: MDX written
  Gen-->>CLI: result per component (success / missing story)
  Note right of FS: generated arg-types + MDX are committed by user workflow
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • ckifer

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR description is minimal but does cover the main objective (using TypeScript comments to generate Storybook arg types and docs) and mentions the related issue. However, it lacks detail on motivation, testing approach, and checklist items required by the template. Add more detail on motivation/context for why this change is needed, describe how the changes were tested, and complete the template checklist items.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: adding a script for generating Storybook arg types and documentation from omnidoc.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings

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: 4

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8bb5aa4 and a149052.

📒 Files selected for processing (15)
  • eslint.config.mjs
  • omnidoc/cross-component-prop-comments.spec.ts
  • omnidoc/generateApiDoc.ts
  • omnidoc/generateStorybookArgs.ts
  • omnidoc/readStorybookDoc.spec.ts
  • omnidoc/readStorybookDoc.ts
  • package.json
  • src/shape/Curve.tsx
  • storybook/stories/API/arg-types/AreaArgs.ts
  • storybook/stories/API/arg-types/index.ts
  • storybook/stories/API/cartesian/Area.mdx
  • storybook/stories/API/cartesian/Area.stories.tsx
  • www/src/docs/api/AreaAPI.tsx
  • www/src/docs/api/LineAPI.tsx
  • www/src/docs/api/TooltipAPI.tsx
🧰 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

All imports from recharts must use the public API entry point (e.g., import { TooltipIndex } from 'recharts'). Imports from internal paths like recharts/types/* or recharts/src/* are not allowed and will fail the linter.

Files:

  • src/shape/Curve.tsx
  • storybook/stories/API/arg-types/index.ts
  • omnidoc/readStorybookDoc.ts
  • omnidoc/readStorybookDoc.spec.ts
  • omnidoc/generateApiDoc.ts
  • www/src/docs/api/AreaAPI.tsx
  • storybook/stories/API/cartesian/Area.stories.tsx
  • storybook/stories/API/arg-types/AreaArgs.ts
  • www/src/docs/api/TooltipAPI.tsx
  • www/src/docs/api/LineAPI.tsx
  • omnidoc/generateStorybookArgs.ts
  • omnidoc/cross-component-prop-comments.spec.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/shape/Curve.tsx
  • storybook/stories/API/arg-types/index.ts
  • omnidoc/readStorybookDoc.ts
  • omnidoc/readStorybookDoc.spec.ts
  • omnidoc/generateApiDoc.ts
  • www/src/docs/api/AreaAPI.tsx
  • storybook/stories/API/cartesian/Area.stories.tsx
  • storybook/stories/API/arg-types/AreaArgs.ts
  • www/src/docs/api/TooltipAPI.tsx
  • www/src/docs/api/LineAPI.tsx
  • omnidoc/generateStorybookArgs.ts
  • omnidoc/cross-component-prop-comments.spec.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/shape/Curve.tsx
**/*.spec.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

When running unit tests, prefer to run a single test file using npm run test -- path/to/TestFile.spec.tsx rather than running all tests with npm test

Unit tests should be placed in the test directory, with some tests also allowed in www/test. Test files follow the naming convention *.spec.tsx.

Files:

  • omnidoc/readStorybookDoc.spec.ts
  • omnidoc/cross-component-prop-comments.spec.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/Area.stories.tsx
**/*.stories.{ts,tsx}

📄 CodeRabbit inference engine (DEVELOPING.md)

When adding new Storybook stories, prioritize high-fidelity examples that you want published on the website and in the Storybook UI. Use low-fidelity tests in unit tests or visual regression tests instead to avoid exceeding the Chromatic open source plan limits.

Files:

  • storybook/stories/API/cartesian/Area.stories.tsx
🧠 Learnings (15)
📓 Common learnings
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
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 : Use Storybook for smoke tests and add play functions with assertions for actual tests
Learnt from: CR
Repo: recharts/recharts PR: 0
File: DEVELOPING.md:0-0
Timestamp: 2025-12-26T15:59:11.254Z
Learning: Applies to **/*.stories.{ts,tsx} : When adding new Storybook stories, prioritize high-fidelity examples that you want published on the website and in the Storybook UI. Use low-fidelity tests in unit tests or visual regression tests instead to avoid exceeding the Chromatic open source plan limits.
📚 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/Area.mdx
  • storybook/stories/API/arg-types/index.ts
  • omnidoc/readStorybookDoc.spec.ts
  • storybook/stories/API/cartesian/Area.stories.tsx
  • package.json
  • omnidoc/generateStorybookArgs.ts
📚 Learning: 2025-12-14T13:58:49.197Z
Learnt from: PavelVanecek
Repo: recharts/recharts PR: 6771
File: src/shape/Curve.tsx:39-40
Timestamp: 2025-12-14T13:58:49.197Z
Learning: In the recharts codebase, hooks like useAppSelector and other hooks (e.g., useChartLayout()) return undefined when used outside Redux Provider context, instead of throwing. This enables components that call these hooks, such as Curve, to operate in standalone mode by falling back to prop values. During code reviews, ensure TSX files gracefully handle undefined results from hooks and implement fallbacks (e.g., via default props or explicit prop-based values) rather than assuming the hook is always within Provider.

Applied to files:

  • src/shape/Curve.tsx
📚 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 : Use Storybook for smoke tests and add play functions with assertions for actual tests

Applied to files:

  • omnidoc/readStorybookDoc.spec.ts
  • storybook/stories/API/cartesian/Area.stories.tsx
  • package.json
  • omnidoc/generateStorybookArgs.ts
📚 Learning: 2025-11-25T01:23:08.250Z
Learnt from: CR
Repo: recharts/recharts PR: 0
File: test/README.md:0-0
Timestamp: 2025-11-25T01:23:08.250Z
Learning: Applies to test/**/*.{test,spec}.{ts,tsx} : Verify the number of selector calls using the spy object from `createSelectorTestCase` to spot unnecessary re-renders and improve performance

Applied to files:

  • omnidoc/readStorybookDoc.spec.ts
📚 Learning: 2025-12-16T08:12:13.355Z
Learnt from: PavelVanecek
Repo: recharts/recharts PR: 6783
File: test/util/ChartUtils.spec.tsx:15-16
Timestamp: 2025-12-16T08:12:13.355Z
Learning: In the recharts codebase, files in the `test` folder are allowed to import from internal paths (e.g., `../../src/state/cartesianAxisSlice`) and do not need to use the public API entry point (`src/index.ts`). The public API import restriction applies only to non-test code.

Applied to files:

  • omnidoc/readStorybookDoc.spec.ts
  • storybook/stories/API/cartesian/Area.stories.tsx
📚 Learning: 2025-12-14T13:58:58.361Z
Learnt from: PavelVanecek
Repo: recharts/recharts PR: 6771
File: src/shape/Curve.tsx:39-40
Timestamp: 2025-12-14T13:58:58.361Z
Learning: In the recharts codebase, `useAppSelector` and hooks like `useChartLayout()` are designed to return `undefined` when used outside Redux Provider context, rather than throwing errors. This allows components like `Curve` that call these hooks to work standalone by falling back to prop values.

Applied to files:

  • storybook/stories/API/cartesian/Area.stories.tsx
📚 Learning: 2025-12-26T15:59:11.254Z
Learnt from: CR
Repo: recharts/recharts PR: 0
File: DEVELOPING.md:0-0
Timestamp: 2025-12-26T15:59:11.254Z
Learning: Applies to **/*.{ts,tsx} : All imports from `recharts` must use the public API entry point (e.g., `import { TooltipIndex } from 'recharts'`). Imports from internal paths like `recharts/types/*` or `recharts/src/*` are not allowed and will fail the linter.

Applied to files:

  • storybook/stories/API/cartesian/Area.stories.tsx
📚 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 **/*.{js,ts,tsx} : Ensure code lints by running `npm run lint` and follows Airbnb's Style Guide

Applied to files:

  • package.json
📚 Learning: 2025-11-25T01:23:14.977Z
Learnt from: CR
Repo: recharts/recharts PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T01:23:14.977Z
Learning: Applies to **/*.spec.{ts,tsx} : When running unit tests, prefer to run a single test file using `npm run test -- path/to/TestFile.spec.tsx` rather than running all tests with `npm test`

Applied to files:

  • package.json
📚 Learning: 2025-12-26T15:59:11.254Z
Learnt from: CR
Repo: recharts/recharts PR: 0
File: DEVELOPING.md:0-0
Timestamp: 2025-12-26T15:59:11.254Z
Learning: Applies to **/*.spec.{ts,tsx} : Unit tests should be placed in the `test` directory, with some tests also allowed in `www/test`. Test files follow the naming convention `*.spec.tsx`.

Applied to files:

  • package.json
📚 Learning: 2025-12-26T15:59:11.254Z
Learnt from: CR
Repo: recharts/recharts PR: 0
File: DEVELOPING.md:0-0
Timestamp: 2025-12-26T15:59:11.254Z
Learning: Run `npm run lint` and `npm run check-types` to verify linting and type correctness before submitting changes.

Applied to files:

  • package.json
📚 Learning: 2025-12-26T15:59:11.254Z
Learnt from: CR
Repo: recharts/recharts PR: 0
File: DEVELOPING.md:0-0
Timestamp: 2025-12-26T15:59:11.254Z
Learning: Applies to **/*.stories.{ts,tsx} : When adding new Storybook stories, prioritize high-fidelity examples that you want published on the website and in the Storybook UI. Use low-fidelity tests in unit tests or visual regression tests instead to avoid exceeding the Chromatic open source plan limits.

Applied to files:

  • package.json
📚 Learning: 2025-12-25T23:55:31.361Z
Learnt from: PavelVanecek
Repo: recharts/recharts PR: 6824
File: package.json:0-0
Timestamp: 2025-12-25T23:55:31.361Z
Learning: In Recharts, the engines field in package.json should only be changed as part of major version releases to avoid breaking consumers. For development environment Node version requirements, prefer .nvmrc at the repository root to standardize the development environment without affecting published library constraints.

Applied to files:

  • package.json
📚 Learning: 2025-11-23T13:30:10.395Z
Learnt from: PavelVanecek
Repo: recharts/recharts PR: 6669
File: www/src/docs/exampleComponents/ScatterChart/ScatterChartWithLabels.tsx:2-2
Timestamp: 2025-11-23T13:30:10.395Z
Learning: The `TooltipIndex` type from recharts is defined in `src/state/tooltipSlice.ts` but is not currently exported from the public API entry points. It should not be imported from `recharts/types/state/tooltipSlice` as this is an internal implementation path. An ESLint rule is needed to prevent regressions.

Applied to files:

  • www/src/docs/api/TooltipAPI.tsx
🧬 Code graph analysis (3)
storybook/stories/API/cartesian/Area.stories.tsx (3)
src/cartesian/Area.tsx (1)
  • Area (1127-1127)
storybook/stories/API/arg-types/AreaArgs.ts (1)
  • AreaArgs (7-1667)
storybook/stories/API/props/utils.ts (1)
  • getStoryArgsFromArgsTypesObject (4-23)
storybook/stories/API/arg-types/AreaArgs.ts (1)
storybook/StorybookArgs.ts (1)
  • StorybookArgs (59-61)
omnidoc/cross-component-prop-comments.spec.ts (1)
test/helper/assertNotNull.ts (1)
  • assertNotNull (1-5)
⏰ 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 (19)
omnidoc/readStorybookDoc.spec.ts (1)

114-123: Improved test resilience with targeted assertions.

Replacing the strict inline snapshot with targeted toContain checks makes this test more maintainable. It validates the presence of key Area props without breaking when new props are added. The length check on line 116 ensures the props array isn't empty.

package.json (1)

44-44: LGTM!

The script correctly chains API doc generation, Storybook args generation, and formatting in sequence. The prettier paths cover both output directories.

omnidoc/generateApiDoc.ts (2)

137-167: Good extraction of buildContextMap as public API.

Exporting buildContextMap enables reuse in generateStorybookArgs.ts, avoiding code duplication. The function signature with explicit return type is well-defined.


223-259: Improved null safety in JSDoc link parsing.

The optional chaining and nullish coalescing (?.trim() ?? '') guards against undefined regex capture groups, making the parsing more robust for malformed or edge-case JSDoc tags.

omnidoc/generateStorybookArgs.ts (6)

1-31: Good initial setup with conservative rollout.

Starting with just 'Area' in STORYBOOK_AUTOMATED_ARG_COMPONENTS is a sensible approach to validate the generation before expanding to more components.


36-98: Well-structured control type detection.

The function correctly identifies simple types (boolean, number, string) and provides appropriate controls, while returning undefined for complex types that don't map well to Storybook controls. The string literal union detection for select controls is a nice touch.


100-126: Reasonable categorization logic.

The prop categorization into Events, Animation, Style, DOM, and General provides good organization in Storybook. The styleProps list appropriately includes strokeDasharray which aligns with the new Curve component prop.


131-202: Comprehensive arg generation logic.

The function properly handles descriptions, controls, categorization, default values, and deprecated markers. The special handling for color props (line 158) ensures they get color pickers in Storybook.


204-221: Clean file generation with proper header.

The auto-generated comment clearly marks the file as generated, and JSON.stringify with indentation produces readable output.


282-338: Robust main function with good error handling.

The function handles missing stories files gracefully (line 322-324), and the try/catch per component ensures one failure doesn't block generation for other components. Creating the output directory with recursive: true is defensive.

eslint.config.mjs (1)

398-400: Reasonable ESLint override for sequential doc generation.

Disabling no-await-in-loop for omnidoc scripts is justified. Sequential execution is acceptable for infrequent documentation generation tasks, and the comment explains the rationale clearly.

src/shape/Curve.tsx (1)

140-148: Well-documented strokeDasharray prop addition.

The JSDoc includes practical examples and an MDN reference, which is excellent for developer experience. The type string | number correctly matches the SVG attribute specification. The prop is properly included in svgPropertiesNoEvents and flows correctly through to the SVG path element.

omnidoc/cross-component-prop-comments.spec.ts (1)

7-7: LGTM: Defensive null checks strengthen type safety.

The assertNotNull calls provide runtime guarantees that complement TypeScript's type narrowing, even though the logic ensures these values are defined. This is good defensive programming for test code.

Also applies to: 52-52, 90-92

storybook/stories/API/arg-types/index.ts (1)

1-12: LGTM: Clear documentation and standard barrel export pattern.

The documentation comments provide helpful context about the auto-generation process and how to extend it.

storybook/stories/API/cartesian/Area.mdx (1)

12-27: LGTM: Documentation improvements enhance clarity and completeness.

The expanded parent component list, consistent plural terminology, and standard "Props" heading improve the documentation quality.

www/src/docs/api/LineAPI.tsx (1)

295-295: LGTM: Minor punctuation improvement.

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

7-7: LGTM: Consistent migration to auto-generated AreaArgs.

The changes correctly switch from AreaArgTypes to the new auto-generated AreaArgs throughout the file, aligning with the PR's automated Storybook ArgTypes generation.

Also applies to: 11-11, 45-45

omnidoc/readStorybookDoc.ts (1)

115-139: LGTM! Improved default value resolution.

The new logic correctly prioritizes argType.defaultValue (which can be any type) over table.defaultValue.summary (which must be a string), and properly handles the undefined case. This enhances the robustness of default value extraction from Storybook ArgTypes.

storybook/stories/API/arg-types/AreaArgs.ts (1)

1-1667: Auto-generated file structure looks correct.

This file is auto-generated (as noted in the header comment). The structure follows the StorybookArgs interface consistently, with proper descriptions, controls, type summaries, categories, and default values for all Area component props. If any issues are found with the generated content, they should be addressed in generateStorybookArgsFromSource.ts rather than editing this file directly.

Comment on lines +299 to +312
format: [
'strokeDasharray="5 5"',
'strokeDasharray={10}',
'<Line strokeDasharray="4" />',
'<Line strokeDasharray="4 1" />',
'<Line strokeDasharray="4 1 2" />',
],
examples: [
{
name: '://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray',
url: 'https',
isExternal: true,
},
],
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Fix the broken MDN reference and inconsistent format examples.

Two issues:

  1. Broken MDN reference (Lines 308-311): The name and url fields are incorrectly split:

    • name contains a partial URL without the protocol
    • url contains only 'https' instead of the full URL
  2. Inconsistent format examples (Lines 300-301): These examples use a different style than lines 302-304. The existing examples show complete JSX tags like <Line strokeDasharray="4" />, but the new entries show only attribute fragments.

🔎 Proposed fix
     format: [
-      'strokeDasharray="5 5"',
-      'strokeDasharray={10}',
       '<Line strokeDasharray="4" />',
       '<Line strokeDasharray="4 1" />',
       '<Line strokeDasharray="4 1 2" />',
+      '<Line strokeDasharray="5 5" />',
+      '<Line strokeDasharray={10} />',
     ],
     examples: [
       {
-        name: '://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray',
-        url: 'https',
+        name: 'MDN: stroke-dasharray',
+        url: 'https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray',
         isExternal: true,
       },
     ],
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
format: [
'strokeDasharray="5 5"',
'strokeDasharray={10}',
'<Line strokeDasharray="4" />',
'<Line strokeDasharray="4 1" />',
'<Line strokeDasharray="4 1 2" />',
],
examples: [
{
name: '://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray',
url: 'https',
isExternal: true,
},
],
format: [
'<Line strokeDasharray="4" />',
'<Line strokeDasharray="4 1" />',
'<Line strokeDasharray="4 1 2" />',
'<Line strokeDasharray="5 5" />',
'<Line strokeDasharray={10} />',
],
examples: [
{
name: 'MDN: stroke-dasharray',
url: 'https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray',
isExternal: true,
},
],
🤖 Prompt for AI Agents
In www/src/docs/api/LineAPI.tsx around lines 299 to 312, the MDN example entry
and format examples are wrong: update the examples array so every entry is a
full JSX tag string (e.g., '<Line strokeDasharray="5 5" />', '<Line
strokeDasharray={10} />', '<Line strokeDasharray="4" />', '<Line
strokeDasharray="4 1" />', '<Line strokeDasharray="4 1 2" />') to match the
style used elsewhere, and fix the examples object so the MDN reference has the
full URL in url and a descriptive name (e.g., name: 'MDN - stroke-dasharray',
url:
'https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray',
isExternal: true).

defaultVal: 10,
},
{ name: 'payloadUniqBy', type: 'false | true | UniqueFunc<Payload<TValue, TName>>', isOptional: true },
{ name: 'payloadUniqBy', type: 'false | true | UniqueFunc<TooltipPayloadEntry>', isOptional: true },
Copy link
Contributor

@coderabbitai coderabbitai bot Jan 3, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify TooltipPayloadEntry is exported and find its definition
echo "=== Searching for TooltipPayloadEntry export ==="
rg -n "export.*TooltipPayloadEntry" --type=ts --type=tsx

echo ""
echo "=== Searching for TooltipPayloadEntry type definition ==="
rg -n "type TooltipPayloadEntry" --type=ts --type=tsx

echo ""
echo "=== Check if it's exported from index/public API ==="
rg -n "TooltipPayloadEntry" recharts/src/index.ts recharts/index.ts 2>/dev/null || echo "Not found in main index files"

echo ""
echo "=== Check imports in TooltipAPI.tsx ==="
head -30 www/src/docs/api/TooltipAPI.tsx | grep -E "import.*TooltipPayloadEntry"

echo ""
echo "=== Check full import section of TooltipAPI.tsx ==="
sed -n '1,50p' www/src/docs/api/TooltipAPI.tsx

Repository: recharts/recharts

Length of output: 1735


🏁 Script executed:

#!/bin/bash
echo "=== Check line 263 of TooltipAPI.tsx ==="
sed -n '260,270p' www/src/docs/api/TooltipAPI.tsx

echo ""
echo "=== Broader search for TooltipPayloadEntry ==="
rg "TooltipPayloadEntry" --no-filename --max-count=20

echo ""
echo "=== Check if there's a types file with payload types ==="
find . -name "*tooltip*" -type f | grep -E "\.(ts|tsx)$" | head -20

echo ""
echo "=== Search for Payload type definition ==="
rg "type Payload" --max-count=10

Repository: recharts/recharts

Length of output: 2333


🏁 Script executed:

#!/bin/bash
echo "=== Check public API index files ==="
for file in recharts/index.ts recharts/index.js src/index.ts src/index.js index.ts index.js; do
  if [ -f "$file" ]; then
    echo "File: $file"
    grep -i "TooltipPayloadEntry" "$file" || echo "  (not found)"
  fi
done

echo ""
echo "=== Check full src/index.ts for tooltipSlice exports ==="
rg "from.*tooltipSlice" src/index.ts 2>/dev/null || echo "Not found"

echo ""
echo "=== Check what's actually exported from tooltipSlice ==="
rg "^export" src/state/tooltipSlice.ts | head -30

echo ""
echo "=== Check if TooltipAPI.tsx has any imports ==="
rg "^import" www/src/docs/api/TooltipAPI.tsx | head -20

Repository: recharts/recharts

Length of output: 1344


Export TooltipPayloadEntry from the public API or update the documentation.

The payloadUniqBy prop documentation references UniqueFunc<TooltipPayloadEntry>, but TooltipPayloadEntry is not exported from the public API. While it's defined in src/state/tooltipSlice.ts, only TooltipIndex is exported in src/index.ts. Users cannot import TooltipPayloadEntry without violating the public API restriction and accessing internal paths. Either export the type from the recharts package or revise the documentation to reference an available alternative.

🤖 Prompt for AI Agents
In www/src/docs/api/TooltipAPI.tsx around line 263, the docs reference
UniqueFunc<TooltipPayloadEntry> but TooltipPayloadEntry is not part of the
public API; either export the TooltipPayloadEntry type from the package or
change the docs to reference an exported type. To fix, add TooltipPayloadEntry
to the public exports (ensure the type is exported from
src/state/tooltipSlice.ts and then re-export it from src/index.ts) so consumers
can import it, or update TooltipAPI.tsx to use an existing exported type (e.g.,
TooltipIndex or a generic payload type) and remove the internal
TooltipPayloadEntry reference so documentation only mentions public API types.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I will fix this in separate PR

Copy link
Contributor

Choose a reason for hiding this comment

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

@PavelVanecek, sounds good! Would you like me to create a GitHub issue to track this work for the separate PR?


🧠 Learnings used
Learnt from: PavelVanecek
Repo: recharts/recharts PR: 6669
File: www/src/docs/exampleComponents/ScatterChart/ScatterChartWithLabels.tsx:2-2
Timestamp: 2025-11-23T13:30:10.395Z
Learning: The `TooltipIndex` type from recharts is defined in `src/state/tooltipSlice.ts` but is not currently exported from the public API entry points. It should not be imported from `recharts/types/state/tooltipSlice` as this is an internal implementation path. An ESLint rule is needed to prevent regressions.

Learnt from: CR
Repo: recharts/recharts PR: 0
File: DEVELOPING.md:0-0
Timestamp: 2025-12-26T15:59:11.254Z
Learning: Applies to **/*.{ts,tsx} : All imports from `recharts` must use the public API entry point (e.g., `import { TooltipIndex } from 'recharts'`). Imports from internal paths like `recharts/types/*` or `recharts/src/*` are not allowed and will fail the linter.

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

@codecov
Copy link

codecov bot commented Jan 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.85%. Comparing base (8bb5aa4) to head (81e7f58).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6845   +/-   ##
=======================================
  Coverage   93.85%   93.85%           
=======================================
  Files         531      532    +1     
  Lines       49391    49474   +83     
  Branches     5163     5166    +3     
=======================================
+ Hits        46355    46436   +81     
- Misses       3029     3031    +2     
  Partials        7        7           

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

@github-actions
Copy link
Contributor

github-actions bot commented Jan 3, 2026

Staging Deployment Details

These deployments will remain available for 30 days.

To update snapshots: Comment /update-snapshots on this PR to automatically update the baseline screenshots.

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

♻️ Duplicate comments (1)
www/src/docs/api/LineAPI.tsx (1)

309-322: Fix the broken MDN reference and inconsistent format examples.

The issues flagged in the previous review remain unresolved:

  1. Broken MDN reference (Lines 318-320): The name field contains the full URL instead of a user-friendly description. It should be something like 'MDN: stroke-dasharray' or 'MDN - stroke-dasharray'.

  2. Inconsistent format examples (Lines 310-311): These examples use bare attribute syntax (strokeDasharray="5 5" and strokeDasharray={10}), while lines 312-314 use complete JSX tag syntax (<Line strokeDasharray="4" />). All format examples should follow the same pattern for consistency.

🔎 Proposed fix
     format: [
-      'strokeDasharray="5 5"',
-      'strokeDasharray={10}',
       '<Line strokeDasharray="4" />',
       '<Line strokeDasharray="4 1" />',
       '<Line strokeDasharray="4 1 2" />',
+      '<Line strokeDasharray="5 5" />',
+      '<Line strokeDasharray={10} />',
     ],
     examples: [
       {
-        name: 'https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray',
+        name: 'MDN: stroke-dasharray',
         url: 'https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray',
         isExternal: true,
       },
     ],
🧹 Nitpick comments (1)
omnidoc/generateApiDoc.ts (1)

224-260: Consider initializing variables at declaration.

The function correctly handles all code paths and the optional chaining improvements (lines 232, 239) add robustness. However, declaring url and name without initialization (line 225) could be clearer.

🔎 Proposed refactor for improved clarity
-export function parseJSDocLinkTag(tag: string): PropExample {
-  let url: string, name: string;
+export function parseJSDocLinkTag(tag: string): PropExample {
+  let url = '';
+  let name = '';

This makes the code more readable and avoids relying on flow analysis to prove initialization.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a149052 and 81e7f58.

📒 Files selected for processing (23)
  • omnidoc/generateApiDoc.spec.ts
  • omnidoc/generateApiDoc.ts
  • omnidoc/parseJSDocLinkTag.spec.ts
  • omnidoc/readProject.spec.ts
  • src/shape/Curve.tsx
  • www/src/docs/api/AreaAPI.tsx
  • www/src/docs/api/BrushAPI.tsx
  • www/src/docs/api/LabelAPI.tsx
  • www/src/docs/api/LabelListAPI.tsx
  • www/src/docs/api/LineAPI.tsx
  • www/src/docs/api/PieChartAPI.tsx
  • www/src/docs/api/PolarAngleAxisAPI.tsx
  • www/src/docs/api/PolarGridAPI.tsx
  • www/src/docs/api/PolarRadiusAxisAPI.tsx
  • www/src/docs/api/RadarChartAPI.tsx
  • www/src/docs/api/RadialBarChartAPI.tsx
  • www/src/docs/api/ReferenceAreaAPI.tsx
  • www/src/docs/api/ReferenceDotAPI.tsx
  • www/src/docs/api/ReferenceLineAPI.tsx
  • www/src/docs/api/ResponsiveContainerAPI.tsx
  • www/src/docs/api/SankeyAPI.tsx
  • www/src/docs/api/ScatterAPI.tsx
  • www/src/docs/api/TooltipAPI.tsx
✅ Files skipped from review due to trivial changes (1)
  • omnidoc/parseJSDocLinkTag.spec.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • www/src/docs/api/TooltipAPI.tsx
  • www/src/docs/api/AreaAPI.tsx
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{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

All imports from recharts must use the public API entry point (e.g., import { TooltipIndex } from 'recharts'). Imports from internal paths like recharts/types/* or recharts/src/* are not allowed and will fail the linter.

Files:

  • www/src/docs/api/ResponsiveContainerAPI.tsx
  • www/src/docs/api/ReferenceAreaAPI.tsx
  • www/src/docs/api/PolarAngleAxisAPI.tsx
  • src/shape/Curve.tsx
  • omnidoc/generateApiDoc.spec.ts
  • www/src/docs/api/BrushAPI.tsx
  • www/src/docs/api/PolarRadiusAxisAPI.tsx
  • www/src/docs/api/LabelListAPI.tsx
  • omnidoc/readProject.spec.ts
  • www/src/docs/api/ReferenceLineAPI.tsx
  • www/src/docs/api/PolarGridAPI.tsx
  • www/src/docs/api/ScatterAPI.tsx
  • www/src/docs/api/SankeyAPI.tsx
  • omnidoc/generateApiDoc.ts
  • www/src/docs/api/LabelAPI.tsx
  • www/src/docs/api/RadarChartAPI.tsx
  • www/src/docs/api/PieChartAPI.tsx
  • www/src/docs/api/ReferenceDotAPI.tsx
  • www/src/docs/api/RadialBarChartAPI.tsx
  • www/src/docs/api/LineAPI.tsx
**/*.{js,ts,tsx}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

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

Files:

  • www/src/docs/api/ResponsiveContainerAPI.tsx
  • www/src/docs/api/ReferenceAreaAPI.tsx
  • www/src/docs/api/PolarAngleAxisAPI.tsx
  • src/shape/Curve.tsx
  • omnidoc/generateApiDoc.spec.ts
  • www/src/docs/api/BrushAPI.tsx
  • www/src/docs/api/PolarRadiusAxisAPI.tsx
  • www/src/docs/api/LabelListAPI.tsx
  • omnidoc/readProject.spec.ts
  • www/src/docs/api/ReferenceLineAPI.tsx
  • www/src/docs/api/PolarGridAPI.tsx
  • www/src/docs/api/ScatterAPI.tsx
  • www/src/docs/api/SankeyAPI.tsx
  • omnidoc/generateApiDoc.ts
  • www/src/docs/api/LabelAPI.tsx
  • www/src/docs/api/RadarChartAPI.tsx
  • www/src/docs/api/PieChartAPI.tsx
  • www/src/docs/api/ReferenceDotAPI.tsx
  • www/src/docs/api/RadialBarChartAPI.tsx
  • www/src/docs/api/LineAPI.tsx
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/shape/Curve.tsx
**/*.spec.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

When running unit tests, prefer to run a single test file using npm run test -- path/to/TestFile.spec.tsx rather than running all tests with npm test

Unit tests should be placed in the test directory, with some tests also allowed in www/test. Test files follow the naming convention *.spec.tsx.

Files:

  • omnidoc/generateApiDoc.spec.ts
  • omnidoc/readProject.spec.ts
🧠 Learnings (10)
📓 Common learnings
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
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 : Use Storybook for smoke tests and add play functions with assertions for actual tests
Learnt from: CR
Repo: recharts/recharts PR: 0
File: DEVELOPING.md:0-0
Timestamp: 2025-12-26T15:59:11.254Z
Learning: Applies to **/*.stories.{ts,tsx} : When adding new Storybook stories, prioritize high-fidelity examples that you want published on the website and in the Storybook UI. Use low-fidelity tests in unit tests or visual regression tests instead to avoid exceeding the Chromatic open source plan limits.
📚 Learning: 2025-12-16T08:12:13.355Z
Learnt from: PavelVanecek
Repo: recharts/recharts PR: 6783
File: test/util/ChartUtils.spec.tsx:15-16
Timestamp: 2025-12-16T08:12:13.355Z
Learning: In the recharts codebase, files in the `test` folder are allowed to import from internal paths (e.g., `../../src/state/cartesianAxisSlice`) and do not need to use the public API entry point (`src/index.ts`). The public API import restriction applies only to non-test code.

Applied to files:

  • www/src/docs/api/ReferenceAreaAPI.tsx
  • omnidoc/generateApiDoc.spec.ts
  • www/src/docs/api/PieChartAPI.tsx
📚 Learning: 2025-12-26T15:59:11.254Z
Learnt from: CR
Repo: recharts/recharts PR: 0
File: DEVELOPING.md:0-0
Timestamp: 2025-12-26T15:59:11.254Z
Learning: Applies to **/*.{ts,tsx} : All imports from `recharts` must use the public API entry point (e.g., `import { TooltipIndex } from 'recharts'`). Imports from internal paths like `recharts/types/*` or `recharts/src/*` are not allowed and will fail the linter.

Applied to files:

  • www/src/docs/api/ReferenceAreaAPI.tsx
  • www/src/docs/api/PieChartAPI.tsx
📚 Learning: 2025-11-23T13:30:10.395Z
Learnt from: PavelVanecek
Repo: recharts/recharts PR: 6669
File: www/src/docs/exampleComponents/ScatterChart/ScatterChartWithLabels.tsx:2-2
Timestamp: 2025-11-23T13:30:10.395Z
Learning: The `TooltipIndex` type from recharts is defined in `src/state/tooltipSlice.ts` but is not currently exported from the public API entry points. It should not be imported from `recharts/types/state/tooltipSlice` as this is an internal implementation path. An ESLint rule is needed to prevent regressions.

Applied to files:

  • www/src/docs/api/PolarAngleAxisAPI.tsx
  • www/src/docs/api/PolarRadiusAxisAPI.tsx
  • www/src/docs/api/PieChartAPI.tsx
  • www/src/docs/api/ReferenceDotAPI.tsx
📚 Learning: 2025-12-14T13:58:49.197Z
Learnt from: PavelVanecek
Repo: recharts/recharts PR: 6771
File: src/shape/Curve.tsx:39-40
Timestamp: 2025-12-14T13:58:49.197Z
Learning: In the recharts codebase, hooks like useAppSelector and other hooks (e.g., useChartLayout()) return undefined when used outside Redux Provider context, instead of throwing. This enables components that call these hooks, such as Curve, to operate in standalone mode by falling back to prop values. During code reviews, ensure TSX files gracefully handle undefined results from hooks and implement fallbacks (e.g., via default props or explicit prop-based values) rather than assuming the hook is always within Provider.

Applied to files:

  • src/shape/Curve.tsx
📚 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:

  • omnidoc/generateApiDoc.spec.ts
📚 Learning: 2025-11-25T01:23:08.250Z
Learnt from: CR
Repo: recharts/recharts PR: 0
File: test/README.md:0-0
Timestamp: 2025-11-25T01:23:08.250Z
Learning: Applies to test/**/*.{test,spec}.{ts,tsx} : Verify the number of selector calls using the spy object from `createSelectorTestCase` to spot unnecessary re-renders and improve performance

Applied to files:

  • omnidoc/generateApiDoc.spec.ts
📚 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 test/component/**/*.spec.tsx : Use React Testing Library for testing component interactions and behavior upon rendering

Applied to files:

  • omnidoc/generateApiDoc.spec.ts
📚 Learning: 2025-11-25T01:23:08.250Z
Learnt from: CR
Repo: recharts/recharts PR: 0
File: test/README.md:0-0
Timestamp: 2025-11-25T01:23:08.250Z
Learning: Applies to test/**/*.{test,spec}.{ts,tsx} : Prefer to use the `createSelectorTestCase` helper function when writing or modifying tests

Applied to files:

  • omnidoc/readProject.spec.ts
📚 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: Provide a reduced test case and live examples (e.g., via CodeSandbox) when reporting bugs

Applied to files:

  • www/src/docs/api/LineAPI.tsx
🧬 Code graph analysis (2)
omnidoc/readProject.spec.ts (2)
test/helper/assertNotNull.ts (1)
  • assertNotNull (1-5)
omnidoc/readProject.ts (1)
  • getTagText (28-38)
omnidoc/generateApiDoc.ts (1)
www/src/docs/api/types.ts (1)
  • PropExample (4-8)
⏰ 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 (25)
www/src/docs/api/BrushAPI.tsx (1)

185-186: LGTM! Explicit isExternal flags improve type safety.

The addition of isExternal: false correctly identifies these as internal routes and aligns with the project-wide pattern of making link metadata explicit in API documentation.

www/src/docs/api/ResponsiveContainerAPI.tsx (1)

189-189: LGTM! Link metadata standardization looks correct.

The addition of isExternal: false appropriately marks this relative URL as an internal link, which aligns with the PR's standardization effort for link metadata across API docs.

www/src/docs/api/RadarChartAPI.tsx (1)

120-120: LGTM! Consistent metadata enrichment.

The addition of isExternal: false to the examples arrays for the height, responsive, and width props is correct and consistent. The flag value appropriately marks the '/guide/sizes/' reference as an internal documentation link.

Also applies to: 203-203, 268-268

www/src/docs/api/ScatterAPI.tsx (1)

226-226: LGTM! Consistent metadata updates.

The additions of isExternal: false to internal documentation links are correct and follow the established pattern. All URLs starting with / are properly marked as internal, maintaining consistency with external links already marked with isExternal: true elsewhere in the file.

Also applies to: 320-322, 367-367, 385-385

www/src/docs/api/PolarGridAPI.tsx (1)

126-126: LGTM! Documentation metadata enhancement.

Adding the isExternal: false flag explicitly marks this as an internal documentation link, improving clarity for documentation generation tools.

www/src/docs/api/PolarAngleAxisAPI.tsx (1)

491-491: LGTM! Consistent documentation metadata.

The isExternal: false flag correctly identifies this as an internal documentation reference, aligning with the broader PR pattern.

www/src/docs/api/ReferenceAreaAPI.tsx (1)

66-68: LGTM! Documentation metadata improvements.

Both additions of isExternal: false correctly identify internal documentation references (the example page and the Z-Index guide), enhancing metadata consistency.

Also applies to: 227-227

www/src/docs/api/LabelAPI.tsx (1)

164-164: LGTM! Documentation metadata enhancement.

The isExternal: false flag appropriately marks the Z-Index guide as an internal documentation link.

www/src/docs/api/PieChartAPI.tsx (1)

120-120: LGTM! Consistent documentation metadata.

All three additions of isExternal: false correctly identify the Chart sizing guide as an internal documentation reference, maintaining consistency across the height, responsive, and width props.

Also applies to: 203-203, 268-268

www/src/docs/api/RadialBarChartAPI.tsx (1)

120-120: LGTM! Consistent metadata enrichment.

The addition of isExternal: false to internal example links for the height, responsive, and width props is consistent with the broader documentation enhancement pattern across this PR.

Also applies to: 203-203, 268-268

omnidoc/readProject.spec.ts (4)

3-3: LGTM! New export being tested.

The addition of getTagText to imports aligns with the new test coverage added later in this file and the export from readProject.ts.


1018-1021: LGTM! Improved null safety.

The use of optional chaining and assertNotNull adds appropriate defensive programming to the test, ensuring the deprecated tag exists before accessing its properties.


1061-1061: LGTM! Consistent with metadata enrichment.

The updated expectation to include isExternal: false aligns with the broader pattern of explicitly marking internal example links across the PR.


1073-1081: LGTM! Well-structured test for new utility.

The test properly validates the getTagText function by:

  • Extracting prop metadata for strokeDasharray
  • Using assertNotNull for proper null checks
  • Verifying the extracted JSDoc @see tag text matches expected format
www/src/docs/api/ReferenceLineAPI.tsx (1)

64-66: LGTM! Consistent metadata enrichment.

The addition of isExternal: false to internal example links for the label and zIndex props properly marks these as internal documentation references.

Also applies to: 186-186

www/src/docs/api/SankeyAPI.tsx (1)

76-76: LGTM! Consistent metadata enrichment.

The addition of isExternal: false to internal example links for height and width props follows the consistent pattern across the PR for marking internal documentation references.

Also applies to: 229-229

www/src/docs/api/PolarRadiusAxisAPI.tsx (1)

424-424: LGTM! Consistent metadata enrichment.

The addition of isExternal: false to the internal zIndex guide link completes the consistent pattern of explicitly marking internal documentation references across API documentation files.

www/src/docs/api/ReferenceDotAPI.tsx (1)

171-171: LGTM!

The addition of isExternal: false correctly marks this internal guide link and aligns with the PR's pattern of explicitly distinguishing internal from external references.

www/src/docs/api/LineAPI.tsx (1)

29-31: LGTM!

The addition of isExternal: false correctly marks internal example links throughout the file, maintaining consistency with the PR's pattern of explicitly distinguishing internal from external references.

Also applies to: 88-92, 143-145, 231-233, 351-355, 417-417

omnidoc/generateApiDoc.spec.ts (1)

70-70: LGTM!

The updated assertion correctly reflects that internal Recharts links now explicitly have isExternal: false rather than leaving it undefined, improving API clarity and type safety.

omnidoc/generateApiDoc.ts (2)

137-167: LGTM!

Exporting buildContextMap makes this utility function available for broader use, which is appropriate for supporting the omnidoc tooling ecosystem.


258-258: LGTM!

Simplifying from the ternary isExternal ? true : false to just isExternal is correct since the variable is already a boolean, making the code cleaner.

www/src/docs/api/LabelListAPI.tsx (2)

171-171: Consistent metadata addition following established patterns.

The isExternal: false flag correctly identifies the z-index guide as an internal link. The structure matches the content prop example (lines 49-55), and the referenced guide exists at www/src/components/GuideView/ZIndex/.


49-55: LGTM! Explicit isExternal metadata improves clarity.

The addition of isExternal: false correctly identifies these as internal documentation links. Both URL references are valid within the application's routing structure—/examples/BarChartWithMinHeight/ maps to the BarChartWithMinHeight example component, and /guide/zIndex/ maps to the registered zIndex guide. The changes follow the repository-wide standardization pattern.

src/shape/Curve.tsx (1)

140-147: Prop addition is correct; runtime integration confirmed.

The JSDoc documentation is clear with helpful examples and proper MDN reference. The type string | number correctly matches the SVG stroke-dasharray specification.

The prop is properly passed through to the SVG element via svgPropertiesNoEvents, which includes strokeDasharray in its whitelist of valid SVG properties. The Storybook story already demonstrates the prop usage.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 3, 2026

Staging Deployment Details

These deployments will remain available for 30 days.

To update snapshots: Comment /update-snapshots on this PR to automatically update the baseline screenshots.

@codecov
Copy link

codecov bot commented Jan 4, 2026

Bundle Report

Changes will increase total bundle size by 7.55kB (0.27%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
recharts/bundle-cjs 1.2MB 3.07kB (0.26%) ⬆️
recharts/bundle-es6 1.04MB 2.95kB (0.28%) ⬆️
recharts/bundle-umd 529.33kB 1.53kB (0.29%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: recharts/bundle-umd

Assets Changed:

Asset Name Size Change Total Size Change (%)
Recharts.js 1.53kB 529.33kB 0.29%
view changes for bundle: recharts/bundle-es6

Assets Changed:

Asset Name Size Change Total Size Change (%)
component/Label.js -4.76kB 14.02kB -25.37%
cartesian/getCartesianPosition.js (New) 7.72kB 7.72kB 100.0% 🚀
view changes for bundle: recharts/bundle-cjs

Assets Changed:

Asset Name Size Change Total Size Change (%)
component/Label.js -4.89kB 15.75kB -23.71%
cartesian/getCartesianPosition.js (New) 7.97kB 7.97kB 100.0% 🚀

Copy link
Member

@ckifer ckifer left a comment

Choose a reason for hiding this comment

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

I thought you were giving up on storybook lol

@ckifer ckifer merged commit 55bf209 into main Jan 4, 2026
43 checks passed
@PavelVanecek PavelVanecek deleted the generateStorybookArgs branch January 4, 2026 04:49
@PavelVanecek
Copy link
Collaborator Author

I'm still contemplating. This was easy to do.

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