Repository navigation
Conversation
The composer draft was a property on ConversationScreenModel, bound with $bindableScreenModel.composerInputText inside ConversationDestinationScreen's body. Every keystroke re-ran that body, rebuilt ConversationView with new closures, and re-rendered the transcript. Measured over 104 keystrokes after a finished Claude turn in the simulator: ConversationView.body 81 -> 1 MessageList.body 268 -> 4 BottomChrome.body 81 -> 1 pinned-diff rebuild 81 -> 1 The cost grows with the transcript, which is why typing froze once a turn had added tool output and markdown. - Move the draft text and attachments into ConversationComposerDraft, an observable passed down by reference. Only ComposerDraftBinder, a leaf in the bottom chrome, builds the bindings, so keystrokes invalidate the composer alone. - ConversationPinnedContextStrip built the combined diff in init on every parent re-render although SwiftUI keeps only the first @State initial value; build it in onChange(initial: true) instead. - Add live UI tests against a kittylitter host (skipped unless env is set): typing after a turn settles, a screenshot tour, and open-session timing. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Owner
Author
|
Superseded by #404, which shipped these changes in 2.1.9. |
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.
Purpose
Typing in a conversation froze once a turn had finished. Each keystroke re-rendered the whole conversation screen and transcript, and that cost grows with the transcript.
Root cause
The draft text was a property on
ConversationScreenModel, bound with$bindableScreenModel.composerInputTextinsideConversationDestinationScreen.body. Every keystroke re-ran that body, rebuiltConversationViewwith fresh closures, and re-rendered the message list.Measured with temporary render probes, 104 keystrokes after a finished Claude turn (live kittylitter host, iPhone 17 Pro simulator):
Changes
ConversationComposerDraft, an observable passed by reference. OnlyComposerDraftBinder(a leaf) builds the bindings.ConversationPinnedContextStripbuilt its combined diff ininiton every parent re-render; it is now built inonChange(initial: true).Android checked: its draft lives in
ComposerBarstate, and the write-back flow has no parent collector, so no change is needed.Verification
make ios-sim-fastsucceeds; live testtestOpenSessionwith send passes; probe counts above.🤖 Generated with Claude Code