Skip to content

fix: Request layout update after setting markup in AgentStatusLabel#266

Open
ethanyhou wants to merge 1 commit into
mainfrom
ethan/refine-layout
Open

fix: Request layout update after setting markup in AgentStatusLabel#266
ethanyhou wants to merge 1 commit into
mainfrom
ethan/refine-layout

Conversation

@ethanyhou
Copy link
Copy Markdown
Contributor

  1. setMinSize already called layout, force layout in refreshScrollerLayout after setMinSize is expensive and redundant, should be removed.
  2. AgentStatusLabel should requestLayout after text changes.

Copilot AI review requested due to automatic review settings May 28, 2026 03:28
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 optimizes chat UI layout behavior by removing a redundant forced layout pass in the scrolled chat viewer and ensuring the agent status label triggers a layout request after markup/text updates, improving responsiveness while avoiding unnecessary work.

Changes:

  • Remove an explicit layout(true, true) call from ChatContentViewer.refreshScrollerLayout() after updating min dimensions.
  • Call requestLayout() in AgentStatusLabel.setText() after updating markup to ensure the composite reflows properly.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/chat/ChatContentViewer.java Removes a redundant forced layout call during scroller size refresh to avoid unnecessary layout work.
com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/chat/AgentStatusLabel.java Requests layout after status text/markup changes so the label size/layout updates correctly.

@jdneo
Copy link
Copy Markdown
Member

jdneo commented May 29, 2026

@ethanyhou Do you have any data point about how perf boost can get with this change?

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.

3 participants