Skip to content

Commit 5026d2d

Browse files
committed
Add a close button to the checkpoints quick pick dialog for immediate dismissal without further interaction
1 parent e55232c commit 5026d2d

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

packages/vscode/src/commands/checkpoints-command/checkpoints-command.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ export const checkpoints_command = (params: {
8888
tooltip: 'Delete all checkpoints'
8989
}
9090

91+
const close_button: vscode.QuickInputButton = {
92+
iconPath: new vscode.ThemeIcon('close'),
93+
tooltip: 'Close'
94+
}
95+
9196
let notification_count = 0
9297
let checkpoints: Checkpoint[] = []
9398
let temp_checkpoint_is_valid = false
@@ -106,7 +111,7 @@ export const checkpoints_command = (params: {
106111

107112
const visible_checkpoints = checkpoints.filter((c) => !c.is_temporary)
108113

109-
quick_pick.buttons = [clear_all_button]
114+
quick_pick.buttons = [clear_all_button, close_button]
110115

111116
visible_checkpoints.sort((a, b) => {
112117
return b.timestamp - a.timestamp
@@ -274,6 +279,11 @@ export const checkpoints_command = (params: {
274279
})
275280

276281
quick_pick.onDidTriggerButton(async (button) => {
282+
if (button === close_button) {
283+
quick_pick.hide()
284+
return
285+
}
286+
277287
if (button === clear_all_button) {
278288
quick_pick.hide()
279289

0 commit comments

Comments
 (0)