Skip to content

Commit d70d6b9

Browse files
committed
Add close button to configuration quick pick and track successful file fixes for retry logic
1 parent 1cf3a1e commit d70d6b9

2 files changed

Lines changed: 32 additions & 4 deletions

File tree

‎apps/editor/src/utils/intelligent-update-utils.ts‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,12 @@ export const get_intelligent_update_config = async (
108108
}
109109

110110
const quick_pick = vscode.window.createQuickPick()
111+
quick_pick.buttons = [
112+
{
113+
iconPath: new vscode.ThemeIcon('close'),
114+
tooltip: 'Close'
115+
}
116+
]
111117
quick_pick.items = create_items()
112118
quick_pick.title = 'Configurations'
113119
quick_pick.placeholder =
@@ -129,6 +135,13 @@ export const get_intelligent_update_config = async (
129135

130136
return new Promise<{ provider: any; config: ToolConfig } | undefined>(
131137
(resolve) => {
138+
quick_pick.onDidTriggerButton((button) => {
139+
if (button.tooltip == 'Close') {
140+
quick_pick.hide()
141+
resolve(undefined)
142+
}
143+
})
144+
132145
quick_pick.onDidAccept(async () => {
133146
const selected = quick_pick.selectedItems[0] as any
134147
quick_pick.hide()

‎apps/editor/src/views/panel/backend/message-handlers/handle-fix-all-failed-files.ts‎

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ export const handle_fix_all_failed_files = async (params: {
4848
return
4949
}
5050

51+
const successful_files = new Set<string>()
52+
5153
const is_single_root_folder_workspace =
5254
(vscode.workspace.workspaceFolders?.length ?? 0) <= 1
5355
const parsed_response = parse_response({
@@ -261,6 +263,10 @@ export const handle_fix_all_failed_files = async (params: {
261263
vscode.Uri.file(safe_path),
262264
Buffer.from(final_content, 'utf8')
263265
)
266+
267+
successful_files.add(
268+
workspace_name ? `${workspace_name}:${file_path}` : file_path
269+
)
264270
}
265271
} catch (error: any) {
266272
if (
@@ -309,10 +315,19 @@ export const handle_fix_all_failed_files = async (params: {
309315
})
310316
)
311317
} catch (error: any) {
312-
await handle_fix_all_failed_files({
313-
panel_provider: params.panel_provider,
314-
files_to_fix: params.files_to_fix,
315-
force_model_selection: true
318+
const remaining_files = params.files_to_fix.filter((f) => {
319+
const key = f.workspace_name
320+
? `${f.workspace_name}:${f.file_path}`
321+
: f.file_path
322+
return !successful_files.has(key)
316323
})
324+
325+
if (remaining_files.length > 0) {
326+
await handle_fix_all_failed_files({
327+
panel_provider: params.panel_provider,
328+
files_to_fix: remaining_files,
329+
force_model_selection: true
330+
})
331+
}
317332
}
318333
}

0 commit comments

Comments
 (0)