Skip to content

Page through the graph window and load more without losing your place - #40

Merged
Phoenixrr2113 merged 1 commit into
mainfrom
feat/graph-pagination
Aug 23, 2026
Merged

Page through the graph window and load more without losing your place#40
Phoenixrr2113 merged 1 commit into
mainfrom
feat/graph-pagination

Conversation

@Phoenixrr2113

Copy link
Copy Markdown
Owner

Requested in use: since the canvas shows a bounded window, users should be able to get the next 300, and the next.

  • Paging: both window routes accept an offset and return page metadata (offset, limit, returned, hasMore, nextOffset) with honest totals. Ordering is globally consistent: the reviewer walked every page of this repository's 19k-node index and proved the union is exact with no duplicates or gaps, with stable tie assignment at page boundaries across repeated calls and an unrelated reindex. Cost is flat: 186 ms at offset 0, 162 ms at 18,000.
  • Induced edges for loaded ids: a bounded POST (2,000 ids, deduplicated, project-scoped, CSRF-guarded) so an appended page connects to nodes already on screen.
  • Explorer: Previous and Next replace the canvas with a nodes A to B of M indicator; Load next N appends while preserving the viewport and positions exactly like expansion, chunking induced-edge requests under the cap; offset persists with the other view state; Back returns to the prior page; Reset returns to page one.

Review found one blocker: Load more requested induced edges without the project scope. Fixed with a test locking the request body.

Verification: pnpm turbo build 21/21, test 36/36, typecheck 20/20. Graph 164 tests, api 311, dashboard 97.

🤖 Generated with Claude Code

The window is deterministic, so the next 300 is well defined. Both
window routes accept an offset and return page metadata with honest
totals; pages are globally consistent (page N plus N plus 1 equals the
first 2N window, proven by walking the whole index with no duplicates
or gaps) and cost the same at offset 18,000 as at 0. A bounded POST
returns edges induced among a set of loaded ids so an appended page
connects to what is already on screen. The explorer gains Previous and
Next with a nodes A to B of M indicator, and Load next N, which appends
while preserving the viewport and positions, chunking induced-edge
requests under the cap and carrying the project scope on every chunk
after review caught it missing. Offset persists with the other view
state and Back returns to the prior page.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Aug 23, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
v0-landing-page-build Skipped Skipped v0 Aug 23, 2026 7:16pm

@Phoenixrr2113
Phoenixrr2113 merged commit dd93002 into main Aug 23, 2026
12 checks passed
@Phoenixrr2113
Phoenixrr2113 deleted the feat/graph-pagination branch August 23, 2026 19:22
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.

1 participant