Skip to content

Commit 10d9ea6

Browse files
committed
Standardize search prompts and pickers to handle dismissal as a back navigation action
- on subsequent quick picks, 'esc' key should trigger 'back', not 'close' └── apps └── editor └── src └── features └── search-files ├── index.ts ├── search-files.ts ├── search-modes │ ├── perform-agent-search-mode │ │ ├── agents │ │ │ ├── antigravity.ts │ │ │ ├── claude.ts │ │ │ ├── codex.ts │ │ │ ├── cursor.ts │ │ │ ├── grok.ts │ │ │ ├── muse.ts │ │ │ └── opencode.ts │ │ ├── index.ts │ │ ├── perform-agent-search-mode.ts │ │ ├── types.ts │ │ └── utils.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 7eb39ef commit 10d9ea6

8 files changed

Lines changed: 9 additions & 9 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ export const perform_agent_search_mode = async (params: {
304304

305305
agent_quick_pick.onDidHide(() => {
306306
if (!is_resolved) {
307-
resolve(undefined)
307+
resolve('back')
308308
}
309309
config_listener.dispose()
310310
agent_quick_pick.dispose()
@@ -440,7 +440,7 @@ export const perform_agent_search_mode = async (params: {
440440

441441
quick_pick.onDidHide(() => {
442442
if (!is_resolved) {
443-
resolve(undefined)
443+
resolve('back')
444444
}
445445
quick_pick.dispose()
446446
})

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ export const perform_intelligent_search_mode = async (params: {
207207

208208
quick_pick.onDidHide(() => {
209209
if (!is_resolved) {
210-
resolve(undefined)
210+
resolve('back')
211211
}
212212
quick_pick.dispose()
213213
})

‎apps/editor/src/features/search-files/utils/prompt-for-keywords-match-mode.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export const prompt_for_keywords_match_mode = async (
6464

6565
quick_pick.onDidHide(() => {
6666
if (!is_resolved) {
67-
resolve(undefined)
67+
resolve('back')
6868
}
6969
quick_pick.dispose()
7070
})

‎apps/editor/src/features/search-files/utils/prompt-for-keywords-target.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export const prompt_for_keywords_target = async (
6969

7070
quick_pick.onDidHide(() => {
7171
if (!is_resolved) {
72-
resolve(undefined)
72+
resolve('back')
7373
}
7474
quick_pick.dispose()
7575
})

‎apps/editor/src/features/search-files/utils/prompt-for-search-mode.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export const prompt_for_search_mode = async (
8282

8383
quick_pick.onDidHide(() => {
8484
if (!is_resolved) {
85-
resolve(undefined)
85+
resolve(show_back_button ? 'back' : undefined)
8686
}
8787
quick_pick.dispose()
8888
})

‎apps/editor/src/features/search-files/utils/prompt-for-search-term.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export const prompt_for_search_term = async (
7676
}),
7777
input_box.onDidHide(() => {
7878
if (!is_resolved) {
79-
resolve({ value: undefined })
79+
resolve({ value: undefined, back: true })
8080
}
8181
disposables.forEach((d) => d.dispose())
8282
input_box.dispose()

‎apps/editor/src/features/search-files/utils/prompt-for-shrink-mode.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export const prompt_for_shrink_mode = async (params: {
4646
})
4747
shrink_quick_pick.onDidHide(() => {
4848
if (!is_resolved) {
49-
resolve('cancel')
49+
resolve('back')
5050
}
5151
shrink_quick_pick.dispose()
5252
})

‎apps/editor/src/features/search-files/utils/show-search-results-quick-pick.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ export const show_search_results_quick_pick = async (params: {
187187
quick_pick.onDidHide(() => {
188188
if (is_showing_folder_quick_pick) return
189189
if (!is_resolved) {
190-
resolve(params.resolve_hide_as)
190+
resolve(params.resolve_hide_as ?? 'back')
191191
}
192192
quick_pick.dispose()
193193
})

0 commit comments

Comments
 (0)