Skip to content

Commit d9da976

Browse files
committed
Rename context-pruning to relevant-files and automatically switch to edit-context after successful application
- once 'relevant files' are accepted, if was frf, clear selection of frf context - once 'relevant files' are accepted, if was frf, change prompt type to 'edit context'
1 parent 86d06da commit d9da976

3 files changed

Lines changed: 35 additions & 7 deletions

File tree

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,9 @@ export const process_chat_response = async (
175175
quick_pick.items = quick_pick_items
176176
quick_pick.selectedItems = quick_pick_items.filter((i) => i.picked)
177177
quick_pick.canSelectMany = true
178-
quick_pick.title = t('command.apply-chat-response.context-pruning.title')
178+
quick_pick.title = t('command.apply-chat-response.relevant-files.title')
179179
quick_pick.placeholder = t(
180-
'command.apply-chat-response.context-pruning.placeholder'
180+
'command.apply-chat-response.relevant-files.placeholder'
181181
)
182182
quick_pick.ignoreFocusOut = true
183183

@@ -266,10 +266,12 @@ export const process_chat_response = async (
266266

267267
if (was_frf) {
268268
shared_state.switch_context_state(true)
269+
await workspace_provider.set_checked_files([])
270+
await panel_provider.switch_to_edit_context()
269271
}
270272

271273
vscode.window.showInformationMessage(
272-
t('command.apply-chat-response.context-pruning.success')
274+
t('command.apply-chat-response.relevant-files.success')
273275
)
274276
}
275277

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export const apply_chat_response = {
5353
hu: 'Alkalmazás intelligens frissítéssel',
5454
bg: 'Прилагане с Интелигентно актуализиране'
5555
},
56-
'command.apply-chat-response.context-pruning.title': {
56+
'command.apply-chat-response.relevant-files.title': {
5757
en: 'Relevant Files',
5858
pl: 'Pasujące pliki',
5959
'zh-cn': '相关文件',
@@ -71,7 +71,7 @@ export const apply_chat_response = {
7171
hu: 'Releváns fájlok',
7272
bg: 'Съответни файлове'
7373
},
74-
'command.apply-chat-response.context-pruning.placeholder': {
74+
'command.apply-chat-response.relevant-files.placeholder': {
7575
en: 'Confirm files to include in context',
7676
pl: 'Wybierz pliki do zaznaczenia w kontekście',
7777
'zh-cn': '确认要包含在上下文中的文件',
@@ -89,8 +89,8 @@ export const apply_chat_response = {
8989
hu: 'Erősítse meg a kontextusba foglalandó fájlokat',
9090
bg: 'Потвърдете файловете за включване в контекста'
9191
},
92-
'command.apply-chat-response.context-pruning.success': {
93-
en: 'Relevant files found successfully.',
92+
'command.apply-chat-response.relevant-files.success': {
93+
en: 'Relevant files has been checked successfully.',
9494
pl: 'Pomyślnie znaleziono odpowiednie pliki.',
9595
'zh-cn': '成功找到相关文件。',
9696
ja: '関連ファイルが正常に見つかりました。',

‎apps/editor/src/views/panel/backend/panel-provider.ts‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,32 @@ export class PanelProvider implements vscode.WebviewViewProvider {
274274
SharedFileState.get_instance().switch_context_state(is_find_relevant_files)
275275
}
276276

277+
public async switch_to_edit_context() {
278+
if (this.mode == MODE.WEB) {
279+
this.web_prompt_type = 'edit-context'
280+
await this.context.workspaceState.update(
281+
WEB_MODE_STATE_KEY,
282+
'edit-context'
283+
)
284+
this.send_message({
285+
command: 'WEB_PROMPT_TYPE',
286+
prompt_type: 'edit-context'
287+
})
288+
} else {
289+
this.api_prompt_type = 'edit-context'
290+
await this.context.workspaceState.update(
291+
API_MODE_STATE_KEY,
292+
'edit-context'
293+
)
294+
this.send_message({
295+
command: 'API_PROMPT_TYPE',
296+
prompt_type: 'edit-context'
297+
})
298+
}
299+
this.update_providers_shrink_mode()
300+
this.update_providers_context_state()
301+
}
302+
277303
public async send_checkpoints() {
278304
const checkpoints = await get_checkpoints(this.context)
279305
this.send_message({

0 commit comments

Comments
 (0)