Skip to content

Commit 91137ae

Browse files
committed
Rename prompt repair to patch repair and add auto-run failure notification
- in case of prewview load, when having some errors and 'patch repair' is triggered while not having a default configuration - should show information notifiaction 'Some changes were unable to apply. Fix with the Patch Repair prompt.' - translate [Pasted text] ├── apps │ └── editor │ └── src │ ├── i18n │ │ └── translations │ │ └── views │ │ └── prompt │ │ ├── handlers │ │ │ ├── copy-prompt.ts │ │ │ ├── delete-task.ts │ │ │ ├── handle-patch-repair.ts │ │ │ ├── handle-pick-api-reasoning-effort.ts │ │ │ ├── handle-template-quick-pick.ts │ │ │ ├── handle-undo.ts │ │ │ ├── hash-sign.ts │ │ │ ├── index.ts │ │ │ ├── make-api-call.ts │ │ │ ├── select-edit-format-instructions.ts │ │ │ ├── utils │ │ │ │ ├── index.ts │ │ │ │ └── symbols │ │ │ │ ├── git │ │ │ │ │ ├── index.ts │ │ │ │ │ └── replace-git-symbols.ts │ │ │ │ └── index.ts │ │ │ └── voice-input.ts │ │ └── index.ts │ └── views │ └── prompt │ ├── backend │ │ ├── message-handlers │ │ │ └── handle-patch-repair.ts │ │ └── prompt-view-provider.ts │ └── frontend │ ├── Prompt.tsx │ └── hooks │ ├── use-preview-manager.ts │ └── use-prompt │ └── use-prompt.ts └── packages └── ui └── src └── components └── editor └── prompt └── ResponsePreview └── ResponsePreview.tsx
1 parent d15885e commit 91137ae

4 files changed

Lines changed: 29 additions & 3 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
export const translations = {
2+
'views.prompt.handlers.handle-patch-repair.some-changes-unable-to-apply': {
3+
en: 'Some changes were unable to apply. Fix with the Patch Repair prompt.',
4+
pl: 'Nie udało się zastosować niektórych zmian. Napraw za pomocą promptu Patch Repair.',
5+
'zh-cn': '部分更改无法应用。请使用 Patch Repair 提示进行修复。',
6+
ja: '一部の変更を適用できませんでした。パッチ修復プロンプトで修正してください。',
7+
'zh-tw': '部分變更無法套用。請使用 Patch Repair 提示進行修復。',
8+
de: 'Einige Änderungen konnten nicht angewendet werden. Mit dem Patch Repair-Prompt beheben.',
9+
es: 'No se pudieron aplicar algunos cambios. Arréglalo con el prompt de Patch Repair.',
10+
fr: "Certaines modifications n'ont pas pu être appliquées. Corrigez avec le prompt Patch Repair.",
11+
'pt-br': 'Algumas alterações não puderam ser aplicadas. Corrija com o prompt Patch Repair.',
12+
ru: 'Некоторые изменения не удалось применить. Исправьте с помощью промпта Patch Repair.',
13+
ko: '일부 변경 사항을 적용할 수 없습니다. 패치 복구 프롬프트로 수정하세요.',
14+
it: 'Impossibile applicare alcune modifiche. Correggi con il prompt di Patch Repair.',
15+
tr: 'Bazı değişiklikler uygulanamadı. Patch Repair istemi ile düzeltin.',
16+
cs: 'Některé změny se nepodařilo aplikovat. Opravte pomocí promptu Patch Repair.',
17+
hu: 'Néhány módosítást nem sikerült alkalmazni. Javítsa a Patch Repair prompttal.',
18+
bg: 'Някои промени не можаха да бъдат приложени. Поправете с промпта Patch Repair.'
19+
}
20+
} as const

‎apps/editor/src/i18n/translations/views/prompt/handlers/index.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { translations as handle_undo } from './handle-undo'
88
import { translations as utils } from './utils'
99
import { translations as handle_pick_api_reasoning_effort } from './handle-pick-api-reasoning-effort'
1010
import { translations as handle_template_quick_pick } from './handle-template-quick-pick'
11+
import { translations as handle_patch_repair } from './handle-patch-repair'
1112

1213
export const translations = {
1314
...delete_task,
@@ -19,5 +20,6 @@ export const translations = {
1920
...handle_undo,
2021
...utils,
2122
...handle_pick_api_reasoning_effort,
22-
...handle_template_quick_pick
23+
...handle_template_quick_pick,
24+
...handle_patch_repair
2325
}

‎apps/editor/src/views/prompt/backend/message-handlers/handle-patch-repair.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,10 @@ export const handle_patch_repair = async (params: {
137137
await model_providers_manager.get_default_patch_repair_api_configuration()
138138
if (default_config || api_configurations.length === 1) {
139139
skip_action_quick_pick = true
140+
} else {
141+
vscode.window.showInformationMessage(
142+
t('views.prompt.handlers.handle-patch-repair.some-changes-unable-to-apply')
143+
)
140144
}
141145
}
142146

@@ -194,7 +198,7 @@ export const handle_patch_repair = async (params: {
194198
quick_pick.activeItems = [quick_pick.items[0]]
195199
}
196200

197-
quick_pick.title = 'Prompt Repair'
201+
quick_pick.title = 'Patch Repair'
198202
quick_pick.placeholder = t(
199203
'common.action-quick-pick.placeholder.no-tokens'
200204
)

‎apps/editor/src/views/prompt/backend/message-handlers/utils/patch-repair-utils.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export const get_patch_repair_config = async (params: {
8484
vscode.window.showErrorMessage(t('common.error.api-provider-not-found'))
8585
Logger.warn({
8686
function_name: 'get_patch_repair_config',
87-
message: 'API provider not found for Prompt Repair API tool.'
87+
message: 'API provider not found for the Patch Repair tool.'
8888
})
8989
return
9090
}

0 commit comments

Comments
 (0)