-
Notifications
You must be signed in to change notification settings - Fork 32
Add shimmer loading skeleton for analysis dashboard #98
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| import GlassCard from "../GlassCard"; | ||
| export default function ScanSkeleton() { | ||
| return ( | ||
| <div className="p-6 space-y-6 animate-pulse"> | ||
| <div className="flex flex-col md:flex-row gap-6"> | ||
| <GlassCard className="flex-1 p-8"> | ||
| <div className="h-4 w-32 skeleton-shimmer rounded mb-4"></div> | ||
| <div className="h-16 w-40 skeleton-shimmer rounded mb-4"></div> | ||
| <div className="h-2 w-full skeleton-shimmer rounded"></div> | ||
| </GlassCard> | ||
|
|
||
| <GlassCard className="md:w-72 p-6"> | ||
| <div className="h-4 w-24 skeleton-shimmer rounded mb-4"></div> | ||
| <div className="h-8 w-full skeleton-shimmer rounded mb-3"></div> | ||
| <div className="h-8 w-full skeleton-shimmer rounded"></div> | ||
| </GlassCard> | ||
| </div> | ||
|
|
||
| <GlassCard className="p-6"> | ||
| <div className="h-5 w-40 skeleton-shimmer rounded mb-4"></div> | ||
| <div className="space-y-3"> | ||
| <div className="h-16 skeleton-shimmer rounded"></div> | ||
| <div className="h-16 skeleton-shimmer rounded"></div> | ||
| <div className="h-16 skeleton-shimmer rounded"></div> | ||
| </div> | ||
| </GlassCard> | ||
|
|
||
| <GlassCard className="p-4"> | ||
| <div className="h-12 skeleton-shimmer rounded"></div> | ||
| </GlassCard> | ||
| </div> | ||
| ); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -396,4 +396,25 @@ input::placeholder { | |
|
|
||
| @media print { | ||
| nav, .print\:hidden { display: none !important; } | ||
| } | ||
| @keyframes shimmer { | ||
| 0% { | ||
| background-position: -200% 0; | ||
| } | ||
|
|
||
| 100% { | ||
| background-position: 200% 0; | ||
| } | ||
| } | ||
|
|
||
| .skeleton-shimmer { | ||
| background: linear-gradient( | ||
| 90deg, | ||
| var(--color-surface-mid) 25%, | ||
| var(--color-surface-highest) 50%, | ||
| var(--color-surface-mid) 75% | ||
| ); | ||
|
|
||
| background-size: 200% 100%; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resolve the Stylelint rule violation in Line 418 is currently flagged by Stylelint ( 🧰 Tools🪛 Stylelint (17.12.0)[error] 418-418: Expected no empty line before declaration (declaration-empty-line-before) (declaration-empty-line-before) 🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||
| animation: shimmer 1.5s linear infinite; | ||
| } | ||
|
Comment on lines
+410
to
420
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add a reduced-motion fallback for shimmer animation. Line 419 runs an infinite animation, but there’s no Suggested fix .skeleton-shimmer {
background: linear-gradient(
90deg,
var(--color-surface-mid) 25%,
var(--color-surface-highest) 50%,
var(--color-surface-mid) 75%
);
background-size: 200% 100%;
animation: shimmer 1.5s linear infinite;
}
+
+@media (prefers-reduced-motion: reduce) {
+ .skeleton-shimmer {
+ animation: none;
+ background-position: 0 0;
+ }
+}🧰 Tools🪛 Stylelint (17.12.0)[error] 418-418: Expected no empty line before declaration (declaration-empty-line-before) (declaration-empty-line-before) 🤖 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.
Expose loading semantics for assistive tech.
This skeleton is now the loading UI, but it has no
role="status"/aria-live/loading text, so screen reader users don’t get a meaningful loading announcement.Suggested fix
export default function ScanSkeleton() { return ( - <div className="p-6 space-y-6 animate-pulse"> + <div + className="p-6 space-y-6 animate-pulse" + role="status" + aria-live="polite" + aria-busy="true" + > + <span className="sr-only">Loading analysis dashboard</span> <div className="flex flex-col md:flex-row gap-6">📝 Committable suggestion
🤖 Prompt for AI Agents