Fix streamed fixed-scrolling title

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 6698ab91-2513-4857-a5cc-bd080bf813b6
This commit is contained in:
justschen
2026-08-22 20:03:44 -07:00
parent 88298007dc
commit 5ff54cc2d0
2 changed files with 12 additions and 1 deletions
@@ -1098,6 +1098,9 @@ export class ChatThinkingContentPart extends ChatCollapsibleContentPart implemen
const trimmed = value.trim();
if (splitReasoningSummaryRows(trimmed, true)) {
this.droppedSummaryHeader = extractTitleFromThinkingContent(trimmed);
if (this.fixedScrollingMode && this.droppedSummaryHeader && this.currentTitle !== this.droppedSummaryHeader) {
this.setTitle(this.droppedSummaryHeader);
}
}
}
@@ -516,7 +516,7 @@ suite('ChatThinkingContentPart', () => {
render: (markdown, options, target) => renderMarkdown(markdown, options, target),
};
const firstSummary = '**Evaluating issue and PR status**';
const content = createThinkingPart(firstSummary);
const content = createThinkingPart('**Evaluating issue and PR sta');
const part = store.add(instantiationService.createInstance(
ChatThinkingContentPart,
content,
@@ -529,6 +529,8 @@ suite('ChatThinkingContentPart', () => {
disposables.add(toDisposable(() => part.domNode.remove()));
const scrollable = part.domNode.querySelector('.monaco-scrollable-element');
const firstRow = part.domNode.querySelector('.chat-thinking-item.markdown-content');
const button = part.domNode.querySelector<HTMLElement>('.monaco-button');
const initialTitle = button?.textContent?.trim();
part.updateThinking(createThinkingPart(
`${firstSummary}\n\n**Analyzing code fix and lifecycle nuances**`,
@@ -545,11 +547,17 @@ suite('ChatThinkingContentPart', () => {
firstRowPreserved: rows[0] === firstRow,
rowTexts: rows.map(row => row.textContent?.trim()),
hasLiteralMarkers: part.domNode.textContent?.includes('**') ?? false,
initialTitle,
streamingTitle: button?.textContent?.trim(),
streamingAriaLabel: button?.ariaLabel,
}, {
scrollContainerPreserved: true,
firstRowPreserved: true,
rowTexts: ['Analyzing code fix and lifecycle nuances', 'Evaluating PR merge status'],
hasLiteralMarkers: false,
initialTitle: 'Thinking',
streamingTitle: 'Thinking: Evaluating issue and PR status',
streamingAriaLabel: 'Thinking: Evaluating issue and PR status',
});
});