Skip to content

Commit 2a42a0f

Browse files
committed
Remove custom close button and simplify quick pick navigation logic
1 parent f1c5bf9 commit 2a42a0f

2 files changed

Lines changed: 2 additions & 32 deletions

File tree

‎apps/editor/src/commands/add-file-to-context-command.ts‎

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -134,23 +134,13 @@ export const add_file_to_context_command = (
134134
label: f.label,
135135
full_path: f.full_path
136136
}))
137-
folder_quick_pick.buttons = [
138-
vscode.QuickInputButtons.Back,
139-
{
140-
iconPath: new vscode.ThemeIcon('close'),
141-
tooltip: 'Close'
142-
}
143-
]
137+
folder_quick_pick.buttons = [vscode.QuickInputButtons.Back]
144138

145139
let folder_accepted = false
146-
let should_close_fully = false
147140

148141
folder_quick_pick.onDidTriggerButton((button) => {
149142
if (button === vscode.QuickInputButtons.Back) {
150143
folder_quick_pick.hide()
151-
} else if (button.tooltip == 'Close') {
152-
should_close_fully = true
153-
folder_quick_pick.hide()
154144
}
155145
})
156146

@@ -186,11 +176,6 @@ export const add_file_to_context_command = (
186176
folder_quick_pick.dispose()
187177
is_showing_folder_quick_pick = false
188178

189-
if (should_close_fully) {
190-
quick_pick.dispose()
191-
return
192-
}
193-
194179
if (!folder_accepted) {
195180
if (file_items_cache.length > 0) {
196181
quick_pick.items = file_items_cache

‎apps/editor/src/commands/remove-file-from-context-command.ts‎

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -158,23 +158,13 @@ export const remove_file_from_context_command = (
158158
label: f.label,
159159
full_path: f.full_path
160160
}))
161-
folder_quick_pick.buttons = [
162-
vscode.QuickInputButtons.Back,
163-
{
164-
iconPath: new vscode.ThemeIcon('close'),
165-
tooltip: 'Close'
166-
}
167-
]
161+
folder_quick_pick.buttons = [vscode.QuickInputButtons.Back]
168162

169163
let folder_accepted = false
170-
let should_close_fully = false
171164

172165
folder_quick_pick.onDidTriggerButton((button) => {
173166
if (button === vscode.QuickInputButtons.Back) {
174167
folder_quick_pick.hide()
175-
} else if (button.tooltip == 'Close') {
176-
should_close_fully = true
177-
folder_quick_pick.hide()
178168
}
179169
})
180170

@@ -210,11 +200,6 @@ export const remove_file_from_context_command = (
210200
folder_quick_pick.dispose()
211201
is_showing_folder_quick_pick = false
212202

213-
if (should_close_fully) {
214-
quick_pick.dispose()
215-
return
216-
}
217-
218203
if (!folder_accepted) {
219204
if (file_items_cache.length > 0) {
220205
quick_pick.items = file_items_cache

0 commit comments

Comments
 (0)