diff --git a/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.ts b/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.ts index bbab1de37aa..d695b515e88 100644 --- a/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.ts +++ b/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.ts @@ -500,6 +500,10 @@ export class ChatThinkingContentPart extends ChatCollapsibleContentPart implemen height: viewportHeight, scrollHeight: contentHeight }); + + // Re-evaluate hover feedback as content grows past the max height, + // reusing the already-measured contentHeight to avoid an extra layout read. + this.updateDropdownClickability(contentHeight); } private scrollToBottom(): void { @@ -651,8 +655,17 @@ export class ChatThinkingContentPart extends ChatCollapsibleContentPart implemen return !(!strippedContent || strippedContent === titleToCompare); } - private updateDropdownClickability(): void { - const allowExpansion = this.shouldAllowExpansion(); + private updateDropdownClickability(knownContentHeight?: number): void { + let allowExpansion = this.shouldAllowExpansion(); + + // don't allow feedback on fixed scrolling before reaching max height. + if (allowExpansion && this.fixedScrollingMode && !this.streamingCompleted && !this.element.isComplete && this.wrapper) { + const contentHeight = knownContentHeight ?? this.wrapper.scrollHeight; + if (contentHeight <= THINKING_SCROLL_MAX_HEIGHT) { + allowExpansion = false; + } + } + if (!allowExpansion && this.isExpanded()) { this.setExpanded(false); }