Skip to content

fix(ui): iOS bubble width hugging + scroll auto-follow/jump-to-latest - #10

Merged
ramonfsk merged 1 commit into
devfrom
fix/ios-bubble-hug-and-scroll
Jul 25, 2026
Merged

fix(ui): iOS bubble width hugging + scroll auto-follow/jump-to-latest#10
ramonfsk merged 1 commit into
devfrom
fix/ios-bubble-hug-and-scroll

Conversation

@ramonfsk

Copy link
Copy Markdown
Owner

Summary

  • Point ui-ios's SwiftStreamingMarkdown dependency at our fork's fix-paragraph-hugging-width branch (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.
  • Rewrite MessageListView's scroll handling using the SwiftUI "flip trick" (the equivalent of Android's LazyColumn(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

🤖 Generated with Claude Code

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+.
@ramonfsk
ramonfsk merged commit 524e148 into dev Jul 25, 2026
@ramonfsk
ramonfsk deleted the fix/ios-bubble-hug-and-scroll branch July 25, 2026 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant