Skip to content

Conversation

@Innocent-Akim
Copy link
Contributor

@Innocent-Akim Innocent-Akim commented Dec 31, 2025

  • Create CollectionsSkeleton component to display loading state
  • Integrate skeleton in admin Collections page during data fetching
  • Skeleton matches interface structure with header, list, and action buttons
  • Improves UX by providing visual feedback during loading

Summary

Related Issues

Description

Changes Made

  • [ ]
  • [ ]
  • [ ]

Screenshots / Videos

Type of Change

  • 🐛 Bug fix (non-breaking change addressing an issue)
  • ✨ New feature (non-breaking change adding functionality)
  • 💥 Breaking change (fix or feature causing existing functionality to change)
  • 📝 Documentation update
  • 🔧 Configuration change
  • 🧪 Test addition or modification
  • 🛠️ CI/CD infrastructure improvement
  • ♻️ Refactoring (no functional changes)
  • 🎨 Code style/formatting update
  • 🚀 Performance improvement

Implementation Details

Testing Instructions

Deployment Notes

Checklist

  • I have performed a self-review of my code
  • I have added/updated tests that prove my fix is effective or my feature works
  • I have updated relevant documentation
  • My changes generate no new warnings or errors
  • I have verified my changes in multiple browsers/environments (if applicable)
  • New and existing unit tests pass locally with my changes
  • I have made corresponding changes to the documentation
  • My code follows the established code style of the project
  • I have commented my code, particularly in hard-to-understand areas

Additional Context


Summary by cubic

Added a loading skeleton to the Admin Collections page to show a structured placeholder while data loads. Adds ARIA attributes so screen readers announce the loading state.

  • New Features
    • Introduced CollectionsSkeleton and render it when isLoading.
    • Skeleton mirrors header, list rows, and action buttons; row count matches the current page size.
    • Added role="status", aria-live="polite", aria-busy, and screen-reader-only text for accessibility.

Written for commit 2061f0c. Summary will update on new commits.

Summary by CodeRabbit

Release Notes

  • New Features
    • Added skeleton loading animation to the collections admin page. Users now see placeholder content while the page loads, providing visual feedback during data fetching.

✏️ Tip: You can customize this high-level summary in your review settings.

- Create CollectionsSkeleton component to display loading state
- Integrate skeleton in admin Collections page during data fetching
- Skeleton matches interface structure with header, list, and action buttons
- Improves UX by providing visual feedback during loading
@vercel
Copy link

vercel bot commented Dec 31, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
ever-works-website-template Ready Ready Preview, Comment Dec 31, 2025 7:50pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 31, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

A new skeleton loading component is created and integrated into the collections admin page to display a placeholder UI during data loading, replacing previous loading blocks with a dedicated CollectionsSkeleton component.

Changes

Cohort / File(s) Summary
Skeleton Loading UI
components/admin/collections/collections-skeleton.tsx, app/[locale]/admin/collections/page.tsx
New skeleton component added to render placeholder UI for collections list (with configurable itemCount, default 7). Collections page modified to conditionally render CollectionsSkeleton during loading state; import formatting switched to single quotes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A loading state, now dressed in grace,
With skeleton bones that hold their place,
While data speeds along the way,
Our users see smooth, seamless play,
No empty screens to make them wait,
Just placeholders keeping spirits great!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding a loading skeleton component to the Collections admin page. It is concise, specific, and clearly conveys the primary purpose of the changeset.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/collections-loading-skeleton

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.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 2 files

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Dec 31, 2025

Greptile Summary

This PR adds a loading skeleton component for the Collections admin page, improving UX during data fetching. The new CollectionsSkeleton component accurately mirrors the collections list layout with responsive design and dark mode support. However, there is a critical import error: the Skeleton component is imported from @heroui/react instead of the project's custom wrapper at @/components/ui/skeleton. This will cause a runtime error since HeroUI doesn't export Skeleton directly—the custom wrapper is needed for proper styling and animation.

Confidence Score: 2/5

  • This PR has a critical import error that will prevent the application from running. The Skeleton component is imported from the wrong source in the new skeleton file.
  • The PR introduces a critical syntax error with an incorrect import statement. While the implementation logic is sound and the component design follows established patterns in the codebase, the import of Skeleton from @heroui/react instead of @/components/ui/skeleton will cause a runtime failure. This must be fixed before merging. The rest of the changes (quote normalization, indentation fixes, and skeleton integration logic) are correct and follow best practices.
  • components/admin/collections/collections-skeleton.tsx - Fix the Skeleton import statement

Important Files Changed

Filename Overview
components/admin/collections/collections-skeleton.tsx New skeleton component for loading state. Imports Skeleton from wrong source (@heroui/react instead of @/components/ui/skeleton). Component structure is well-designed and matches the actual collections layout, but the import error will cause runtime failure.
app/[locale]/admin/collections/page.tsx Integrates CollectionsSkeleton for loading state. Changes include quote normalization (double to single quotes), indentation fixes (spaces to tabs), and conditional skeleton display logic (lines 98-100). Logic is correct and properly removes the inline "Loading collections…" text that was previously rendered inside the card body.

Sequence Diagram

sequenceDiagram
    participant User
    participant Page as Collections Page
    participant Hook as useAdminCollections Hook
    participant API as API

    User->>Page: Navigate to collections
    Page->>Hook: Initialize hook with pagination
    Hook->>API: Fetch collections (isLoading = true)
    
    alt Data Loading
        Page->>Page: Check isLoading state
        Page->>Page: Return CollectionsSkeleton
        Page->>User: Display skeleton with itemCount=10
        Note over User: Sees placeholder UI with animations
    end
    
    API-->>Hook: Collections data received
    Hook->>Hook: Update state (isLoading = false)
    
    alt Data Loaded
        Page->>Page: Check isLoading state
        Page->>Page: Render actual collections list
        Page->>User: Display collections with stats cards
    end
    
    User->>Page: Interact (create/edit/delete)
    Page->>Hook: Call mutation (isSubmitting = true)
    Hook->>API: Send request
    API-->>Hook: Success/Error response
    Hook->>Hook: Invalidate cache, update state
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

2 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3f4d9d8 and a306896.

📒 Files selected for processing (2)
  • app/[locale]/admin/collections/page.tsx
  • components/admin/collections/collections-skeleton.tsx
🧰 Additional context used
📓 Path-based instructions (9)
**/*.{js,ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use Node.js >= 20.19.0

Files:

  • app/[locale]/admin/collections/page.tsx
  • components/admin/collections/collections-skeleton.tsx
app/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Routes and pages should be placed in app/[locale]/** and app/api/** directories following Next.js App Router conventions

Files:

  • app/[locale]/admin/collections/page.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Prefer TypeScript files over JavaScript

Run pnpm tsc --noEmit for TypeScript type-checking

Files:

  • app/[locale]/admin/collections/page.tsx
  • components/admin/collections/collections-skeleton.tsx
app/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use Next.js App Router under app/[locale]/** and app/api/**

Files:

  • app/[locale]/admin/collections/page.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

Prefer TypeScript for all code

Files:

  • app/[locale]/admin/collections/page.tsx
  • components/admin/collections/collections-skeleton.tsx
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{js,jsx,ts,tsx}: Follow Prettier config with tabs, 4-space tabWidth, and 120-char printWidth
Prefer async/await over raw Promise chains in TypeScript/JavaScript code
Validate input with Zod where appropriate; follow existing schemas in lib/validations
Keep i18n-friendly: avoid hard-coded English strings in logic; use next-intl messages where relevant

Files:

  • app/[locale]/admin/collections/page.tsx
  • components/admin/collections/collections-skeleton.tsx
components/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

components/**/*.{ts,tsx}: UI components should be placed in the components/** directory
Keep React components mostly presentational and lean, avoiding complex business logic

Files:

  • components/admin/collections/collections-skeleton.tsx
components/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

Place UI and layout components in components/**

Files:

  • components/admin/collections/collections-skeleton.tsx
**/components/**/*.{jsx,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/components/**/*.{jsx,tsx}: For forms, prefer react-hook-form + Zod; follow patterns in existing auth/profile forms
Place business logic in lib/services or lib/repositories, not in components; keep components mostly presentational and data-fetching

Files:

  • components/admin/collections/collections-skeleton.tsx
🧬 Code graph analysis (1)
components/admin/collections/collections-skeleton.tsx (2)
components/ui/skeleton.tsx (1)
  • Skeleton (165-165)
lib/editor/components/primitive/card/card.tsx (1)
  • CardBody (74-74)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Greptile Review
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Lint and Build
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (3)
components/admin/collections/collections-skeleton.tsx (1)

25-60: LGTM!

The list rendering logic correctly generates skeleton items matching the expected page structure. Using Array.from with an index key is appropriate for this static skeleton UI.

app/[locale]/admin/collections/page.tsx (2)

11-11: LGTM!

The import statement correctly references the new CollectionsSkeleton component using the project's path alias convention.


98-100: LGTM!

The skeleton integration is well-implemented. The early return pattern is appropriate for loading states, and passing PageSize as itemCount ensures the skeleton displays the same number of items as the actual loaded content, providing a consistent visual experience.

Add ARIA attributes to communicate loading state to assistive technologies.
Screen readers will now announce when collections are loading.

- Add role="status", aria-live="polite", and aria-busy="true" to wrapper
- Add visually hidden "Loading collections…" text for screen readers
- Add aria-hidden="true" to decorative skeleton containers
@evereq
Copy link
Contributor

evereq commented Jan 1, 2026

@Innocent-Akim very carefully resolve conflicts (or just recreate this PR again based on develop code)

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.

3 participants