Skip to content

Add BarChartSkeleton and LineChartSkeleton components#6142

Open
simeonlee wants to merge 2 commits intomainfrom
simeonlee/chart-skeletons
Open

Add BarChartSkeleton and LineChartSkeleton components#6142
simeonlee wants to merge 2 commits intomainfrom
simeonlee/chart-skeletons

Conversation

@simeonlee
Copy link
Member

@simeonlee simeonlee commented Feb 4, 2026

Summary

Adds reusable skeleton components for chart loading states:

  • BarChartSkeleton: Y-axis labels, horizontal grid lines, animated bars, X-axis labels, legend placeholders
  • LineChartSkeleton: SVG-based with chart boundaries, vertical/horizontal grid lines, distribution curve polylines

Both match Recharts ChartContainer dimensions (h-80) for seamless loading transitions.

Usage:

  • ModelUsage: Uses BarChartSkeleton in Suspense fallback
  • ModelLatency: Uses LineChartSkeleton in Suspense fallback

Screenshots

BarChartSkeleton

BarChartSkeleton

LineChartSkeleton

LineChartSkeleton

Test plan

  • Storybook stories render correctly
  • Components compile without errors
  • Skeletons used in ModelUsage and ModelLatency Suspense boundaries

Related


Note

Low Risk
Low risk UI-only change that swaps simple text loading fallbacks for new skeleton components; main risk is minor layout/visual regressions during loading states.

Overview
Introduces reusable chart loading skeletons (BarChartSkeleton, LineChartSkeleton) with Storybook stories, providing structured placeholders (axes/grid/legend) that mirror Recharts layout.

Updates ModelUsage and ModelLatency to use these skeletons as Suspense fallbacks instead of plain "Loading…" text, improving perceived responsiveness during data fetches.

Written by Cursor Bugbot for commit 3ea833c. This will update automatically on new commits. Configure here.

Add reusable skeleton components for chart loading states:
- BarChartSkeleton: Y-axis, grid lines, animated bars, X-axis labels, legend
- LineChartSkeleton: SVG-based with distribution curves, grid lines

Both components match Recharts dimensions for seamless loading transitions.
Includes Storybook stories for documentation and visual testing.
@simeonlee simeonlee self-assigned this Feb 4, 2026
simeonlee added a commit that referenced this pull request Feb 4, 2026
simeonlee added a commit that referenced this pull request Feb 4, 2026
- Update skeleton heights from h-72 to h-80 to match ChartContainer
- Replace text-only Suspense fallbacks with proper skeleton components
- BarChartSkeleton for ModelUsage, LineChartSkeleton for ModelLatency
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

<Skeleton className="h-4 w-20" />
<Skeleton className="h-4 w-24" />
<Skeleton className="h-4 w-16" />
</div>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skeleton legend placement causes layout shift on load

Medium Severity

The skeleton components place the legend section outside the h-80 chart container with additional pt-6 padding, while the actual Recharts ChartLegend renders inside the ChartContainer with h-80. This makes the skeleton taller than the loaded chart, causing a visible layout shift when data loads - contradicting the PR's stated goal of "seamless loading transitions."

Additional Locations (1)

Fix in Cursor Fix in Web

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