Repository navigation
fix(console): stop offering project pagination at the inventory limit - #1377
Merged
Merged
Conversation
useProjects raises the requested limit by PROJECT_PAGE_SIZE per Load more but clamps at 2000, the same cap the Server enforces. When the requested limit reached 2000 and the response was still truncated, ProjectsView kept showing an enabled Load more button whose click could not widen the query: rows stayed at 2000, truncated stayed true, and nothing happened. The hook now exposes canLoadMore (requested limit below the inventory cap). The view renders the button only while widening is possible, and at the cap shows a short note that the inventory is capped and filters can narrow the result instead. Pagination below the cap, Show less, and the filter-driven page reset are unchanged; the 2000 cap itself is unchanged. zh-CN wording ships with the existing runtime i18n map; other locales fall back to English like the neighboring bounded-inventory note.
swjnxyf
approved these changes
Nov 7, 2026
swjnxyf
left a comment
Collaborator
There was a problem hiding this comment.
Reviewed the 2,000-project server cap, canLoadMore control, bounded pagination, filter resets, view rendering, and i18n fallback. No blocking code findings. The original failing frontend-contract job was only an outdated checked-in runtime-v2 app.js bundle. Integrated current main and regenerated it in follow-up 79a6585. On wkp, frontend typecheck and all seven progressive-loading regressions passed. Approving; no need to wait for an intermediate CI rerun before the maintainer's authorized merge.
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.
Problem
useProjectsraises the requested limit byPROJECT_PAGE_SIZEon every Load more click but clamps at 2000 — the same cap the Server-side projects query enforces.ProjectsViewrendered the Load more button purely fromtruncated, so once the requested limit reached 2000 and the response was still truncated, the button stayed enabled while its click could not change anything: the query was re-clamped to the same 2000 rows,truncatedstayed true, and the request count did not move.Reproduced at the hook level with a 2001-row fixture: at the cap the button was offered,
loadMore()issued no request, and the user had no explanation why the remaining workspace was not reachable.Change
useProjectsnow exposescanLoadMore(requested limit below the 2000 inventory cap) alongside the existingcanShowLess.ProjectsViewrenders the Load more button only while widening is possible. At the cap it shows a short note instead: the inventory is capped at 2000 workspaces, and narrowing the filters (search / runner) shows more.zh-CN wording ships in the existing runtime i18n map; other locales fall back to English like the neighboring bounded-inventory note.
Validation
frontend/test-v2/progressive-loading.test.tsx: starting at the cap withinitialLimit: 2000, a truncated 2001-row response reportscanLoadMore=false,loadMore()issues no request, and narrowing filters restarts at the first page under the same cap (passes with the change; the cap branch did not exist before).npx vitest run test-v2/progressive-loading.test.tsx: 7 passed;npm run typecheck: clean.Compatibility
No API or data-shape changes: one new boolean on the hook's returned state and one view-level rendering condition.