Skip to content

Virtualize conversation history and preserve scroll position (#11) - #17

Merged
tanRdev merged 1 commit into
mainfrom
feat/issue-11-virtualize
Nov 10, 2026
Merged

tanRdev merged 1 commit into
mainfrom
feat/issue-11-virtualize

Conversation

@tanRdev

@tanRdev tanRdev commented Nov 10, 2026

Copy link
Copy Markdown
Owner

Closes #11.

  • Stable turn identities: a createChatTurnsBuilder() preserves unchanged turn identities across renders instead of rebuilding every turn each render.
  • Windowing: a pure windowing engine (virtual-turn-window.ts) with measured/estimated layout, bounded mounted selection (1200px overscan), exact spacer accounting, and anchor capture/resolve with a per-thread anchor store. Completed turns are windowed; the active/streaming turn is always mounted; a search-targeted turn is force-mounted so search reveal still lands on unmounted results.
  • Scroll preservation: per-thread anchors are saved and restored across streaming and thread switching. The panel spec includes a 2000-turn fixture asserting at most 30 mounted rows.

Verification: 78 tests across all specs touching these modules pass; desktop typecheck exit 0; biome, file-size, and import-boundary checks pass. Honest limitation: real-layout behavior is proven at the pure-math level (jsdom has no layout); a Playwright pass in the real Electron window is the follow-up for end-to-end scroll proof.

@tanRdev
tanRdev merged commit 4b676cf into main Nov 10, 2026
1 check 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.

P2: Virtualize conversation history and preserve scroll position

1 participant