feat: add loading skeletons#1342
Open
TUPM96 wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR introduces a shared skeleton-loading system across key frontend pages/components, and adds supporting utility/animation modules plus tests.
Changes:
- Replaced several inline loading spinners/placeholders with reusable skeleton components.
- Added new shared frontend utilities (
utils.ts) and motion variants (animations.ts). - Added Vitest coverage for skeleton components’ accessibility/test IDs.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/pages/LeaderboardPage.tsx | Switches leaderboard loading UI to shared LeaderboardSkeleton. |
| frontend/src/pages/BountyDetailPage.tsx | Switches bounty detail loading UI to shared BountyDetailSkeleton. |
| frontend/src/lib/utils.ts | Adds shared formatting + relative-time helpers used across UI. |
| frontend/src/lib/animations.ts | Adds shared Framer Motion variants for consistent animations. |
| frontend/src/components/ui/Skeletons.tsx | Introduces reusable skeleton components for multiple screens. |
| frontend/src/components/profile/ProfileDashboard.tsx | Uses ProfileBountyListSkeleton for loading state. |
| frontend/src/components/home/FeaturedBounties.tsx | Uses BountyGridSkeleton for homepage loading state. |
| frontend/src/components/bounty/BountyGrid.tsx | Uses BountyGridSkeleton for grid loading state. |
| frontend/src/tests/loading-skeletons.test.tsx | Adds tests asserting skeleton rendering and accessibility labels. |
| .gitignore | Adjusts ignore rules so frontend/src/lib/** is committed. |
| const date = new Date(timestamp); | ||
| if (Number.isNaN(date.getTime())) return 'unknown'; | ||
|
|
||
| const deltaSeconds = Math.max(0, Math.floor((Date.now() - date.getTime()) / 1000)); |
| ); | ||
| } | ||
|
|
||
| export function BountyGridSkeleton({ count = 6, className = 'grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-5' }: { count?: number; className?: string }) { |
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.
Closes #827
Summary
Verification
Wallet