-
Notifications
You must be signed in to change notification settings - Fork 24
Add Dashboard skeleton loading state #225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| import { Card } from '../ui/Card'; | ||
| import { Skeleton } from '../ui/Skeleton'; | ||
|
|
||
| export const DashboardSkeleton = () => { | ||
| return ( | ||
| <div className="p-6 space-y-6 max-w-7xl mx-auto"> | ||
| {/* Summary Cards Grid */} | ||
| <div className="grid grid-cols-1 md:grid-cols-3 gap-6"> | ||
| {[1, 2, 3].map((i) => ( | ||
| <Card key={i} className="flex flex-col items-center justify-center text-center h-[200px]"> | ||
| {/* Icon placeholder */} | ||
| <Skeleton className="w-16 h-16 rounded-full mb-4" /> | ||
| {/* Label placeholder */} | ||
| <Skeleton className="w-24 h-4 mb-2" /> | ||
| {/* Value placeholder */} | ||
| <Skeleton className="w-32 h-8" /> | ||
| </Card> | ||
| ))} | ||
| </div> | ||
|
|
||
| {/* Main Content Grid */} | ||
| <div className="grid grid-cols-1 lg:grid-cols-2 gap-6"> | ||
| {/* Chart Section */} | ||
| <Card title="Balance Overview"> | ||
| <div className="mt-4 space-y-4"> | ||
| {/* Chart bars placeholder */} | ||
| <div className="flex items-end justify-between h-[250px] px-4 space-x-4"> | ||
| <Skeleton className="w-full h-[40%]" /> | ||
| <Skeleton className="w-full h-[70%]" /> | ||
| <Skeleton className="w-full h-[50%]" /> | ||
| <Skeleton className="w-full h-[80%]" /> | ||
| </div> | ||
| </div> | ||
| </Card> | ||
|
|
||
| {/* Recent Activity Section */} | ||
| <Card title="Recent Activity"> | ||
| <div className="mt-4 space-y-4"> | ||
| {[1, 2, 3].map((i) => ( | ||
| <div key={i} className="flex items-center space-x-4"> | ||
| <Skeleton className="w-10 h-10 rounded-full" /> | ||
| <div className="flex-1 space-y-2"> | ||
| <Skeleton className="w-3/4 h-4" /> | ||
| <Skeleton className="w-1/2 h-3" /> | ||
| </div> | ||
| </div> | ||
| ))} | ||
| </div> | ||
| </Card> | ||
| </div> | ||
| </div> | ||
| ); | ||
| }; | ||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add ARIA attributes to communicate loading state to screen readers.
The skeleton component currently lacks accessibility attributes, preventing screen reader users from knowing that content is loading. This impacts users with disabilities and creates an accessibility compliance gap.
🔎 Proposed fix
Add
aria-busy="true"andaria-labelto the container, and optionallyaria-hidden="true"to decorative skeleton elements:export const DashboardSkeleton = () => { return ( - <div className="p-6 space-y-6 max-w-7xl mx-auto"> + <div className="p-6 space-y-6 max-w-7xl mx-auto" role="status" aria-busy="true" aria-label="Loading dashboard"> {/* Summary Cards Grid */} <div className="grid grid-cols-1 md:grid-cols-3 gap-6">Alternatively, you can add
aria-live="polite"instead ofrole="status"for dynamic updates.📝 Committable suggestion
🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jules In web/components/skeletons/DashboardSkeleton.tsx, around lines 4–53, the skeleton
markup lacks accessibility attributes to indicate loading state; add
aria-busy="true" and a descriptive aria-label (e.g., "Dashboard loading") or
role="status" with a visually-hidden "Loading…" text on the main container div,
and mark purely decorative Skeleton elements as aria-hidden="true" so screen
readers ignore them; ensure any dynamic updates use aria-live="polite" if you
prefer live region semantics instead of role="status".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.