Skip to content

Commit c33a376

Browse files
committed
Add a close button to the model provider quick pick dialog
1 parent 3a8b55a commit c33a376

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

‎apps/editor/src/views/utils/upsert-model-provider.ts‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -406,13 +406,23 @@ export const upsert_model_provider = async (params: {
406406
quick_pick.placeholder =
407407
'Choose a predefined provider or add a custom endpoint'
408408

409+
const close_button: vscode.QuickInputButton = {
410+
iconPath: new vscode.ThemeIcon('close'),
411+
tooltip: 'Close'
412+
}
413+
409414
if (show_back_button) {
410-
quick_pick.buttons = [vscode.QuickInputButtons.Back]
415+
quick_pick.buttons = [vscode.QuickInputButtons.Back, close_button]
416+
} else {
417+
quick_pick.buttons = [close_button]
411418
}
412419

413420
return new Promise((resolve) => {
414421
quick_pick.onDidTriggerButton((button) => {
415-
if (button === vscode.QuickInputButtons.Back) {
422+
if (
423+
button === vscode.QuickInputButtons.Back ||
424+
button === close_button
425+
) {
416426
quick_pick.hide()
417427
}
418428
})

0 commit comments

Comments
 (0)