fix(dashboard): restore ResponsiveContainer in ChartContainer#535
Merged
fix(dashboard): restore ResponsiveContainer in ChartContainer#535
Conversation
The dashboard's ChartContainer was missing Recharts' ResponsiveContainer wrapper and the aspect-video CSS class, causing charts to render with no dimensions. The ChartWrapper was using a cloneElement hack to compensate, but this broke after tooltip sync changes. Restore ResponsiveContainer and aspect-video to match the OSS implementation, and remove the now-unnecessary cloneElement workaround.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why we need this PR?
After the tooltip sync changes in #534, dashboard overview charts stopped rendering. The root cause is that the dashboard's
ChartContainerwas missing Recharts'ResponsiveContainerwrapper (present in the OSS version), which gives charts their dimensions. TheChartWrapperhad acloneElementworkaround injectingresponsive: trueand inline styles, but this conflicted with how Recharts expects to manage sizing.Describe your solution
ResponsiveContainerwrapper indashboard/components/ui/chart.tsxto match the OSS implementationaspect-videoCSS class for proper container sizingchildrentype to matchResponsiveContainer's expected children typecloneElementhack inChartWrapperthat is no longer neededImplementation Tasks
ResponsiveContainerinChartContaineraspect-videoclasscloneElementworkaround inChartWrappercloneElementimportImpact Areas
Checklist
devbranch.