mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-02 08:15:56 +01:00
don't allow expanding until hitting max height in thinking (#299249)
* don't allow expanding until hitting max height in thinking * Address comments
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user