mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-17 23:35:54 +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,
|
height: viewportHeight,
|
||||||
scrollHeight: contentHeight
|
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 {
|
private scrollToBottom(): void {
|
||||||
@@ -651,8 +655,17 @@ export class ChatThinkingContentPart extends ChatCollapsibleContentPart implemen
|
|||||||
return !(!strippedContent || strippedContent === titleToCompare);
|
return !(!strippedContent || strippedContent === titleToCompare);
|
||||||
}
|
}
|
||||||
|
|
||||||
private updateDropdownClickability(): void {
|
private updateDropdownClickability(knownContentHeight?: number): void {
|
||||||
const allowExpansion = this.shouldAllowExpansion();
|
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()) {
|
if (!allowExpansion && this.isExpanded()) {
|
||||||
this.setExpanded(false);
|
this.setExpanded(false);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user