Skip to content

Add shimmer loading skeleton for analysis dashboard#86

Closed
kushwahnihal25-rgb wants to merge 4 commits into
jpdevhub:mainfrom
kushwahnihal25-rgb:main
Closed

Add shimmer loading skeleton for analysis dashboard#86
kushwahnihal25-rgb wants to merge 4 commits into
jpdevhub:mainfrom
kushwahnihal25-rgb:main

Conversation

@kushwahnihal25-rgb

@kushwahnihal25-rgb kushwahnihal25-rgb commented Jun 8, 2026

Copy link
Copy Markdown

Description

Closes #9

Added a shimmer loading skeleton for the Analysis Dashboard to improve the user experience while scan data is loading.

Changes Made

  • Added ScanSkeleton component
  • Added shimmer loading animation
  • Added loading placeholders for dashboard content
  • Improved loading state UX on refresh/navigation

Testing

  • Verified skeleton appears during loading
  • Verified shimmer animation works correctly
  • Verified dashboard renders after loading completes

Checklist

  • npm run lint passes with no errors
  • npm run build compiles without TypeScript errors
  • python -m pytest passes (including new tests I added)
  • No .env files, API keys, secrets, model weights, or __pycache__ in this diff
  • Branch is rebased on main, not merged

Summary by CodeRabbit

  • Style
    • Added animated skeleton loaders with a left-to-right shimmer; Analysis Dashboard now shows the new placeholder layout instead of text-based loading messages.
  • Chores
    • Bumped several frontend dependencies (React, React DOM, router, and icon library) to newer patch/minor versions.

@vercel

vercel Bot commented Jun 8, 2026

Copy link
Copy Markdown

@kushwahnihal25-rgb is attempting to deploy a commit to the karan3431's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

🎉 Thank you for your Pull Request! We're thrilled to have your contribution to FreshScan AI.

Before we review, please make sure you have:

  • Followed the CONTRIBUTING.md guidelines.
  • Ensured all automated CI checks (linting, tests) are passing.
  • Checked that your commit messages follow the Conventional Commits format.

A maintainer will review your code as soon as possible!

@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: cd585e82-ec24-4a27-a745-ea129b7995b9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Warning

.coderabbit.yaml has a parsing error

The CodeRabbit configuration file in this repository has a parsing error and default settings were used instead. Please fix the error(s) in the configuration file. You can initialize chat with CodeRabbit to get help with the configuration file.

💥 Parsing errors (1)
Validation error: Invalid input: expected object, received boolean at "reviews.auto_review"
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
📝 Walkthrough

Walkthrough

Updates frontend dependencies and adds a CSS shimmer plus a shared ScanSkeleton component; AnalysisDashboard now renders the skeleton while loading.

Changes

Skeleton Loading UI and Dependency Updates

Layer / File(s) Summary
Dependency version updates
package.json
Frontend dependencies bumped: lucide-react (1.16.0 → 1.17.0), react (19.2.4 → 19.2.7), react-dom (19.2.4 → 19.2.7), react-router-dom (7.14.0 → 7.17.0).
Skeleton CSS and component
src/index.css, src/components/shared/ScanSkeleton.tsx
Adds @keyframes shimmer and .skeleton-shimmer CSS; introduces ScanSkeleton() default-export component rendering animated placeholder layout using skeleton-shimmer.
AnalysisDashboard integration
src/pages/AnalysisDashboard.tsx
Imports ScanSkeleton and replaces the if (loading) render branch to return <ScanSkeleton />, removing the previous StatusTerminal loading UI.

🎯 3 (Moderate) | ⏱️ ~20 minutes

I nibble code and stitch a gleam,
Soft gradients run — a loading dream,
Fresh versions snug, the dashboard beams,
Skeletons dance in shimmered streams,
Hoppy commits, the UI gleams! 🐰✨

🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (3 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR partially addresses issue #9 requirements: it implements the ScanSkeleton component with shimmer animation, but package.json still contains out-of-scope dependency upgrades that should be reverted per reviewer feedback. Revert package.json and package-lock.json to remove React/React Router version bumps, keeping only the code changes in src/index.css, src/pages/AnalysisDashboard.tsx, and src/components/shared/ScanSkeleton.tsx.
Out of Scope Changes check ⚠️ Warning package.json contains out-of-scope dependency upgrades (lucide-react, react, react-dom, react-router-dom) unrelated to the skeleton UI implementation requirement. Remove package.json and package-lock.json changes; these dependency upgrades are outside the scope of implementing the loading skeleton for issue #9.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding a shimmer loading skeleton component for the analysis dashboard.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 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.

Inline comments:
In `@src/index.css`:
- Around line 418-419: Remove the blank line before the animation declaration to
satisfy the declaration-empty-line-before lint rule: ensure the CSS block with
the properties background-size and animation has no empty line between them
(i.e., place animation: shimmer 1.5s linear infinite; directly after
background-size: 200% 100%;), then re-run stylelint to confirm the violation is
resolved.

In `@src/pages/AnalysisDashboard.tsx`:
- Line 1: Remove the module-level console.log("ANALYSIS DASHBOARD LOADED") in
AnalysisDashboard.tsx; either delete this statement or replace it with a
debug-only/logging facility (e.g., use an environment-guard like
process.env.NODE_ENV === "development" or the app's logger) so it does not emit
in production. Target the top-level console.log call in the AnalysisDashboard
module and ensure no other module-level side-effect logs remain.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: b5ded911-7428-41fd-8a9c-e0dbc420f0c5

📥 Commits

Reviewing files that changed from the base of the PR and between d33d33e and 4b5b5c2.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (3)
  • package.json
  • src/index.css
  • src/pages/AnalysisDashboard.tsx

Comment thread src/index.css
Comment on lines +418 to +419
background-size: 200% 100%;
animation: shimmer 1.5s linear infinite;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix stylelint violation before animation declaration (Line 418).

There is an empty line before animation that violates declaration-empty-line-before and 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

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
background-size: 200% 100%;
animation: shimmer 1.5s linear infinite;
.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;
}
🧰 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
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/index.css` around lines 418 - 419, Remove the blank line before the
animation declaration to satisfy the declaration-empty-line-before lint rule:
ensure the CSS block with the properties background-size and animation has no
empty line between them (i.e., place animation: shimmer 1.5s linear infinite;
directly after background-size: 200% 100%;), then re-run stylelint to confirm
the violation is resolved.

Source: Linters/SAST tools

Comment thread src/pages/AnalysisDashboard.tsx Outdated

@jpdevhub jpdevhub left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. src/pages/AnalysisDashboard.tsx - Leftover Debugging Log
    remove console.log("ANALYSIS DASHBOARD LOADED"); before merging.
  2. package.json & package-lock.json - Out of Scope
    evert the changes to package.json and package-lock.json. Their PR should strictly only contain the changes made to src/index.css and src/pages/AnalysisDashboard.tsx.

@kushwahnihal25-rgb

Copy link
Copy Markdown
Author

@jpdevhub

Done. Removed the debug log and reverted package.json/package-lock.json changes as requested.

Thanks for the review. Please let me know if any further changes are needed.

@jpdevhub

Copy link
Copy Markdown
Owner

Thanks for the updates! We are almost there, but two major acceptance criteria were missed in this latest commit:

  1. Out of Scope Files: You still have changes to package.json and package-lock.json in this PR (upgrading React, React Router, etc.). Please revert these entirely. This PR should only touch src/index.css and src/pages/AnalysisDashboard.tsx (and the new shared component). 2. Component Reusability: The task description explicitly asked to create a reusable SkeletonCard component inside the src/components/shared/ folder. Right now, you've hardcoded ScanSkeleton inline inside AnalysisDashboard.tsx. Please move this logic into a dedicated, reusable component in the shared folder as requested.

Once those two things are fixed, this will be ready to merge!

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 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.

Inline comments:
In `@src/components/shared/ScanSkeleton.tsx`:
- Around line 4-31: The ScanSkeleton root container currently uses "p-6
space-y-6 animate-pulse" which differs from the final dashboard layout and
causes layout shift; update the root element in ScanSkeleton (the top-level div
wrapping GlassCard instances) to match the dashboard's outer wrapper classes
(add the same min-height, responsive horizontal padding, centered max-width
wrapper — e.g. include classes like min-h-... , px-..., mx-auto, max-w-4xl —
while preserving internal spacing and animate-pulse) so the skeleton reserves
the same shell dimensions as the loaded dashboard and prevents reflow; keep
GlassCard usages and their internal classes unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 54ed457b-d840-4363-8dbf-8152317668ff

📥 Commits

Reviewing files that changed from the base of the PR and between 7e20e05 and f037ae9.

📒 Files selected for processing (2)
  • src/components/shared/ScanSkeleton.tsx
  • src/pages/AnalysisDashboard.tsx

Comment on lines +4 to +31
<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>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Loading shell dimensions don’t match the final dashboard, causing avoidable layout shift.

Line 4 uses a different outer layout than the loaded dashboard (min-h, responsive horizontal padding, centered max-w-4xl wrapper), so the page reflows when loading completes. This misses the acceptance requirement to minimize content jumping.

Proposed fix
 export default function ScanSkeleton()  {
   return (
-    <div className="p-6 space-y-6 animate-pulse">
-      <div className="flex flex-col md:flex-row gap-6">
+    <div className="min-h-[calc(100vh-4rem)] px-6 md:px-16 lg:px-24 py-8 md:py-12">
+      <div className="max-w-4xl mx-auto 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="p-4">
-        <div className="h-12 skeleton-shimmer rounded"></div>
-      </GlassCard>
+        <GlassCard className="p-4">
+          <div className="h-12 skeleton-shimmer rounded"></div>
+        </GlassCard>
+      </div>
     </div>
   );
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<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 ScanSkeleton() {
return (
<div className="min-h-[calc(100vh-4rem)] px-6 md:px-16 lg:px-24 py-8 md:py-12">
<div className="max-w-4xl mx-auto 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>
</div>
);
}
🤖 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 `@src/components/shared/ScanSkeleton.tsx` around lines 4 - 31, The ScanSkeleton
root container currently uses "p-6 space-y-6 animate-pulse" which differs from
the final dashboard layout and causes layout shift; update the root element in
ScanSkeleton (the top-level div wrapping GlassCard instances) to match the
dashboard's outer wrapper classes (add the same min-height, responsive
horizontal padding, centered max-width wrapper — e.g. include classes like
min-h-... , px-..., mx-auto, max-w-4xl — while preserving internal spacing and
animate-pulse) so the skeleton reserves the same shell dimensions as the loaded
dashboard and prevents reflow; keep GlassCard usages and their internal classes
unchanged.

@kushwahnihal25-rgb

Copy link
Copy Markdown
Author

Hi @jpdevhub ,

I created a new clean PR (#98) that contains only the requested files:

  • src/components/shared/ScanSkeleton.tsx
  • src/index.css
  • src/pages/AnalysisDashboard.tsx

All out-of-scope package.json and package-lock.json changes have been removed.

Please review PR #98 instead. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FE-04: Replace Synchronous Loading Flash with Skeleton UI for Scan Results

2 participants