Skip to content

fix react-ui invalid chart geometry - #986

Draft
vishxrad wants to merge 1 commit into
mainfrom
agent/fix-invalid-chart-geometry
Draft

fix react-ui invalid chart geometry#986
vishxrad wants to merge 1 commit into
mainfrom
agent/fix-invalid-chart-geometry

Conversation

@vishxrad

Copy link
Copy Markdown
Contributor

Summary

  • skip LineInBarShape rendering while Recharts supplies non-finite responsive-layout geometry
  • render normally again once a later layout pass supplies valid dimensions
  • add regression coverage for valid SVG output and non-finite x, y, width, and height values

Root cause

Recharts can briefly provide NaN dimensions while measuring a responsive bar chart, including charts in containers that have not finished layout. LineInBarShape used those values as SVG path and line coordinates, producing invalid DOM attributes and React warnings.

The custom shape now validates all DOM-bound geometry at its render boundary and returns null only for the invalid pass. It remains stateless and renders normally when Recharts provides finite geometry.

Validation

  • pnpm --filter @openuidev/react-ui run ci (39 tests)
  • pnpm --filter @openuidev/react-ui run typecheck
  • pnpm --filter @openuidev/react-ui run build

Extracted from #985 to keep the assistant-ui package change focused.

@vercel

vercel Bot commented Aug 14, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
openui-docs Ready Ready Preview Aug 14, 2026 1:57pm

Request Review

@vishxrad
vishxrad marked this pull request as ready for review August 14, 2026 13:55
@vishxrad
vishxrad marked this pull request as draft August 14, 2026 13:55
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