Skip to content

fix - stale code block height during incremental chat layout#343

Open
xinyi-gong wants to merge 2 commits into
mainfrom
tori/codeblock
Open

fix - stale code block height during incremental chat layout#343
xinyi-gong wants to merge 2 commits into
mainfrom
tori/codeblock

Conversation

@xinyi-gong

Copy link
Copy Markdown
Member

Summary

  • Add a computeSize(...) override for SourceViewerComposite so code block height is measured synchronously from the current StyledText content.
  • Reuse a shared height helper in both measurement and async bounds refresh to keep scrollbar-height handling consistent.
  • Prevent incremental chat layout from caching stale code block heights while large code blocks are still waiting for async setBounds(...).

Copilot AI review requested due to automatic review settings July 8, 2026 09:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR improves chat code-block layout stability by ensuring SourceViewerComposite reports an up-to-date height synchronously (via computeSize(...)), reducing the chance that incremental chat layout caches stale code-block heights while async setBounds(...) is pending.

Changes:

  • Override computeSize(...) in SourceViewerComposite to measure height directly from the current StyledText content.
  • Factor out a shared getSourceViewerHeight(...) helper and reuse it in refreshScrollerLayout() for consistent scrollbar-height handling.

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.

2 participants