Skip to content

fix(admin): content list only loads 50 items, no infinite scroll for large datasets #129

Description

@Hari-Bonda

Description

The admin content list at /_emdash/admin/content/{collection} fetches only 50 items from the API (the default limit, capped at 100). The client-side pagination in ContentList.tsx then shows 20 items per page, giving only ~3 pages.

For sites with thousands of content items, this means the vast majority of posts are invisible in the admin unless the user clicks "Load More" — which is easy to miss.

Root Cause

  1. router.tsx calls fetchContentList(collection) with no limit parameter
  2. The API defaults to limit: 50 (max 100) in content.ts repository
  3. ContentList.tsx paginates client-side over whatever items are loaded
  4. The "Load More" / onLoadMore / hasMore props exist in the component interface but aren't wired up in the router query

Expected Behavior

  • Content list should use cursor-based infinite scroll or auto-load all pages
  • Or at minimum, show a prominent "Load More" button when hasMore is true
  • The total count should be displayed so users know how many items exist

Suggested Fix

Wire up hasMore + onLoadMore in the router to use useInfiniteQuery with cursor pagination, appending pages as the user scrolls or clicks "Load More". The ContentList component already accepts these props — they just aren't connected.

Environment

  • EmDash CMS v0.1.0
  • Tested with 30,000+ posts in a collection

Activity

  1. added theissue type on Apr 2, 2026
  2. widyakumara commented on Apr 3, 2026

    @widyakumara

    For sites with thousands of content items, this means the vast majority of posts are invisible in the admin unless the user clicks "Load More" — which is easy to miss.

    IMO, the argument is a bit weak: using infinite scroll the majority of content will still be invisible unless the user scroll.

    Also, users with admin access will likely have some idea of how many posts the site they administer has. Meaning that they would expect that there should be a method load more/paginate the content.

    For admin interface, I strongly suggest to use plain old pagination instead of infinite scrolling.

    Infinite scrolling typically works best for situations where users will want to scroll through homogeneous items with no particular task or goal in mind — for example, entertainment, news, or social[1]

    [1] Nielsen Norman Group: Infinite Scrolling: When to Use It, When to Avoid It

    See Also:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions