Uh oh!
There was an error while loading. Please reload this page.
fix(plugin-charts,components): dashboard charts blank on first paint (ResponsiveContainer width(-1)) - #1634
Merged
Merged
Conversation
…siveContainer measures real width
Recharts' <ResponsiveContainer> was a child of a `flex ... justify-center`
container, so on the main axis it collapsed to content width (0) on first
paint inside react-grid-layout. Recharts then measured width(-1)/height(-1)
and skipped drawing, leaving dashboard charts (funnel, donut, area, …) blank
on initial load until a later resize fired its ResizeObserver.
Switch the chart wrapper to a definite-width block (drop `flex`/`justify-center`,
use `w-full` / `aspect-video w-full`) in both the dashboard chart container
(ChartContainerImpl) and the shadcn base (components/ui/chart) so the chart
always fills its box and renders on first paint. The empty-state ("No rows")
is a separate component and is unaffected.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
Uh oh!
There was an error while loading. Please reload this page.
os-zhuang added a commit
that referenced
this pull request
Jun 11, 2026
…ix (#1634) (#1635) #1634 fixed dashboard charts rendering blank on first paint but merged without a changeset. Add a patch changeset so the fix is credited in the next release changelog (plugin-charts/components are in the fixed version group, so the fix already ships either way). Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
os-zhuang added a commit
that referenced
this pull request
Jul 30, 2026
…ery tracked component now says why it diverges (#3059) Completes the triage. All 17 locally-modified components now carry a `localEdits` note; `--check` reports 0 UNDOCUMENTED. None of the nine are droppable either. Like the first eight, every one is a deliberate fix or API extension: command ADR-0054 C4 `contentProps` + the `sr-only` DialogTitle Radix requires. Upstream drops each addition with its usages, so a sync deletes ~38 lines and still type-checks — verified. select Wraps Root to swallow `onValueChange("")`. Radix's hidden native mirror registers options a commit after the trigger, so a value arriving mid-hydration echoes back empty and wipes the field, latching forms whose `visibleWhen` reads it (#2968). table `containerClassName`, to stop the wrapper becoming a second height-unbounded scroll container inside DataTable. chart `block … w-full` instead of `flex justify-center`, or ResponsiveContainer measures no width and charts draw axes with no marks (#1634, 9b16317); plus hand-written Recharts prop types that actually type-check (2e11aa7). sidebar Tailwind v4 syntax, a `data-collapsible`-always-present refactor, and an `eslint-disable react-hooks/purity` the random skeleton width needs. badge `whitespace-nowrap`, or CJK labels break per-character in a cramped table cell (objectui#2762 P0-1). slider Forwards `aria-label` to the Thumb. sheet `hideOverlay` prop. calendar Tailwind v4 syntax on `--cell-size`. Two claims I checked rather than asserted, because both could have shipped as confident wrong statements: - Removing sidebar's `eslint-disable` really does fail Lint — it is an error from `react-hooks/purity`, not a warning, and Lint gates CI. - `theme(spacing.4)` → `1rem` is **cosmetic**, not a fix. Tailwind 4.3.3 still resolves the v3 dot-notation, and both spellings compile to the identical `calc(var(--sidebar-width-icon) + 1rem)`. The note says so; only the `[--var]` → `(--var)` half of that migration is load-bearing. Also corrects a misleading `--check` label. The counts are set differences, so a locally-edited line appears on BOTH sides — once as ours, once as the upstream original it replaced. Calling that "N upstream line(s) pending" reads as updates waiting to be collected, which is how I misread sidebar's 21 as reclaimable work; it is mostly the mirror image of sidebar's own edits. Now "N not matching upstream verbatim". The `outdated` bucket keeps its wording — there `localOnly` is 0, so the count genuinely is new upstream work. Manifest and script only; no component source changes. Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com> Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
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 freeto 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.
Problem
Dashboard charts (funnel, donut, area, …) render blank on initial load and only appear after a window resize / layout change. The console is flooded with:
Root cause
Every dashboard chart renders through
AdvancedChartImpl→ChartContainerinpackages/plugin-charts/src/ChartContainerImpl.tsx. That container wasflex w-full h-[350px] justify-center, and Recharts'<ResponsiveContainer width="100%" height="100%">was its flex child. In ajustify-centerflex row the child is sized to its content on the main axis, so on first paint insidereact-grid-layout(before the grid applies column widths) it collapsed to width 0 → Recharts measuredwidth(-1)and skipped drawing. It only recovered when a later resize firedResponsiveContainer'sResizeObserver. The existingminHeight: 280guard fixed height but not the width collapse.The shadcn base
packages/components/src/ui/chart.tsx(flex aspect-video justify-center, dimensionless<ResponsiveContainer>) has the same latent issue.Fix
Give
ResponsiveContainera definite-width block parent instead of a width-collapsing centered flexbox:plugin-charts/ChartContainerImpl.tsx:flex … justify-center→block w-full h-[350px](min-size guard kept).components/ui/chart.tsx:flex aspect-video justify-center→block aspect-video w-full.The
"No rows"empty state is a separate component (plugin-dashboard/DatasetWidget.tsx) and is unaffected; flex-centering was vestigial for the chart path (the only child isResponsiveContainer, which fills 100%).Verification
@object-ui/plugin-chartstype-check✅ andtest✅ (11/11).plugin-list/ListView.test.tsx(viewType normalization, fix(plugin-list): normalize viewType 'list'/missing/unknown to the grid renderer #1632 /fix/listview-default-grid) — untouched by this change.recharts-trapezoidcount = 0; after any resize the same charts paint correctly (data was always present). This change makes them paint on first load.🤖 Generated with Claude Code