Skip to content

Commit 884bb7e

Browse files
committed
Disable history commands during response preview and update related translations
- when response previewed, checkpoints command should be disabled - in polish, and other languges, review 'podgląd odpowiedzi' - it sounds quite unnatural
1 parent 1aa49dc commit 884bb7e

4 files changed

Lines changed: 75 additions & 42 deletions

File tree

‎apps/editor/src/commands/history-command.ts‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import { PanelProvider } from '@/views/panel/backend/panel-provider'
2222
import { get_checkpoint_path } from '@/features/checkpoints/utils'
2323
import { dictionary } from '@shared/constants/dictionary'
2424
import { checkpoints_emitter } from '@/features/checkpoints/events'
25+
import { get_response_preview_promise_resolve } from '@/commands/apply-chat-response-command/utils/preview/preview'
2526

2627
dayjs.extend(localizedFormat)
2728

@@ -37,6 +38,13 @@ export const history_command = (params: {
3738
const create_new_checkpoint_command = vscode.commands.registerCommand(
3839
'codeWebChat.createNewCheckpoint',
3940
async () => {
41+
if (get_response_preview_promise_resolve()) {
42+
vscode.window.showWarningMessage(
43+
t('command.history.disabled-during-preview')
44+
)
45+
return
46+
}
47+
4048
if (
4149
!vscode.workspace.workspaceFolders ||
4250
vscode.workspace.workspaceFolders.length == 0
@@ -62,6 +70,13 @@ export const history_command = (params: {
6270
const history_cmd = vscode.commands.registerCommand(
6371
'codeWebChat.history',
6472
async (args?: { highlight_checkpoint?: Checkpoint }) => {
73+
if (get_response_preview_promise_resolve()) {
74+
vscode.window.showWarningMessage(
75+
t('command.history.disabled-during-preview')
76+
)
77+
return
78+
}
79+
6580
if (
6681
!vscode.workspace.workspaceFolders ||
6782
vscode.workspace.workspaceFolders.length == 0

‎apps/editor/src/i18n/translations/commands/history.ts‎

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -217,21 +217,21 @@ export const translations = {
217217
},
218218
'command.history.trigger.before-response-previewed': {
219219
en: 'Before response previewed',
220-
pl: 'Przed podglądem odpowiedzi',
221-
'zh-cn': '在预览响应之前',
222-
ja: '応答プレビュー前',
220+
pl: 'Przed wyświetleniem podglądu',
221+
'zh-cn': '在显示预览之前',
222+
ja: 'プレビュー表示前',
223223
'zh-tw': '在預覽回應之前',
224-
de: 'Vor der Antwortvorschau',
225-
es: 'Antes de previsualizar la respuesta',
226-
fr: 'Avant la prévisualisation de la réponse',
227-
'pt-br': 'Antes de visualizar a resposta',
228-
ru: 'Перед предпросмотром ответа',
229-
ko: '응답 미리보기 전',
230-
it: "Prima dell'anteprima della risposta",
231-
tr: 'Yanıt önizlenmeden önce',
232-
cs: 'Před náhledem odpovědi',
233-
hu: 'Válasz előnézete előtt',
234-
bg: 'Преди преглед на отговора'
224+
de: 'Vor der Vorschau',
225+
es: 'Antes de la vista previa',
226+
fr: 'Avant la prévisualisation',
227+
'pt-br': 'Antes da prévia',
228+
ru: 'Перед предпросмотром',
229+
ko: '미리보기 표시 전',
230+
it: "Prima dell'anteprima",
231+
tr: 'Önizleme gösterilmeden önce',
232+
cs: 'Před zobrazením náhledu',
233+
hu: 'Előnézet megjelenítése előtt',
234+
bg: 'Преди показване на прегледа'
235235
},
236236
'command.history.trigger.before-checkpoint-restored': {
237237
en: 'Before checkpoint restored',
@@ -286,5 +286,23 @@ export const translations = {
286286
cs: 'Dočasný kontrolní bod',
287287
hu: 'Ideiglenes ellenőrzőpont',
288288
bg: 'Временная контрольная точка'
289+
},
290+
'command.history.disabled-during-preview': {
291+
en: 'History is disabled during response preview.',
292+
pl: 'Historia jest niedostępna w trybie podglądu.',
293+
'zh-cn': '在预览期间历史记录被禁用。',
294+
ja: 'プレビュー中は履歴が無効になります。',
295+
'zh-tw': '在回應預覽期間歷史紀錄已停用。',
296+
de: 'Der Verlauf ist im Vorschaumodus deaktiviert.',
297+
es: 'El historial no está disponible en el modo de vista previa.',
298+
fr: "L'historique est indisponible en mode aperçu.",
299+
'pt-br': 'O histórico não está disponível no modo de prévia.',
300+
ru: 'История недоступна в режиме предпросмотра.',
301+
ko: '미리보기 모드에서는 기록을 사용할 수 없습니다.',
302+
it: 'La cronologia non è disponibile nella modalità anteprima.',
303+
tr: 'Önizleme modunda geçmiş kullanılamaz.',
304+
cs: 'Historie je v režimu náhledu nedostupná.',
305+
hu: 'Az előzmények előnézeti módban nem érhetők el.',
306+
bg: 'Историята е недостъпна в режим на преглед.'
289307
}
290308
} as const

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

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -109,21 +109,21 @@ export const translations = {
109109
},
110110
'common.progress.preparing-preview': {
111111
en: 'Preparing response preview...',
112-
pl: 'Przygotowywanie podglądu odpowiedzi...',
113-
'zh-cn': '正在准备响应预览...',
114-
ja: '応答のプレビューを準備中...',
112+
pl: 'Przygotowywanie podglądu zmian...',
113+
'zh-cn': '正在准备更改预览...',
114+
ja: '変更のプレビューを準備中...',
115115
'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: 'Подготовка на преглед на отговора...'
116+
de: 'Vorschau der Änderungen wird vorbereitet...',
117+
es: 'Preparando vista previa de los cambios...',
118+
fr: "Préparation de l'aperçu des modifications...",
119+
'pt-br': 'Preparando a prévia das alterações...',
120+
ru: 'Подготовка предпросмотра изменений...',
121+
ko: '변경 사항 미리보기 준비 중...',
122+
it: "Preparazione dell'anteprima delle modifiche...",
123+
tr: 'Değişikliklerin önizlemesi hazırlanıyor...',
124+
cs: 'Příprava náhledu změn...',
125+
hu: 'Változtatások előnézetének előkészítése...',
126+
bg: 'Подготовка за преглед на промените...'
127127
},
128128
'common.separator.recently-used': {
129129
en: 'recently used',

‎apps/editor/src/views/panel/frontend/i18n/translations/checkpoints.ts‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -127,21 +127,21 @@ export const checkpoints = {
127127
},
128128
'command.checkpoints.trigger.before-response-previewed': {
129129
en: 'Before response previewed',
130-
pl: 'Przed podglądem odpowiedzi',
131-
'zh-cn': '在预览响应之前',
132-
ja: '応答プレビュー前',
130+
pl: 'Przed wyświetleniem podglądu',
131+
'zh-cn': '在显示预览之前',
132+
ja: 'プレビュー表示前',
133133
'zh-tw': '在預覽回應之前',
134-
de: 'Vor der Antwortvorschau',
135-
es: 'Antes de previsualizar la respuesta',
136-
fr: 'Avant la prévisualisation de la réponse',
137-
'pt-br': 'Antes de visualizar a resposta',
138-
ru: 'Перед предпросмотром ответа',
139-
ko: '응답 미리보기 전',
140-
it: "Prima dell'anteprima della risposta",
141-
tr: 'Yanıt önizlenmeden önce',
142-
cs: 'Před náhledem odpovědi',
143-
hu: 'Válasz előnézete előtt',
144-
bg: 'Преди преглед на отговора'
134+
de: 'Vor der Vorschau',
135+
es: 'Antes de la vista previa',
136+
fr: 'Avant la prévisualisation',
137+
'pt-br': 'Antes da prévia',
138+
ru: 'Перед предпросмотром',
139+
ko: '미리보기 표시 전',
140+
it: "Prima dell'anteprima",
141+
tr: 'Önizleme gösterilmeden önce',
142+
cs: 'Před zobrazením náhledu',
143+
hu: 'Előnézet megjelenítése előtt',
144+
bg: 'Преди показване на прегледа'
145145
},
146146
'command.checkpoints.trigger.before-checkpoint-restored': {
147147
en: 'Before checkpoint restored',

0 commit comments

Comments
 (0)