mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-02 08:15:56 +01:00
don't show shimmer for things that shouldn't shimmer (#303327)
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user