Skip to content

thinking content improvements#301265

Merged
justschen merged 2 commits intomainfrom
justin/klang
Mar 12, 2026
Merged

thinking content improvements#301265
justschen merged 2 commits intomainfrom
justin/klang

Conversation

@justschen
Copy link
Collaborator

  • performance
  • general rendering fix

Copilot AI review requested due to automatic review settings March 12, 2026 22:11
@vs-code-engineering vs-code-engineering bot added this to the 1.112.0 milestone Mar 12, 2026
Copy link
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 improves the chat “thinking” content rendering path, focusing on reducing layout work during streaming updates and ensuring tool invocations that should be hidden are removed at the right time.

Changes:

  • Flush pending tool-removals before first expansion so removed items aren’t materialized from lazyItems.
  • Batch scroll dimension updates into a single requestAnimationFrame pass and reuse a measured contentHeight to avoid extra layout reads.
  • Remove tool entries when they reach Completed/Cancelled if their presentation is hidden or hiddenAfterComplete.
Comments suppressed due to low confidence (1)

src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.ts:1323

  • This adds new behavior to remove tools with presentation === 'hiddenAfterComplete' once they reach Completed/Cancelled, but there’s no corresponding test coverage. Please add a unit test that simulates a tool invocation transitioning to Completed/Cancelled while the thinking part is collapsed and asserts the tool entry is removed (and not rendered later).
						// Remove tools that should be hidden now or after completion.
						if (toolInvocationOrMarkdown.presentation === 'hidden' || toolInvocationOrMarkdown.presentation === 'hiddenAfterComplete') {
							this.pendingRemovals.push({ toolCallId: toolInvocationOrMarkdown.toolCallId, toolLabel: currentToolLabel });
							this.schedulePendingRemovalsFlush();
						}

You can also share your feedback on Copilot code review. Take the survey.

@justschen justschen enabled auto-merge (squash) March 12, 2026 22:20
@justschen justschen merged commit 2560996 into main Mar 12, 2026
20 checks passed
@justschen justschen deleted the justin/klang branch March 12, 2026 22:52
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