Repository navigation
Keep a chat's projected rows and composer height with its transcript (851-4335) - #1406
Merged
Merged
Conversation
…(851-4335) The chat view held its projected transcript rows, their version, the publication state, the projection worker and the composer height as view state, so they were thrown away with the view and rebuilt from empty each time a tab was reopened. They now live with the chat's cached transcript surface: - TranscriptSettledProjection (TranscriptKit) owns the rows, their version, the publication state and the worker. Submitting the request that is already published keeps the rows and drops any newer projection still running. - TranscriptComposerMetrics holds the composer height, so every view of one transcript asks for the same rows. Reopening an evicted tab no longer starts from empty rows: about 158 ms to about 107 ms of main-thread work on the Debug bench. It is also the first piece of chat state a reused chat view needs to switch chats in one pass. Co-Authored-By: Claude Fable 5.2 <[email protected]>
This was referenced Nov 18, 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 851-4335 (tab state in models), under 851-4331.
What changed
The macOS chat view kept its projected transcript rows, their version, the publication state, the projection worker and the composer height as view state. That state died with the view, so reopening a tab started from empty rows and projected again.
It now lives with the chat's cached transcript surface:
TranscriptSettledProjection(TranscriptKit, unit tested) owns the rows, their version, the publication state and the worker. Submitting the request that is already published keeps the rows and drops any newer projection that is still running.TranscriptComposerMetricsholds the composer height, so every view of one transcript asks for the same rows.No visual change.
Why
This is the first piece of chat state the reused chat view needs (851-4336 spike): with the rows in view state, re-pointing a chat view took three update passes (old chat's rows pushed into the new transcript, cleared, reloaded). It also helps today's deck on its own.
Numbers
Debug build, 500-turn chats,
main-thread work per switch, same script before and after, fresh launch:The machine was shared with other builds during both runs, so treat the neighbour-step difference as noise.
Notes for review
TranscriptRowProjectionCachealready relies on the same thing (it returns cached rows for an equal key without looking at the input).TranscriptSettledProjectionlater.Tophat (dev app,
TRANSCRIPT_STRESS=1)swift test --filter TranscriptSettledProjectionTests(3 tests; each fails when the behaviour it names is removed),swift:format:check,swift:lint.🤖 Generated with Claude Code