Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ import { isMcpToolInvocation } from './chatContentParts/toolInvocationParts/chat
const $ = dom.$;

const COPILOT_USERNAME = 'GitHub Copilot';
const WORKING_CAUGHT_UP_DEBOUNCE_MS = 50;

export interface IChatListItemTemplate {
currentElement?: ChatTreeItem;
Expand Down Expand Up @@ -1067,7 +1068,7 @@ export class ChatListItemRenderer extends Disposable implements ITreeRenderer<Ch
if (
!lastPart ||
lastPart.kind === 'references' ||
(lastPart.kind === 'markdownContent' && !moreContentAvailable) ||
(lastPart.kind === 'markdownContent' && !moreContentAvailable && this.hasBeenCaughtUpLongEnough(element)) ||
((lastPart.kind === 'toolInvocation' || lastPart.kind === 'toolInvocationSerialized') && (IChatToolInvocation.isComplete(lastPart) || lastPart.presentation === 'hidden')) ||
((lastPart.kind === 'textEditGroup' || lastPart.kind === 'notebookEditGroup') && lastPart.done && !partsToRender.some(part => part.kind === 'toolInvocation' && !IChatToolInvocation.isComplete(part))) ||
(lastPart.kind === 'progressTask' && lastPart.deferred.isSettled) ||
Expand All @@ -1081,6 +1082,17 @@ export class ChatListItemRenderer extends Disposable implements ITreeRenderer<Ch
return false;
}

/**
* Adds a debounce on when to show "working" shimmer.
*/
private hasBeenCaughtUpLongEnough(element: IChatResponseViewModel): boolean {
const lastRenderTime = element.renderData?.lastRenderTime;
if (typeof lastRenderTime !== 'number' || lastRenderTime === 0) {
return false;
}
return (Date.now() - lastRenderTime) >= WORKING_CAUGHT_UP_DEBOUNCE_MS;
}


private getChatFileChangesSummaryPart(element: IChatResponseViewModel): IChatChangesSummaryPart | undefined {
if (!this.shouldShowFileChangesSummary(element)) {
Expand Down
Loading