Skip to content

Commit fa4ac30

Browse files
committed
Add close button to agent search quick pick dialogs
- allow 'back' from 'select agent' └── apps └── editor └── src ├── commands │ └── search-files-commands │ ├── index.ts │ ├── search-files-commands.ts │ └── utils │ ├── get-target-folder-path.ts │ └── prompt-for-provided-results.ts └── features └── search-files ├── index.ts ├── search-files.ts ├── search-modes │ ├── perform-agent-search-mode.ts │ ├── perform-intelligent-search-mode.ts │ ├── perform-keywords-search-mode.ts │ └── perform-phrase-search-mode.ts └── utils ├── analyze-files.ts ├── check-matches-condition.ts ├── create-search-regex.ts ├── group-quick-pick-items.ts ├── handle-parent-folder-result.ts ├── map-files-to-quick-pick-items.ts ├── prompt-for-config.ts ├── prompt-for-intelligent-search-results.ts ├── prompt-for-keywords-match-mode.ts ├── prompt-for-keywords-target.ts ├── prompt-for-search-mode.ts ├── prompt-for-search-results.ts ├── prompt-for-search-term.ts ├── prompt-for-shrink-mode.ts ├── search-files-by-intelligent.ts ├── search-files-by-keywords.ts ├── search-files-by-phrase.ts └── show-search-results-quick-pick.ts
1 parent d72659b commit fa4ac30

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

‎apps/editor/src/features/search-files/search-modes/perform-agent-search-mode.ts‎

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,11 @@ export const perform_agent_search_mode = async (params: {
100100
cmd: a.cmd
101101
}))
102102

103+
const close_button = {
104+
iconPath: new vscode.ThemeIcon('close'),
105+
tooltip: t('common.close')
106+
}
107+
103108
const agent_quick_pick = vscode.window.createQuickPick<
104109
vscode.QuickPickItem & { cmd: string }
105110
>()
@@ -108,9 +113,7 @@ export const perform_agent_search_mode = async (params: {
108113
agent_quick_pick.placeholder = t(
109114
'feature.search-files.agent.select-agent-placeholder'
110115
)
111-
agent_quick_pick.buttons = params.show_back_button
112-
? [vscode.QuickInputButtons.Back]
113-
: []
116+
agent_quick_pick.buttons = [vscode.QuickInputButtons.Back, close_button]
114117
agent_quick_pick.ignoreFocusOut = true
115118

116119
const selected_agent = await new Promise<string | undefined | 'back'>(
@@ -122,6 +125,10 @@ export const perform_agent_search_mode = async (params: {
122125
is_resolved = true
123126
resolve('back')
124127
agent_quick_pick.hide()
128+
} else if (button === close_button) {
129+
is_resolved = true
130+
resolve(undefined)
131+
agent_quick_pick.hide()
125132
}
126133
})
127134

@@ -184,7 +191,7 @@ export const perform_agent_search_mode = async (params: {
184191
quick_pick.placeholder = t(
185192
'feature.search-files.agent.select-workspace-placeholder'
186193
)
187-
quick_pick.buttons = [vscode.QuickInputButtons.Back]
194+
quick_pick.buttons = [vscode.QuickInputButtons.Back, close_button]
188195
quick_pick.ignoreFocusOut = true
189196

190197
const res = await new Promise<string | undefined | 'back'>((resolve) => {
@@ -195,6 +202,10 @@ export const perform_agent_search_mode = async (params: {
195202
is_resolved = true
196203
resolve('back')
197204
quick_pick.hide()
205+
} else if (button === close_button) {
206+
is_resolved = true
207+
resolve(undefined)
208+
quick_pick.hide()
198209
}
199210
})
200211

0 commit comments

Comments
 (0)