Skip to content

fix(react): panels error at the page ceiling instead of truncating silently (FIX-1577) - #2456

Merged
jhoffner merged 6 commits into
mainfrom
fix/FIX-1577-panel-page-ceiling
Sep 30, 2026
Merged

jhoffner merged 6 commits into
mainfrom
fix/FIX-1577-panel-page-ceiling

Conversation

@jhoffner

@jhoffner jhoffner commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

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.
  • Live boards (BoardColumns with live): 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
  • New tests in packages/react/test/panels.test.ts:
    • Roster, 1,001 seats at limit: 1: shows the error and Retry, no seats, exactly 1,000 requests.
    • Roster, 1,000 seats at limit: 1: all 1,000 render with no error (the boundary case).
    • BoardColumns with a transport whose nextCursor never runs out: shows the error, no cards, stops at 1,000 requests.
  • Red state: with reads.ts reverted, both error tests fail and the boundary test passes.
  • The existing 51-row / two-request tests pass unchanged. pnpm --filter @flow-state-dev/react test: 28 files, 324 tests passed. pnpm --filter @flow-state-dev/react typecheck is clean.
  • Changeset: @flow-state-dev/react patch, because consumers can now see an error where they used to get partial rows.
  • Out of scope: raising or removing 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 usePanelRows paging) no longer treat the first 1,000 pages as a complete list when nextCursor is 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 at limit: 1) and a board with an endless nextCursor.

Reviewed by Cursor Bugbot for commit 931fdf9. Configure here.

…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
@vercel

vercel Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

3 Skipped Deployments
Project Deployment Actions Updated
flow-state-dev-docs Ignored Ignored Sep 30, 2026 8:43pm UTC
flow-state-dev-kitchen-sink Ignored Ignored Sep 30, 2026 8:43pm UTC
flow-state-dev-ui Ignored Ignored Preview Sep 30, 2026 8:43pm UTC

Request Review

@linear-code

linear-code Bot commented Sep 30, 2026

Copy link
Copy Markdown

FIX-1577

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-30T20:38:28.250169Z 7754e62 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copy link
Copy Markdown
Collaborator Author

Second look + architecture pass

Verdict: the approach is right. Nothing blocking. Throwing at the ceiling reuses the existing useFencedRead catch → retryLine path, so the fix is ~4 lines in one place. Erroring (rather than partial rows + warning) is the lean option and matches the architect's rule. The boundary is correct: a cursor-less 1,000th page returns, only a 1,000th page that still has a cursor throws. The boundary test plus the 1,001 test cover both sides.

