Repository navigation
fix(ai-components): chart and markdown fixes - #3320
Conversation
β¦hart renderer Only json fences that hold a Chart.js config take the chart path; any other JSON stays highlighted code instead of flashing 'Loading chart...' and loading the chart chunk. chartjs fences are unchanged.
β¦ WebKit ::selection shared a selector list with ::-moz-selection, so browsers that do not know the -moz- pseudo-element dropped the whole rule.
β¦ charts render react-chartjs-2 registers only each chart type's controller; radar and polarArea default to the radialLinear scale, which was never registered, so those configs fell back to raw code.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the βοΈ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
|
Size Change: +1.97 kB (+0.18%) Total Size: 1.13 MB π¦ View Changed
βΉοΈ View Unchanged
|
Codecov Reportβ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release-v14 #3320 +/- ##
===============================================
+ Coverage 85.63% 85.67% +0.03%
===============================================
Files 521 523 +2
Lines 16555 16590 +35
Branches 5208 5218 +10
===============================================
+ Hits 14177 14213 +36
+ Misses 2378 2377 -1 β View full report in Codecov by Harness. π New features to boost your workflow:
|
## [14.13.2](v14.13.1...v14.13.2) (2026-10-13) ### Bug Fixes * **ai-components:** chart and markdown fixes ([#3320](#3320)) ([8c1b9bf](8c1b9bf)), closes [#3314](#3314) [#3315](#3315) * **VirtualizedMessageList:** keep the last message fully visible in short lists ([#3317](#3317)) ([1a6021e](1a6021e))
|
π This PR is included in version 14.13.2 π The release is available on: Your semantic-release bot π¦π |
π― Goal
Fix three
stream-chat-react/ai-componentsbugs that shipped in 14.13.0 (#3314). They are inherited from@stream-io/chat-react-aiand were found by CodeRabbit on the v15 port (#3315). This PR is the v14 port of the same fixes.π Implementation details
```jsonblocks render as code (AIMarkdown).jsonfence went to the chart renderer, so ordinary JSON in a model reply (an API response, a config) showed "Loading chart..." and loaded the chart.js chunk.jsonfence takes the chart path only when it holds a Chart.js config. The check is a cheap structural one (chartTypes.ts), with no zod or chart.js in the eager graph, and the full schema validation still runs in the lazy chunk.chartjsfences are unchanged.::selectionshared a selector list with::-moz-selection, so browsers that don't know the-moz-variant dropped the whole rule. Current Firefox supports::selection.react-chartjs-2registers only each chart type's controller, and those two default to theradialLinearscale, which was never registered. They passed the schema, then fell back to the raw code.RadialLinearScaleis now registered.alttext on the logo link.Tests
AIMarkdown.test.tsx: a plainjsonfence renders highlighted code with no "Loading chart..."; ajsonfence holding a Chart.js config still takes the chart path.chartRegistration.test.ts: for every chart type the schema accepts, its controller and default scales are registered once the chart module loads. On v15, polarArea and radar failed this test before the fix. It checks the registry because jsdom has no canvas, so Chart.js returns before building scales and a render test can't see the bug.Verification
yarn types,yarn build,validate-cjs,validate-esm,validate-entry-isolationandvalidate-translationsall pass.fixcommits plus onedocscommit, so this is a patch (14.13.2).π¨ UI Changes