refactor: consolidate charts with BarChart component#7223
refactor: consolidate charts with BarChart component#7223talissoncosta wants to merge 4 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
8ce136f to
0ec66cd
Compare
…rts SCSS Replaces the two raw-recharts consumers with the shared <BarChart /> component introduced in #7215. Both pages keep their behaviour and visual contract; the JSX collapses substantially. BarChart API additions to support these consumers: - `barSize?: number` — fixed bar width in pixels (OrganisationUsage uses 14px to fit four series per day comfortably) - `verticalGrid?: boolean` (default true) — toggles CartesianGrid's vertical lines (legacy charts hide them) Migrations: - OrganisationUsage.container.tsx (4 metric series stacked, custom display labels via seriesLabels, selection-driven series filter, pre-formatted day axis) - SingleSDKLabelsChart.tsx (per-SDK stacked, palette colour map passed in from parent, MultiSelect-driven SDK filter) - OrganisationUsageMetrics.container.tsx — pre-formats day to 'D MMM' (matches the new chart-side day-as-display-string contract), switches userAgentColorMap from Map to Record (consistent with BarChart's prop after #7215) Cleanup: - Delete web/styles/3rdParty/_recharts.scss entirely — its rules existed solely to style the two legacy charts' tooltips. With both consumers migrated, no consumer of recharts global classNames remains; the new BarChart's ChartTooltip uses Bootstrap utilities + semantic token classes directly. Drop the @import too. - SingleSDKLabelsChart loses unused props (`metricKey`, `colours`) that the migration made redundant. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1444d90 to
27debb5
Compare
AggregateUsageDataItem has `number | null` fields; ChartDataPoint expects `number`. Explicitly coalesce nulls to 0 in the mapping instead of bypassing with a type assertion. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replaces the bare "No usage recorded." text with the reusable EmptyState component (icon + title + description) — consistent with the Feature Analytics chart empty state pattern. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Show the EmptyState component instead of rendering an empty chart with bare axes when there's no SDK data. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Code review is billed via overage credits. To resume reviews, an organization admin can raise the monthly limit at claude.ai/admin-settings/claude-code.
Once credits are available, reopen this pull request to trigger a review.
Docker builds report
|
Playwright Test Results (oss - depot-ubuntu-latest-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
|
Visual Regression16 screenshots compared. See report for details. |
Changes
Follow-up to #7215 — migrates the two remaining raw-recharts consumers to the shared
<BarChart />component.Migrated
OrganisationUsage<BarChart>call. UsesseriesLabelsfor display names,MetricDataKeytypedRecordfor compile-time key completeness. Null metric values coalesced to 0.SingleSDKLabelsChart<BarChart>withshowLegend.OrganisationUsageMetrics'D MMM', switchesMap→Record<string, string>, removes unused props.BarChart API additions
barSize?: number— fixed bar width (OrganisationUsage uses 14px)verticalGrid?: boolean— toggles vertical grid lines (defaulttrue)Empty states
Both charts now use the
EmptyStatecomponent instead of bare text or empty axes — consistent with the Feature Analytics pattern from #7215.Cleanup
web/styles/3rdParty/_recharts.scss— legacy tooltip rules +.dark {}block no longer needed@import "recharts"from_index.scssVisual comparison
Expected: no visual changes on the chart itself. Empty states are improved.
How did you test this code?