fix: Request layout update after setting markup in AgentStatusLabel#266
Open
ethanyhou wants to merge 1 commit into
Open
fix: Request layout update after setting markup in AgentStatusLabel#266ethanyhou wants to merge 1 commit into
ethanyhou wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
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 fromChatContentViewer.refreshScrollerLayout()after updating min dimensions. - Call
requestLayout()inAgentStatusLabel.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. |
Member
|
@ethanyhou Do you have any data point about how perf boost can get with this change? |
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.
setMinSizealready called layout, force layout inrefreshScrollerLayoutaftersetMinSizeis expensive and redundant, should be removed.AgentStatusLabelshould requestLayout after text changes.