-
Notifications
You must be signed in to change notification settings - Fork 27
Add shimmer loading skeleton for analysis dashboard #86
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,3 +1,4 @@ | ||||||
| console.log("ANALYSIS DASHBOARD LOADED"); | ||||||
|
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. Remove module-level debug log (Line 1). This logs on every module load in production and adds noise to client logs. Proposed fix-console.log("ANALYSIS DASHBOARD LOADED");
import { useEffect, useState } from 'react';📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| import { useEffect, useState } from 'react'; | ||||||
| import { Link, useSearchParams } from 'react-router-dom'; | ||||||
| import { ArrowLeft, AlertTriangle, Droplets, Eye as EyeIcon, Fish } from 'lucide-react'; | ||||||
|
|
@@ -19,8 +20,40 @@ function gradeColor(grade: string) { | |||||
| if (grade === 'B') return 'text-neon'; | ||||||
| return 'text-error'; | ||||||
| } | ||||||
| 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> | ||||||
| ); | ||||||
| } | ||||||
| export default function AnalysisDashboard() { | ||||||
|
|
||||||
| const [params] = useSearchParams(); | ||||||
| const [scan, setScan] = useState<ScanResult | null>(null); | ||||||
| const [loading, setLoading] = useState(true); | ||||||
|
|
@@ -43,20 +76,16 @@ export default function AnalysisDashboard() { | |||||
| } catch (err) { | ||||||
| setError(err instanceof Error ? err.message : 'Failed to load scan data.'); | ||||||
| } finally { | ||||||
| setLoading(false); | ||||||
| setLoading(false); | ||||||
| } | ||||||
| } | ||||||
| load(); | ||||||
| }, [params]); | ||||||
|
|
||||||
| // ── Loading state ──────────────────────────────────────────────────────── | ||||||
| if (loading) { | ||||||
| return ( | ||||||
| <div className="min-h-[calc(100vh-4rem)] flex items-center justify-center"> | ||||||
| <StatusTerminal messages={['LOADING_ANALYSIS...', 'FETCHING_RESULT']} /> | ||||||
| </div> | ||||||
| ); | ||||||
| } | ||||||
| if (loading) { | ||||||
| return <ScanSkeleton />; | ||||||
| } | ||||||
|
|
||||||
| // ── Error state ────────────────────────────────────────────────────────── | ||||||
| if (error || !scan) { | ||||||
|
|
||||||
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.
Fix stylelint violation before
animationdeclaration (Line 418).There is an empty line before
animationthat violatesdeclaration-empty-line-beforeand can fail linting.Proposed 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; }📝 Committable suggestion
🧰 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
Source: Linters/SAST tools