Worth addressing (small)

  1. BoardList is also affected and isn't mentioned or tested. usePanelRows has three callers: Roster, BoardColumns, and BoardList (BoardList.ts:153, which renders retryLine(state.error, …) at :163). The fix lands in all three, but the PR description and changeset name only two, and there's no BoardList case. The behavior is correct by construction. I'd fix the wording ("the panels", or list all three) in the changeset and PR body so consumers of BoardList aren't surprised. A test is optional, since the shared hook is covered.

  2. The error text is shown to end users verbatim. describe() passes error.message straight into retryLine. "Stopped after 1000 pages with more still to read, rather than show part of the list as all of it." explains the design decision to the reader, which is an outsider-rule smell. Something like The list is too long to load (stopped after 1000 pages). Retry. (or matching devtool's "the server kept returning more pages after N, so the read stopped") says what happened without narrating intent. The tests match on /more still to read/, so they'd need a small update.

Architecture (opportunity, not a blocker)

  • Two parallel page-ceiling implementations. packages/devtool/src/react/lib/inventory.ts has its own INVENTORY_MAX_PAGES = 1000 and already fails with stopped(...) at the ceiling, and its comment says it mirrors MAX_PAGES in react's panel reads. After this PR the two now agree on behavior, which is the real value here. The PR correctly leaves consolidation to FIX-1507. I'd keep it out of this PR, but make sure FIX-1507 covers the paged-read loop (not just the fence), so the "1000 + error" contract lives in one place instead of a comment cross-reference.
  • Cost of the failure path: an endless source now burns 1,000 sequential requests before showing the error, and "Retry" repeats that. That's the pre-existing ceiling rather than something this PR adds, and I wouldn't change it here. It's just worth knowing that Retry on a genuinely >1,000-page collection will deterministically fail again.
  • Live boards: as the PR notes, a re-read that hits the ceiling replaces already-drawn rows with the error. That's consistent with every other failed re-read, so I agree it's fine, and it's a reasonable thing to leave to the reviewer.

Smaller notes

  • The MAX_PAGES doc comment and the usePanelRows doc ("bounded by MAX_PAGES") read correctly after the change. The (BR-19, BR-21) references follow the file's existing convention.
  • The changeset is appropriate (visible behavior change for consumers); (FIX-1577) in it follows the repo's changeset convention.

No refactor is warranted beyond the wording fixes above.


Generated by Claude Code

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

/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):

  1. Shared paging helper — DevTool inventory.ts already has INVENTORY_MAX_PAGES = 1000 and readEveryPage() with duplicate-cursor detection; panels still inline the loop. Extracting readAllCollectionPages to @flow-state-dev/client would dedupe constants and defenses, but that’s a wider refactor than FIX-1577; worth a follow-up issue, not a merge blocker.

  2. Test cost — Roster ceiling tests use limit: 1 and 1,000 mock round-trips each; pagedSource’s findIndex per page adds O(n²) in the mock. Faithful given private MAX_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).

  3. Test symmetry (nit) — Roster gets both failure and “exactly 1000 pages succeeds”; BoardColumns only adds the endlessSource failure case. Hook coverage is shared via usePanelRows; mirroring the success boundary on BoardColumns is optional parity, not required.

  4. Comment overlap (nit) — BR-19/BR-21 and “ceiling = misbehaving transport” now appear in both the MAX_PAGES block and usePanelRows JSDoc; 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.

Open in Web View Automation 

Sent by Cursor Automation: Review For Best Approach

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.
  • endlessSource has one caller. Inlining it moves the same lines into the test. pagedSource with 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_PAGES comment 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.

Open in Web View Automation 

Sent by Cursor Automation: Code Snob

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread .changeset/panel-page-ceiling-error.md Resolved
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

Copy link
Copy Markdown
Collaborator Author

from: fsd-claude
session: issue-desk-0930
kind: ask

@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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread packages/react/test/board-list.test.ts Resolved
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

Copy link
Copy Markdown
Collaborator Author

from: fsd-claude
session: issue-desk-0930
kind: ask

@codex review

🤖 Generated with Claude Code

https://claude.ai/code/session_01DME8pzA4e4Rc7fRLGsYavW


Generated by Claude Code

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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

Copy link
Copy Markdown
Collaborator Author

from: fsd-claude
session: issue-desk-0930
kind: ask

@codex review

Head ba78cf8 updates packages/react/README.md to cover the panels' 1,000-page ceiling, the error and Retry state it causes, and raising limit as the fix.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DME8pzA4e4Rc7fRLGsYavW


Generated by Claude Code

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread packages/react/README.md Resolved
…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

Copy link
Copy Markdown
Collaborator Author

from: fsd-claude
session: issue-desk-0930
kind: ask

@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 limit JSDoc blocks and usePanelRows, and the README qualifies when raising limit helps.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DME8pzA4e4Rc7fRLGsYavW


Generated by Claude Code

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread packages/react/README.md Resolved
…eat limit as a hint

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DME8pzA4e4Rc7fRLGsYavW

Copy link
Copy Markdown
Collaborator Author

from: fsd-claude
session: issue-desk-0930
to: codex
kind: ask

@codex review

Head 44efb32: the panels' raise-limit remedy and the ~200,000-row ceiling (README and the MAX_PAGES comment) now apply only when the collection honours the requested page size. A projected collection may treat limit as a hint. No runtime change.


Generated by Claude Code

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@jhoffner
jhoffner merged commit 6fb740e into main Sep 30, 2026
12 of 13 checks 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.

Panel row loop silently truncates when it hits its page ceiling

2 participants