Skip to content

Commit a29d30a

Browse files
committed
Remove the 'Copy checkpoints as logs' functionality and button from the checkpoints quick pick menu
1 parent 65c6bb7 commit a29d30a

1 file changed

Lines changed: 1 addition & 55 deletions

File tree

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

Lines changed: 1 addition & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,6 @@ export const checkpoints_command = (params: {
8585
tooltip: 'Delete all checkpoints'
8686
}
8787

88-
const copy_button: vscode.QuickInputButton = {
89-
iconPath: new vscode.ThemeIcon('copy'),
90-
tooltip: 'Copy checkpoints as logs'
91-
}
92-
9388
let notification_count = 0
9489
let checkpoints: Checkpoint[] = []
9590
let temp_checkpoint_is_valid = false
@@ -109,7 +104,7 @@ export const checkpoints_command = (params: {
109104
const visible_checkpoints = checkpoints.filter((c) => !c.is_temporary)
110105

111106
if (visible_checkpoints.length > 0) {
112-
quick_pick.buttons = [copy_button, clear_all_button]
107+
quick_pick.buttons = [clear_all_button]
113108
} else {
114109
quick_pick.buttons = []
115110
}
@@ -266,55 +261,6 @@ export const checkpoints_command = (params: {
266261
})
267262

268263
quick_pick.onDidTriggerButton(async (button) => {
269-
if (button === copy_button) {
270-
const visible_checkpoints = checkpoints
271-
.filter((c) => !c.is_temporary)
272-
.sort((a, b) => a.timestamp - b.timestamp)
273-
274-
if (visible_checkpoints.length == 0) {
275-
return
276-
}
277-
278-
const longest_title_length = Math.max(
279-
...visible_checkpoints.map((c) => c.title.length)
280-
)
281-
282-
const time_zone = Intl.DateTimeFormat().resolvedOptions().timeZone
283-
284-
const log_lines: string[] = []
285-
let last_full_hour: string | null = null
286-
287-
for (const c of visible_checkpoints) {
288-
const date_obj = dayjs(c.timestamp)
289-
const current_full_hour = date_obj.format('YYYY-MM-DD HH')
290-
291-
if (
292-
last_full_hour !== null &&
293-
last_full_hour != current_full_hour
294-
) {
295-
log_lines.push('')
296-
}
297-
298-
const date = date_obj.format('YYYY-MM-DD HH:mm')
299-
const padded_title = c.title.padEnd(longest_title_length, ' ')
300-
log_lines.push(
301-
`[${date} ${time_zone}] ${padded_title} ${
302-
c.description
303-
? `> ${c.description.replace(/\n/g, '\\n')}`
304-
: ''
305-
}`
306-
)
307-
last_full_hour = current_full_hour
308-
}
309-
310-
const log_string = log_lines.join('\n')
311-
await vscode.env.clipboard.writeText(log_string)
312-
vscode.window.showInformationMessage(
313-
dictionary.information_message.CHECKPOINTS_COPIED_TO_CLIPBOARD
314-
)
315-
return
316-
}
317-
318264
if (button === clear_all_button) {
319265
quick_pick.hide()
320266
const confirmation = await vscode.window.showWarningMessage(

0 commit comments

Comments
 (0)