Skip to content

feat(creators): add infinite scroll to the creator directory - #601

Merged
Tybravo merged 1 commit into
Tybravo:mainfrom
Deb-Auth:feat/391-creator-directory-infinite-scroll
Aug 31, 2026
Merged

feat(creators): add infinite scroll to the creator directory#601
Tybravo merged 1 commit into
Tybravo:mainfrom
Deb-Auth:feat/391-creator-directory-infinite-scroll

Conversation

@Deb-Auth

Copy link
Copy Markdown

Summary

Adds the creator directory at /creators and loads its creators lazily, a page at a time, instead of rendering the whole index up front.

closes #391

Note: frontend/app/creators/ did not exist on main, so this PR introduces the directory page itself along with the lazy loading the issue asks for. Everything is scoped to the new route; no existing file is modified.

Lazy loading

app/creators/hooks/useInfiniteScroll.ts

A small hook around the Intersection Observer API:

  • Returns a ref callback rather than a ref object, so the observer re-attaches when the sentinel is mounted, unmounted or replaced. This matters because the sentinel only exists while there are further pages.
  • enabled gates observation: it is false while a page is in flight, once the last page has loaded, and after an error, so the observer cannot fire redundant or looping loads.
  • rootMargin defaults to 200px, so the next page is typically in place before the user reaches the end of the list.
  • The onLoadMore callback is held in a ref, so a new callback identity does not tear down and rebuild the observer.
  • Environments without IntersectionObserver are handled by simply never triggering, which is why the page also keeps a manual control (below).

app/creators/services/creatorService.ts

The backend has no dedicated creators endpoint, so the directory is derived from the public global certificate index that already powers /search:

  • fetchCreators({ page, pageSize, search, signal }) requests one page of certificates and returns { creators, hasMore }, where hasMore is true when the index returned a full page.
  • groupCertificatesByCreator aggregates a page into per-creator entries (asset count, most recent mint, asset categories), newest activity first.
  • Because grouping happens per page, a creator can legitimately reappear in a later page. mergeCreators folds repeats into the already-loaded entry rather than pushing a duplicate card, and preserves the existing order so the grid never reshuffles under the user mid-scroll.

app/creators/page.tsx

  • Renders the grid of CreatorCards plus a sentinel below it; scrolling the sentinel into view appends the next page.
  • Debounced search input (300 ms) that restarts pagination from the first page.
  • Loading skeletons for the first page, an inline "Loading more creators" indicator for subsequent pages, an error state with a retry action, and an empty state.
  • A "Load more" button rendered alongside the sentinel, so keyboard users and browsers without Intersection Observer can page through the directory too.
  • Requests are aborted through an AbortSignal on unmount and whenever the query or page changes, so a stale response can never overwrite a newer one.
  • Loading flags are raised by whatever triggers a load (mount, new query, load more, retry) rather than inside the effect, keeping the effect body free of synchronous setState calls.

app/creators/components/CreatorCard.tsx renders one creator: monogram, display name with truncated wallet address, verified asset count, last mint date and category chips, linking through to that creator's assets in search. Address and date formatting reuse the existing app/search/components/shared helpers.

Verification

  • pnpm --filter web run build compiles successfully and /creators is emitted as a route.
  • pnpm --filter web run lint reports no errors or warnings from the new files.

Add the creator directory page and load its creators lazily instead of
rendering the whole index up front.

- useInfiniteScroll wraps the Intersection Observer API and observes a
  sentinel rendered below the grid, requesting the next page a viewport
  ahead of the user so scrolling stays smooth.
- creatorService derives the directory from the public certificate index,
  grouping certificates by creator per page and folding repeats into the
  loaded entries so appending a page never duplicates a card.
- The page supports debounced search, which restarts pagination, plus
  loading skeletons, an error state with retry, and an empty state.
- A Load more button mirrors the observer for keyboard users and for
  browsers without Intersection Observer support.
@drips-wave

drips-wave Bot commented Aug 31, 2026

Copy link
Copy Markdown

@Deb-Auth Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Tybravo
Tybravo merged commit 2d6cecd into Tybravo:main Aug 31, 2026
1 check passed
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.

[Frontend] [Enhancement] Add Infinite Scroll or Pagination to Creator Directory

2 participants