feat: add skeleton loaders for loading states#135
Conversation
- Add Skeleton UI component with pulse animation - Add CardSkeleton component for plugin cards - Replace spinners with skeletons in repo page for better UX
📝 WalkthroughWalkthroughAdds a base ChangesSkeleton Loading UI
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Code Review
This pull request introduces a new Skeleton component and a CardSkeleton component to display loading placeholders. The review feedback suggests removing redundant vertical padding in the CardSkeleton component to maintain symmetrical layout spacing, and adding aria-hidden="true" to the Skeleton component to improve accessibility for screen readers.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| <> | ||
| {Array.from({ length: count }).map((_, index) => ( | ||
| <Card className="w-full" key={index}> | ||
| <div className="flex flex-col gap-4 px-6 py-4"> |
There was a problem hiding this comment.
The Card component already applies vertical padding (py-6) and a vertical gap (gap-4) between its children. Adding py-4 to the inner header div creates asymmetrical vertical spacing (top padding becomes py-6 + py-4, while bottom padding remains py-6).\n\nRemoving py-4 from this inner container will ensure a symmetrical layout that aligns with the standard Card component's spacing.
| <div className="flex flex-col gap-4 px-6 py-4"> | |
| <div className="flex flex-col gap-4 px-6"> |
| function Skeleton({ className, ...props }: React.ComponentProps<'div'>) { | ||
| return <div className={cn('animate-pulse rounded-md bg-muted', className)} {...props} /> | ||
| } |
There was a problem hiding this comment.
To improve accessibility (a11y), skeleton screens should be hidden from screen readers using aria-hidden="true". This prevents assistive technologies from reading out empty layout blocks while the content is loading.
function Skeleton({ className, ...props }: React.ComponentProps<'div'>) {\n return <div aria-hidden="true" className={cn('animate-pulse rounded-md bg-muted', className)} {...props} />\n}
There was a problem hiding this comment.
🧹 Nitpick comments (1)
ui/src/app/[...repo]/page.tsx (1)
79-79: 💤 Low valueRemove unused
text-centerclass.The
text-centerclass has no effect sinceCardSkeletonrenders full-widthCardelements using block/flex layouts. This appears to be leftover from the previous spinner implementation.♻️ Proposed cleanup
- <div aria-busy="true" aria-live="polite" className="py-8 text-center"> + <div aria-busy="true" aria-live="polite" className="py-8">🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@ui/src/app/`[...repo]/page.tsx at line 79, Remove the unused text-center class from the className attribute of the div element in the CardSkeleton loading container. Since CardSkeleton renders full-width Card elements using block/flex layouts, the text-center class has no effect and is leftover from a previous implementation. Keep only the py-8 class in the className attribute.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@ui/src/app/`[...repo]/page.tsx:
- Line 79: Remove the unused text-center class from the className attribute of
the div element in the CardSkeleton loading container. Since CardSkeleton
renders full-width Card elements using block/flex layouts, the text-center class
has no effect and is leftover from a previous implementation. Keep only the py-8
class in the className attribute.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: afab714f-7ed2-4b11-95f4-15bc8df1a3f7
📒 Files selected for processing (3)
ui/src/app/[...repo]/page.tsxui/src/components/skeleton/CardSkeleton.tsxui/src/components/ui/skeleton.tsx
Summary
Changes
Summary by CodeRabbit