Skip to content

Commit 336766d

Browse files
committed
Only show progress indicator when valid file blocks are present in chat response
1 parent 3b6fcc3 commit 336766d

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

apps/editor/src/commands/apply-chat-response-command/apply-chat-response-command.ts

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,21 @@ export const apply_chat_response_command = (params: {
165165
}
166166
}
167167

168-
params.panel_provider.send_message({
169-
command: 'SHOW_PROGRESS',
170-
title: t('common.progress.preparing-preview')
171-
})
168+
const has_valid_blocks =
169+
(args?.files_with_content && args.files_with_content.length > 0) ||
170+
clipboard_items.some(
171+
(item) =>
172+
item.type == 'file' ||
173+
item.type == 'diff' ||
174+
item.type == 'code-at-cursor'
175+
)
176+
177+
if (has_valid_blocks) {
178+
params.panel_provider.send_message({
179+
command: 'SHOW_PROGRESS',
180+
title: t('common.progress.preparing-preview')
181+
})
182+
}
172183

173184
before_checkpoint = await create_checkpoint({
174185
workspace_provider: params.workspace_provider,

0 commit comments

Comments
 (0)