Skip to content

feat: add Load More pagination to Project Showcase section#663

Merged
Aditya948351 merged 1 commit into
devpathindcommunity-india:masterfrom
nishupr:project-showcase-pagination
Jun 20, 2026
Merged

feat: add Load More pagination to Project Showcase section#663
Aditya948351 merged 1 commit into
devpathindcommunity-india:masterfrom
nishupr:project-showcase-pagination

Conversation

@nishupr

@nishupr nishupr commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #639 #634

Scope Note

While investigating this issue, I found that the Resources section (ResourcesTabs.tsx, roadmaps tab) already has a working IntersectionObserver-based infinite scroll implementation (visibleCount, ITEMS_PER_PAGE, observerRef), so no changes were needed there.

The Project Showcase section (ProjectShowcaseSection.tsx), however, was rendering all projects at once with no pagination. This PR addresses that gap.

Changes Made

  • Added a visibleCount state initialized to 6 items
  • Projects are now sliced (projects.slice(0, visibleCount)) instead of rendering the full list
  • Added a "Load More" button that appears only when more projects exist beyond the currently visible count, showing how many remain
  • Clicking "Load More" reveals 6 more projects at a time until all are shown

Why this approach?

A "Load More" button was chosen over IntersectionObserver here because:

  • It's simpler and avoids adding extra observer/ref boilerplate for what is typically a smaller, finite list (project showcases)
  • It matches one of the two acceptable approaches explicitly suggested in the issue
  • It keeps the component fully presentational (no other state/side-effects needed)

How to test?

  1. Visit a public profile page: /profile/<username>
  2. If the user has more than 6 verified projects, only the first 6 should render initially, with a "Load More (X remaining)" button below
  3. Clicking the button reveals the next batch of projects until all are visible (button then disappears)
  4. If a user has 6 or fewer projects, the button should not appear at all

Type of Change

  • Feature (non-breaking)

@github-actions github-actions Bot added gssoc26 This is a official GirlScript Summer of Code label. level:intermediate Intermediate level issues type:feature type:performance type:refactor labels Jun 20, 2026

@Aditya948351 Aditya948351 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Great job on the Load More pagination! The component state is handled cleanly, and the slice logic is highly performant for this use case. It perfectly resolves the issue requirements!

Look after passing the Linting check on your next PRs @nishupr

@Aditya948351 Aditya948351 merged commit b089b8e into devpathindcommunity-india:master Jun 20, 2026
3 of 4 checks passed
@Aditya948351 Aditya948351 added the gssoc:approved give 50+ base points label Jun 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved give 50+ base points gssoc26 This is a official GirlScript Summer of Code label. level:intermediate Intermediate level issues type:feature type:performance type:refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Add infinite scroll or Load More pagination to large lists

2 participants