Skip to content

Commit d25dd38

Browse files
committed
Display a progress notification when clearing all checkpoints
1 parent d2c573d commit d25dd38

3 files changed

Lines changed: 27 additions & 17 deletions

File tree

‎packages/ui/src/components/editor/panel/Page/Page.tsx‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ export const Page: React.FC<Props> = (props) => {
2828
<div>{props.header_slot}</div>
2929
</div>
3030
{props.children}
31+
{props.footer_slot && (
32+
<div className={styles.footer}>{props.footer_slot}</div>
33+
)}
3134
</div>
3235
)
3336
}

‎packages/vscode/src/commands/checkpoints-command/actions/clear-all-checkpoints.ts‎

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,30 @@ import { Logger } from '@shared/utils/logger'
77
export const clear_all_checkpoints = async (
88
context: vscode.ExtensionContext
99
) => {
10-
const checkpoints = await get_checkpoints(context)
11-
12-
for (const checkpoint of checkpoints) {
13-
try {
14-
const checkpoint_path = get_checkpoint_path(checkpoint.timestamp)
15-
await vscode.workspace.fs.delete(vscode.Uri.file(checkpoint_path), {
16-
recursive: true
17-
})
18-
} catch (error) {
19-
Logger.warn({
20-
function_name: 'clear_all_checkpoints',
21-
message: 'Could not delete checkpoint file',
22-
data: error
23-
})
10+
const clear_task = async () => {
11+
const checkpoints = await get_checkpoints(context)
12+
for (const checkpoint of checkpoints) {
13+
try {
14+
const checkpoint_path = get_checkpoint_path(checkpoint.timestamp)
15+
await vscode.workspace.fs.delete(vscode.Uri.file(checkpoint_path), {
16+
recursive: true
17+
})
18+
} catch (error) {
19+
Logger.warn({
20+
function_name: 'clear_all_checkpoints',
21+
message: 'Could not delete checkpoint file',
22+
data: error
23+
})
24+
}
2425
}
26+
await context.workspaceState.update(CHECKPOINTS_STATE_KEY, [])
2527
}
26-
27-
await context.workspaceState.update(CHECKPOINTS_STATE_KEY, [])
28+
await vscode.window.withProgress(
29+
{
30+
location: vscode.ProgressLocation.Notification,
31+
title: 'Clearing all checkpoints...',
32+
cancellable: false
33+
},
34+
clear_task
35+
)
2836
}

‎packages/vscode/src/views/panel/frontend/Panel.tsx‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,6 @@ export const Panel = () => {
348348
}
349349
/>
350350
}
351-
header_slot={<></>}
352351
>
353352
<UiResponsePreview
354353
items={items_to_review}

0 commit comments

Comments
 (0)