Virtualize long chat transcripts - #458
Merged
Merged
Conversation
cfal
force-pushed
the
virtual-chat
branch
4 times, most recently
from
August 5, 2026 13:19
7f38f29 to
c23a13b
Compare
cfal
marked this pull request as ready for review
August 5, 2026 14:10
Revealing after the first settled batch let every remaining reveal batch re-anchor the end in plain view, and the overlay scrollbar thumb was never gated at all, so chat switches flickered through intermediate scroll positions and thumb sizes before settling at the bottom.
Explicit end scrolls and destroy now cancel the hidden reading offset per the cancellation ledger, destroyed controllers no longer arm pending end scrolls, and hidden-restore offset writes revalidate surface identity so a replacement during an in-flight restore cannot scroll the new surface to the old offset. Adds direct coverage for user-intent cancellation, the detached text-scale anchor branch, single subscription teardown, and projection count-shrink emitting no global reset.
Samples every frame across chat switches to reject content painted away from the physical end or visible through the initial paint gate, holds the data revision across the stable-layout window, and adds pinned hide/show, hidden text-scale, and post-shrink later-publication scenarios.
Gates the git-history Chromium suite on a current web build, fixes the vacuous concurrent-change cache test, covers corrupt and wrong-version build markers, tightens the build-cache type declarations, and renames the stale Chromium workflow job label.
…ss probe Pinned publications wrote their end correction one animation frame after commit, painting a frame at the pre-mutation offset for every late history chunk or streamed publication; the correction now lands after the sizer commits but before paint, with the convergence loop verifying later frames. The viewport-fill probe also treated itemSizeCache membership as proof of measurement, so wrappers rendered exactly at their estimate probed forever; rendered keys now resolve to their exact estimates.
The pinned show path's end convergence can be superseded by a concurrent show-time publication, stranding the viewport short of the physical end after late measurements; the scroll controller now rechecks the end once after fill and layout settle. Anchor capture and root-offset observation move to the runtime module, and the Lightpanda paging test awaits the initial paint gate instead of asserting instant readiness.
Settle diagnostics now name the failing scenario, and the show-time end recheck retries across up to three layout-settle windows so deferred scale invalidation that lands after the first recheck still converges.
A root-offset change while pinned at the end moves the physical end outside TanStack's anchoring with no repin owner; the margin observer now restores the end when the viewport rested there. Stable-layout diagnostics carry the failing scenario name inside the thrown error.
…ing stale elements after index shifts
Remove the staged initial-reveal batching so activating a cached chat publishes the bounded transcript window atomically; virtualization still limits mounted row work. Harden the TanStack virtual-core patch to ignore delayed in-range resize entries whose stale index now resolves to a key owned by another connected element, preventing misattributed row sizes during history prepends. Add patch contract and geometry stability coverage.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Long chat histories currently mount every loaded message, making deep conversations progressively slower and less stable. This change virtualizes the primary chat feed with TanStack Virtual while preserving pinned and detached scrolling, history paging, navigation, transient interaction state, accessibility announcements, and generation-aware transcript windows, with focused browser and state coverage for large variable-height conversations.
Stabilization rationale
data-indexreach key lookup and measurement after the item count shrinks. The branch pins the exact upstream fix (#1246, commitd2cf98be) as a Bun package patch (patches/README.mddocuments the removal condition), deletes the local count-shrink measurement-reset protocol it replaced, and keeps text scale as the only global measurement reset.web/build: the build-input hash covers client sources, the rootbun.lock, andpatches/, and the production build environment is normalized soNODE_ENV=testprocesses can validate production builds.Chat open and switch behavior (user-visible)
Product decisions
Release blockers (manual evidence pending)
Migration notes
Client-only change. No server, API, WebSocket, or storage migrations.