don't show shimmer for things that shouldn't shimmer (#303327)

This commit is contained in:
Justin Chen
2026-03-19 16:07:37 -07:00
committed by GitHub
parent 36c908a37b
commit e29b65b1bc
3 changed files with 31 additions and 2 deletions

View File

@@ -17,7 +17,7 @@ export function isMcpToolInvocation(toolInvocation: IChatToolInvocation | IChatT
*/
export function shouldShimmerForTool(toolInvocation: IChatToolInvocation | IChatToolInvocationSerialized): boolean {
if (isMcpToolInvocation(toolInvocation)) {
return true;
return !IChatToolInvocation.isComplete(toolInvocation);
}
if (toolInvocation.toolId === 'copilot_askQuestions' || toolInvocation.toolId === 'vscode_askQuestions') {
return false;

View File

@@ -1025,6 +1025,11 @@ export class ChatListItemRenderer extends Disposable implements ITreeRenderer<Ch
return false;
}
// Don't show working spinner when there's an in-progress MCP tool - MCP tools have their own progress indicator
if (partsToRender.some(part => part.kind === 'toolInvocation' && !IChatToolInvocation.isComplete(part) && isMcpToolInvocation(part))) {
return false;
}
// Show if no content, only "used references", ends with a complete tool call, or ends with complete text edits and there is no incomplete tool call (edits are still being applied some time after they are all generated)
const lastPart = findLast(partsToRender, part => part.kind !== 'markdownContent' || part.content.value.trim().length > 0);

View File

@@ -182,7 +182,7 @@ suite('ChatToolProgressSubPart', () => {
});
test('adds shimmer styling for active MCP tool progress', () => {
const mcpTool = createSerializedToolInvocation({
const mcpTool = createToolInvocation({
source: {
type: 'mcp',
label: 'Weather MCP',
@@ -221,4 +221,28 @@ suite('ChatToolProgressSubPart', () => {
assert.strictEqual(part.domNode.querySelector('.shimmer-progress'), null);
});
test('does not add shimmer styling for completed MCP tool progress', () => {
const mcpTool = createSerializedToolInvocation({
source: {
type: 'mcp',
label: 'Weather MCP',
serverLabel: 'Weather',
instructions: undefined,
collectionId: 'collection',
definitionId: 'definition'
},
toolId: 'weather_lookup'
});
const part = disposables.add(instantiationService.createInstance(
ChatToolProgressSubPart,
mcpTool,
createRenderContext(false),
mockMarkdownRenderer,
new Set<string>()
));
assert.strictEqual(part.domNode.querySelector('.shimmer-progress'), null);
});
});