Skip to content

feat(shop): add loading skeleton and empty state to products grid (closes #105) - #299

Open
Ranjeet2063 wants to merge 1 commit into
Movalabs-crew:mainfrom
Ranjeet2063:feat/shop-grid-loading-empty-states
Open

Ranjeet2063 wants to merge 1 commit into
Movalabs-crew:mainfrom
Ranjeet2063:feat/shop-grid-loading-empty-states

Conversation

@Ranjeet2063

Copy link
Copy Markdown
Contributor

Summary of Changes

Resolves issue #105 by adding loading and empty states to the shop products grid in app/shop/page.jsx.

Key Changes

  1. Loading State with Skeleton:
    • Added loading state (defaults to true) during initial listProducts fetch.
    • Imported and rendered ProductGridSkeleton from components/Skeleton.tsx while loading is true.
  2. Explicit Empty State:
    • When loading resolves and products.length === 0 without error, displays an explicit "No products yet" empty message.
  3. Preserved Error State:
    • Maintains the existing error alert if listProducts rejects.
  4. Comprehensive Unit Tests:
    • Added tests/app/shop/page.test.tsx testing:
      1. ProductGridSkeleton is rendered while pending.
      2. "No products yet" empty message renders on empty array.
      3. Error alert renders on rejection.
      4. Product cards grid renders when products are loaded.

Verification (2x Verified)

  • npx vitest run tests/app/shop/page.test.tsx (4/4 tests pass)
  • npm run type-check (0 errors)
  • npm run lint (0 errors)
  • npx prettier --check (100% formatted)

Closes #105

Copilot AI lite review requested due to automatic review settings September 4, 2026 21:40
@vercel

vercel Bot commented Sep 4, 2026

Copy link
Copy Markdown

@Ranjeet2063 is attempting to deploy a commit to the Oluremi's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bounty: $65] Add loading and empty states to the shop products grid

2 participants