e30e75b5d4
Code Quality / Oxlint + Oxfmt (push) Waiting to run
Code Quality / Template Sync (push) Waiting to run
Code Quality / Build Changed Packages (push) Waiting to run
Code Quality / Test Changed Packages (push) Waiting to run
Deploy Expo Example / Deploy Production (push) Waiting to run
Deploy Ink Example / Deploy Production (push) Waiting to run
Python Tests / pytest (assistant-stream, 3.10) (push) Waiting to run
Python Tests / pytest (assistant-stream, 3.12) (push) Waiting to run
Python Tests / pytest (assistant-ui-sync-server-api, 3.10) (push) Waiting to run
Python Tests / pytest (assistant-ui-sync-server-api, 3.12) (push) Waiting to run
Deploy Shadcn Registry / Deploy Production (push) Waiting to run
Template Metrics / LOC + Bundle Size (push) Waiting to run
Changesets / Create Version PR (push) Has been cancelled
1016 B
1016 B
Virtualized thread example
Renders a 500-message thread with @tanstack/react-virtual so only the turns near the viewport are mounted. The runtime is a self-contained external store with a fake streaming reply, so the example runs fully offline with no environment variables.
Quick start
pnpm install
pnpm --filter with-virtualized-thread dev
What the example demonstrates
| Concern | File |
|---|---|
Virtualizer over user turns, padding spacers, measureElement |
app/VirtualizedThread.tsx |
Id-keyed per-message rendering through ThreadPrimitive.Unstable_MessageById |
app/VirtualizedThread.tsx |
| Sticky-bottom auto-follow with a user-scroll disarm guard | app/VirtualizedThread.tsx |
| External store runtime with seeded messages and a streaming tail | app/MyRuntimeProvider.tsx |
| Deterministic synthetic thread content | app/seed-messages.ts |
See the thread virtualization guide for the full walkthrough.