Skip to content

Add useWindowQuery and virtualized archive demo - #99

Merged
KidkArolis merged 8 commits into
masterfrom
codex/virtualized-archive-demo
Aug 16, 2026
Merged

Add useWindowQuery and virtualized archive demo#99
KidkArolis merged 8 commits into
masterfrom
codex/virtualized-archive-demo

Conversation

@KidkArolis

@KidkArolis KidkArolis commented Aug 15, 2026

Copy link
Copy Markdown
Collaborator

What changed

  • add useWindowQuery as a typed, Suspense-native hook for viewport-indexed relational lists
  • return a sparse ReadonlyMap<number, Item> plus the server total, with per-reader end-exclusive ranges
  • detect offset or cursor pagination from the adapter: offset windows jump directly, while cursor windows walk from retained index checkpoints
  • preload neighboring blocks and evict distant block queries with configurable pageSize, preloadPages, and maxPages
  • preserve Figbird query-builder composition for relations, server filters/search, sorting, definitions, nullable requests, skip, and staleTime
  • refactor the Archive demo onto useWindowQuery + TanStack Virtual, including a real scrollbar, deep reload restoration, server search/sort, and assignee/team/label joins
  • keep the Archive surface aligned with the existing demo's neutral visual system
  • document virtualized-window behavior, including the different restore semantics for offset and cursor services

Design notes

The visible range is subscriber state rather than query identity, so readers of the same list share one interned window controller. Root block queries are ephemeral and vacuum when evicted; normalized entities and relation data remain reusable by the rest of Figbird.

Cursor pages do not assume a response contains exactly pageSize rows. The controller tracks the actual absolute interval returned by each page, so short pages with hasMore: true still advance correctly.

Validation

  • npm run test — 349 tests pass, including typecheck, lint, formatting, and AVA
  • demo TypeScript check
  • demo Vite production build
  • browser QA: initial load, deep offset jump, reload restoration without rebuilding the offset prefix, upward/downward loading, bounded mounted rows, server search, server sorting, and clean current runtime
  • manual native-cursor smoke check, including short non-terminal pages

Built from the latest origin/master before publication.

@KidkArolis
KidkArolis marked this pull request as ready for review August 15, 2026 15:47
@KidkArolis KidkArolis changed the title Add virtualized archive demo Add useWindowQuery and virtualized archive demo Aug 15, 2026
@KidkArolis
KidkArolis merged commit 01498ed into master Aug 16, 2026
1 check passed
@KidkArolis
KidkArolis deleted the codex/virtualized-archive-demo branch August 16, 2026 11:34
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