Repository navigation
perf(transcript): bound the tail window, stop forced layout per push, idle cache write (#1475) - #1482
Merged
currentbits merged 3 commits intoOct 5, 2026
Conversation
Streaming into an open thread kept the window's start index, and the 120-entry cap ignored size, so six long answers took one transcript from 24.7k to 62.2k DOM nodes. The tail window is now capped at 120 entries and 100k chars of message text. While the view is stuck to the bottom, appends advance the start; scrolled up, the start stays put, and Show earlier pages entries back in as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The pin layout effect read scrollHeight after every push, forcing a synchronous layout (~25-30 ms/s while streaming). It now pins before paint only for #607's cases: opening or switching a thread, and a new permission or question card (plus any pending forceStick). Plain appends are pinned by the existing ResizeObserver once the browser has laid out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Stringifying a 3 MB detail into localStorage took ~17 ms inside the thread-switch frame. The write now waits for requestIdleCallback (2 s timeout, setTimeout where it is missing), and saves made before then coalesce into one write of the latest detail. A load in that gap returns the pending detail. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This was referenced Oct 5, 2026
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.
Part of #1475. Fixes renderer findings 2 (the transcript grows without bound) and 3 (forced layout on every push), and the localStorage part of finding 6.
What changed
tailWindowStart): at most 120 entries and 100k characters of message text are mounted. While stuck to the bottom, appends move the start forward. When you've scrolled up, nothing above you is removed, and Show earlier still pages entries back in.useStickToBottomonly pins before paint for the Thread view drops autoscroll on thread switch and permission prompts #607 cases (opening or switching a thread, a new permission or question card, a pendingforceStick). Appends are pinned by the existing Thread view strands above the bottom when content grows without a state change #408 ResizeObserver, which fires after layout and before paint.saveCachedThreadDetailwrites onrequestIdleCallback(2 s timeout,setTimeoutfallback), merging several saves into one write.content-visibility: auto. With it, content jumped up to 358 px while scrolling up, because.bodyhasoverflow-anchor: nonefor Thread view drops autoscroll on thread switch and permission prompts #607. It also gave no measurable gain once the window is bounded.Measured (worker, production build, seeded 1,000-message thread, headless Chromium, medians of 3):
Thread-switch time is unchanged in this harness. On real data, the remaining switch cost is provenance, which #1478 fixed.
Verified independently
🤖 Generated with Claude Code