fix(ui): iOS bubble width hugging + scroll auto-follow/jump-to-latest - #10
Merged
Conversation
Bubble width: point SwiftStreamingMarkdown at our fork's fix-paragraph-hugging-width branch (upstream issue #157, PR #158, not merged yet) instead of main - fixes AssistantBubbleView/ HumanAgentBubbleView always filling to the 80% width cap regardless of reply length. Scroll: rewrite MessageListView with the "flip trick" (SwiftUI's answer to Android's LazyColumn(reverseLayout = true), since ScrollView has no native reverse-layout flag) - render messages newest-first and flip the whole scroll view plus a counter-flip per row. This makes "stay at the anchor" (offset 0) the natural resting position instead of a moving target that has to be actively chased, which is what kept causing the jump-to-latest button to flash and auto-follow to stall mid-stream (most recently: correct bubble hugging made width - not just height - change during streaming, reflowing line breaks non-monotonically and confusing the old height-based tracking). Also replaces the iOS 16/17 GeometryReader-based button-visibility tracking, which broke under the flip (measuring through a coordinate space named after the .scaleEffect transform), with onScrollGeometryChange's real contentOffset on iOS 18+.
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
ui-ios's SwiftStreamingMarkdown dependency at our fork'sfix-paragraph-hugging-widthbranch (filed upstream as microsoft/SwiftStreamingMarkdown#157, fix in #158, not merged yet) - fixes AI/agent chat bubbles always filling to the 80% width cap instead of hugging short replies.MessageListView's scroll handling using the SwiftUI "flip trick" (the equivalent of Android'sLazyColumn(reverseLayout = true)) - fixes the jump-to-latest button flashing and auto-follow stalling mid-stream, which kept recurring across several fix attempts once bubble width became genuinely content-driven.Test plan
Package.swiftback to upstreammainonce Fix paragraph/heading blocks always reporting full offered width microsoft/SwiftStreamingMarkdown#158 merges🤖 Generated with Claude Code