fix(repo): paginate user repositories in repo explorer#3219
Open
desireddymohithreddy0925 wants to merge 2 commits into
Open
fix(repo): paginate user repositories in repo explorer#3219desireddymohithreddy0925 wants to merge 2 commits into
desireddymohithreddy0925 wants to merge 2 commits into
Conversation
desireddymohithreddy0925
requested a review
from Priyanshu-byte-coder
as a code owner
July 19, 2026 16:02
GSSoC Label Checklist 🏷️@Priyanshu-byte-coder — please apply the appropriate labels before merging: Difficulty (pick one):
Quality (optional):
Validation (required to score):
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements server-side pagination for the Repo Explorer. It cleanly separates the pagination functionality from the unrelated milestone/goal-category changes that caused conflicts in previous PR attempts, ensuring the UI remains fast for users with large numbers of repositories.
Closes #3136
Type of Change
What Changed
src/lib/github.ts: Introduced a newfetchUserReposPaginatedfunction andPaginatedReposResultinterface to selectively fetch a specific page of repositories and extract thehasNextPageboolean from GitHub'sLinkheader. This avoids altering the originalfetchUserReposreturn signature, preserving compatibility across other endpoints.src/app/api/metrics/repo-explorer/route.ts: Updated the endpoint to extractpageandper_pagequery parameters. Replaced the heavy, multi-page data fetch withfetchUserReposPaginated, injecting the parameters into the cache key to accurately serve paginated chunks. The endpoint now returns{ repos, hasNextPage }.test/github.test.ts: Added validation for the newPaginatedReposResultinterface.How to Test
?page=2to the API request or utilizing the UI's pagination control).hasNextPageaccurately reflects the presence of remaining repositories.Expected result: The Repo Explorer should load instantly rather than waiting for up to 10 sequential API calls, and cleanly transition between pages without duplicate renders or missing commits.
Checklist
console.log, debug code, or commented-out blocksnpm run lintpasses locallynpm run type-check)Accessibility (UI changes only)
Additional Context
This is a focused, rebased follow-up to the previously cluttered PRs (#2903 and #3135) to implement the required API modifications securely and smoothly, ensuring a completely green build without conflicts.