Repository navigation
perf(ui): a long transcript keeps only the turns near the view, so reading it back to its start no longer fills a phone's memory - #802
Merged
Michael McQuade (giraffesyo) merged 1 commit intoNov 17, 2026
Conversation
…ading it back to its start no longer fills a phone's memory The message list drew a long conversation's end and the turns before it as the reader scrolled up, but never let go of a turn once drawn. Reading back to the first turn of a long agent session drew it whole, and a phone's browser closes the tab long before that. The list now keeps a window of whole turns around the view in both directions: - Within two screens of either edge it draws about 100 more parts there. - Turns more than four screens from the view are let go of, above and below, and what the reader is looking at stays where it is. - Once the end has been let go of, new turns, the reply being written and the queue wait below until the reader comes back; the jump control brings them back to the end and follows it. - A turn the reader is editing, selecting text in or reached with the keyboard is kept. - What the reader opened in a turn (a tool's output, a thought, a folded run, a long reply) is open again when the turn is drawn again. Expand-all and a new conversation start afresh. - Turns drawn again appear at once rather than entering as new ones.
Michael McQuade (giraffesyo)
deleted the
perf/transcript-keeps-what-is-near
branch
November 17, 2026 15:15
This was referenced Nov 17, 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.
Summary
The message list draws the end of a long conversation and the turns before it as the reader scrolls up (#795), but it never lets go of a turn once drawn. Reading a long agent session back to its first turn draws all of it again, and on a phone that is more memory than the tab that #795 kept from closing.
The list now keeps a window of whole turns around the view, in both directions:
The long agent session story scrolled to its first turn and back, before on the left and after on the right, each with a counter of the elements its transcript holds. Before keeps every turn it passed; after lets go of the turns it left behind:
long-session.mp4
It looks as it did, at desktop and phone width:
wholestill draws every message, whichSessionView's find uses. A follow-up moves find off it.Testing
ChatMessageList.window.test.tsxcovers the window: letting go of turns far above and far below without moving the view, drawing them again on the way back without animating them, holding new turns and the streaming reply while short of the end, jumping back to the end from far above it, not taking the window's foot for the end, keeping an edited or selected turn, and starting the memory of opened blocks afresh on an expand-all change or a cleared conversation.AgentMessageParts.test.tsxcovers a tool's output and a thought opening again when drawn again. Each test fails with the code it covers broken.Measured in a host app's production build, against an agent session of 100 turns with 4,000 tool calls and 800 edits, before and after, alternating between them:
Before is this branch's base built from source the same way, so the two differ only by this change. Three rounds each for memory; the line at the top of the view never moved by more than 2px in either.
Measured again after release on the published packages, 0.145.1 against 0.146.1, which the host styles from their compiled files (the source builds above lacked some of the package's classes): at the first turn 1,066–1,257 MB against 487–509 MB on a phone, back at the end 1,099–1,365 MB against 530–629 MB, and 192,453 against 4,783 DOM nodes in Chromium. Both load 1,869 KB up front, and opening the session took a median of 1,100 ms against 1,084 ms.
Letting go of turns above only once scrolling paused was tried and dropped: during a fling the list then held as much as before.
Checklist
make checkpasses: its TypeScript half (lint-js,test-js,verify-build); no Go changedproblem/messages/(none)