Skip to content

Commit 3fe6b14

Browse files
committed
Add progress indicators and localized strings for chat response preview preparation
- translate 'Preparing response preview...' - SHOW_PROGRESS with [Fragment] should be shown before creating checkpoint - place panel_provider.send_message({ command: 'HIDE_PROGRESS' }) when appropriate
1 parent 6226612 commit 3fe6b14

2 files changed

Lines changed: 31 additions & 0 deletions

File tree

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { Checkpoint } from '../checkpoints-command/types'
2121
import { CHECKPOINTS_STATE_KEY } from '@/constants/state-keys'
2222
import { ResponseHistoryItem } from '@shared/types/response-history-item'
2323
import { ApiManager } from '@/services/api-manager'
24+
import { t } from '@/i18n'
2425
import {
2526
preview_document_provider,
2627
CwcPreviewProvider
@@ -150,6 +151,11 @@ export const apply_chat_response_command = (params: {
150151
}
151152
}
152153

154+
params.panel_provider.send_message({
155+
command: 'SHOW_PROGRESS',
156+
title: t('common.progress.preparing-preview')
157+
})
158+
153159
before_checkpoint = await create_checkpoint(
154160
params.workspace_provider,
155161
params.context,
@@ -166,6 +172,10 @@ export const apply_chat_response_command = (params: {
166172
params.workspace_provider
167173
)
168174

175+
params.panel_provider.send_message({
176+
command: 'HIDE_PROGRESS'
177+
})
178+
169179
if (preview_data) {
170180
let created_at_for_preview = args?.created_at
171181
if (!args?.files_with_content) {
@@ -373,6 +383,9 @@ export const apply_chat_response_command = (params: {
373383
}
374384
}
375385
} catch (err: any) {
386+
params.panel_provider.send_message({
387+
command: 'HIDE_PROGRESS'
388+
})
376389
vscode.window.showErrorMessage(
377390
dictionary.error_message.APPLYING_CHANGES_GENERIC_ERROR(err.message)
378391
)

‎apps/editor/src/i18n/translations/common.ts‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,24 @@ export const common = {
107107
hu: 'gondolkodás...',
108108
bg: 'мислене...'
109109
},
110+
'common.progress.preparing-preview': {
111+
en: 'Preparing response preview...',
112+
pl: 'Przygotowywanie podglądu odpowiedzi...',
113+
'zh-cn': '正在准备响应预览...',
114+
ja: '応答のプレビューを準備中...',
115+
'zh-tw': '正在準備回應預覽...',
116+
de: 'Antwortvorschau wird vorbereitet...',
117+
es: 'Preparando vista previa de la respuesta...',
118+
fr: "Préparation de l'aperçu de la réponse...",
119+
'pt-br': 'Preparando a prévia da resposta...',
120+
ru: 'Подготовка предпросмотра ответа...',
121+
ko: '응답 미리보기 준비 중...',
122+
it: "Preparazione dell'anteprima della risposta...",
123+
tr: 'Yanıt önizlemesi hazırlanıyor...',
124+
cs: 'Příprava náhledu odpovědi...',
125+
hu: 'Válasz előnézetének előkészítése...',
126+
bg: 'Подготовка на преглед на отговора...'
127+
},
110128
'common.separator.recently-used': {
111129
en: 'recently used',
112130
pl: 'ostatnio używane',

0 commit comments

Comments
 (0)