Skip to content

fix(macos): keep chat text layout contiguous to prevent streaming gap/overlap#26317

Merged
siddseethepalli merged 1 commit into
mainfrom
siddseethepalli/fix-chat-text-noncontig-layout
Apr 18, 2026
Merged

fix(macos): keep chat text layout contiguous to prevent streaming gap/overlap#26317
siddseethepalli merged 1 commit into
mainfrom
siddseethepalli/fix-chat-text-noncontig-layout

Conversation

@siddseethepalli
Copy link
Copy Markdown
Contributor

@siddseethepalli siddseethepalli commented Apr 18, 2026

Summary

  • Remove NSLayoutManager.allowsNonContiguousLayout = true from VSelectableTextView (chat-bubble text). The measurement path uses a separate TextKit stack that lays out every glyph via ensureLayout, so the .frame(height:) we hand SwiftUI assumes the NSTextView will render every glyph in that rect. Non-contiguous layout races with streaming updates: the NSTextView briefly paints a smaller laid-out region inside the correctly-measured larger frame (visible gap between thinking block and text), and when the lazy glyphs eventually paint they can fall outside the frame into the sibling's space (interleaved-line overlap between paragraphs).
  • Code-view paths (VCodeView, HighlightedTextView) keep their own allowsNonContiguousLayout = true — those solve a different scroll-view-attachment hang and don't participate in chat streaming, so the perf fix from Enable non-contiguous glyph layout for NSTextView-backed code views #26242 is preserved there.
  • Verified: the gap between thinking block and streaming response text goes away, and the paragraph-overlap during streaming stops.

Open in Devin Review

@siddseethepalli siddseethepalli merged commit 57d2209 into main Apr 18, 2026
@siddseethepalli siddseethepalli deleted the siddseethepalli/fix-chat-text-noncontig-layout branch April 18, 2026 05:54
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f89fbd414c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

View 2 additional findings in Devin Review.

Open in Devin Review

@siddseethepalli
Copy link
Copy Markdown
Contributor Author

Addressed in #26457

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