Repository navigation
fix(react): panels error at the page ceiling instead of truncating silently (FIX-1577) - #2456
Conversation
…lently (FIX-1577) usePanelRows stopped at MAX_PAGES and returned the rows collected so far as if they were the whole collection, even when the last page still carried a nextCursor. It now throws there, so Roster and BoardColumns show their existing error line with Retry. MAX_PAGES is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DME8pzA4e4Rc7fRLGsYavW
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Second look + architecture passVerdict: the approach is right. Nothing blocking. Throwing at the ceiling reuses the existing Worth addressing (small)
Architecture (opportunity, not a blocker)
Smaller notes
No refactor is warranted beyond the wording fixes above. Generated by Claude Code |
There was a problem hiding this comment.
/simplify review
Verdict: The production fix is about as small as this behavior can get. After MAX_PAGES, if nextCursor is still present, throw instead of returning collected. That routes through the existing useFencedRead → describe → alert + Retry path in Roster / BoardColumns. No new error types, panel props, or truncated-state branches — which is the main alternative that would have added complexity without clear benefit.
Did the approach go too far? No. The diff is ~6 lines of runtime logic plus tests and a changeset. A richer design (return { rows, incomplete }, dedicated error class, per-panel handling) would be strictly more surface area for the same user-visible outcome.
What I’d skip in this PR (optional / follow-up):
-
Shared paging helper — DevTool
inventory.tsalready hasINVENTORY_MAX_PAGES = 1000andreadEveryPage()with duplicate-cursor detection; panels still inline the loop. ExtractingreadAllCollectionPagesto@flow-state-dev/clientwould dedupe constants and defenses, but that’s a wider refactor than FIX-1577; worth a follow-up issue, not a merge blocker. -
Test cost — Roster ceiling tests use
limit: 1and 1,000 mock round-trips each;pagedSource’sfindIndexper page adds O(n²) in the mock. Faithful given privateMAX_PAGES, but if CI time grows, consider a test-only export of the ceiling constant or a unit test on the loader callback with a injected max (only if the team wants faster tests). -
Test symmetry (nit) — Roster gets both failure and “exactly 1000 pages succeeds”;
BoardColumnsonly adds theendlessSourcefailure case. Hook coverage is shared viausePanelRows; mirroring the success boundary onBoardColumnsis optional parity, not required. -
Comment overlap (nit) — BR-19/BR-21 and “ceiling = misbehaving transport” now appear in both the
MAX_PAGESblock andusePanelRowsJSDoc; trimming one to a pointer would reduce drift risk.
Performance: No new production hot-path concerns. The ceiling path still performs up to 1,000 sequential fetches before throwing (same as before when it silently truncated); that’s inherent to full-list panel reads.
Third-party packages: Nothing here warrants a pagination library — domain-specific message, fence, and live drivers stay in React.
Approving — ship as-is; follow-ups above are suggestions, not requests for this PR.
Sent by Cursor Automation: Review For Best Approach
There was a problem hiding this comment.
Code Snob — already tight. No POC.
I read usePanelRows and useFencedRead in packages/react/src/components/panels/reads.ts, the three new cases plus pagedSource and endlessSource in packages/react/test/panels.test.ts, and .changeset/panel-page-ceiling-error.md.
A rewrite would not shrink this contract:
- The loop returns when the cursor runs out and throws when it falls through. A break plus a flag, or a throw on the last iteration, adds a branch for the same two outcomes.
- The throw lands in
useFencedRead's existing catch. There is no new error UI. endlessSourcehas one caller. Inlining it moves the same lines into the test.pagedSourcewith 1,001 rows is the roster case again.- The 1,000-page roster test and the 1,001-page roster test are the two sides of the ceiling. One case cannot say both "complete read" and "failed read."
- The
MAX_PAGEScomment replaced a sentence that is now false ("shows what it has"). Cutting it further drops the constant's contract.
Left the ceiling at 1,000 and the fenced-read consolidation alone. Both are already out of scope on this PR.
Sent by Cursor Automation: Code Snob
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 931fdf98fd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
BoardList also reads through usePanelRows, so it gets the same error and Retry at the ceiling. Name it in the changeset and cover it with a test. The usePanelRows JSDoc now points at MAX_PAGES instead of repeating its rule, and both comments say "the panels", since there are three now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DME8pzA4e4Rc7fRLGsYavW
|
from: fsd-claude @codex review The head is now 8555fde. The changeset now names BoardList, there's a new BoardList ceiling test, and the ceiling comment is trimmed. The last automated review ran on 931fdf9. Generated by Claude Code |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8555fde7b6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
BP-006: tracking labels don't belong in test titles. The changeset keeps its FIX-1577 reference, which AGENTS.md requires. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DME8pzA4e4Rc7fRLGsYavW
|
from: fsd-claude @codex review 🤖 Generated with Claude Code https://claude.ai/code/session_01DME8pzA4e4Rc7fRLGsYavW Generated by Claude Code |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d74aeae8dc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Roster, BoardColumns and BoardList now error with Retry when a cursor remains after 1,000 pages; the README said a collection larger than limit always renders in full. State the ceiling, the error state, and that a too-small limit is how a panel reaches it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DME8pzA4e4Rc7fRLGsYavW
|
from: fsd-claude @codex review Head ba78cf8 updates 🤖 Generated with Claude Code https://claude.ai/code/session_01DME8pzA4e4Rc7fRLGsYavW Generated by Claude Code |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ba78cf8aca
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…mit remedy The Roster, BoardColumns and BoardList `limit` JSDoc, the usePanelRows comment and the README now all state the same contract: follow the cursor for up to 1,000 pages, `limit` is page size, pages left after that show the error line and Retry. The README no longer promises that raising `limit` always clears the error: it does only below the route's 200 cap; past about 200,000 rows or with a cursor that never ends, it does not. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DME8pzA4e4Rc7fRLGsYavW
|
from: fsd-claude @codex review Head 7754e62. This update is docs and comments only. The panels' page-ceiling contract now uses the same wording in the README, the three 🤖 Generated with Claude Code https://claude.ai/code/session_01DME8pzA4e4Rc7fRLGsYavW Generated by Claude Code |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7754e62f8f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…eat limit as a hint Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DME8pzA4e4Rc7fRLGsYavW
|
from: fsd-claude @codex review Head 44efb32: the panels' raise- Generated by Claude Code |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |


Problem
The Roster and BoardColumns panels read a collection page by page, up to 1,000 pages. If the collection had more pages than that, the panel showed the rows it had read as if they were the whole list, with no error. It was reachable with valid inputs: at
limit={1}, a 1,001-seat roster lost its last seat and nothing on screen said so.What this does
When the 1,000th page still has a
nextCursor, the read now fails. The panel shows the same error line with Retry that it already shows for any failed read, and draws no rows. The ceiling stays at 1,000 pages. A collection whose last page falls on or before page 1,000 renders exactly as before.What's asked of you
Review and merge. You don't need to decide anything. Showing the existing error state, not partial rows with a warning, follows the architect's rule for this fix ("surface error/signal, do not render partial as complete") and uses UI the panels already have.
Parts worth reviewing closely
packages/react/src/components/panels/reads.ts: the loop now returns only when the cursor runs out. Getting to the end of the loop throws.BoardColumnswithlive): if a re-read hits the ceiling, the error replaces rows that were already on screen. Any other failed re-read does the same.Links: FIX-1577 · raised on #2115 (Codex, Cursor) · closes #2233
Verification
packages/react/test/panels.test.ts:limit: 1: shows the error and Retry, no seats, exactly 1,000 requests.limit: 1: all 1,000 render with no error (the boundary case).nextCursornever runs out: shows the error, no cards, stops at 1,000 requests.reads.tsreverted, both error tests fail and the boundary test passes.pnpm --filter @flow-state-dev/react test: 28 files, 324 tests passed.pnpm --filter @flow-state-dev/react typecheckis clean.@flow-state-dev/reactpatch, because consumers can now see an error where they used to get partial rows.MAX_PAGES, and the fenced-read consolidation (FIX-1507).🤖 Generated with Claude Code
https://claude.ai/code/session_01DME8pzA4e4Rc7fRLGsYavW
Generated by Claude Code
Note
Medium Risk
Changes list-loading semantics for very large or misbehaving paginated collections; live boards may replace on-screen rows with an error on re-read at the ceiling, matching other read failures.
Overview
Roster and BoardColumns (via shared
usePanelRowspaging) no longer treat the first 1,000 pages as a complete list whennextCursoris still present. Hitting the existing 1,000-page ceiling with more data outstanding is now a failed read: the panel shows the usual alert message (including “more still to read”) and Retry, and does not render partial rows.In
reads.ts, the pagination loop returns only when the cursor is exhausted; exhausting the loop throws instead of returning collected items. Docs/comments and a patch changeset note the behavior change (FIX-1577). Tests cover roster boundary cases (1,000 vs 1,001 pages atlimit: 1) and a board with an endlessnextCursor.Reviewed by Cursor Bugbot for commit 931fdf9. Configure here.