File tree Expand file tree Collapse file tree
commands/checkpoints-command/actions Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,7 +8,9 @@ import { get_checkpoint_path } from '../utils'
88
99export const create_checkpoint = async (
1010 workspace_provider : WorkspaceProvider ,
11- context : vscode . ExtensionContext
11+ context : vscode . ExtensionContext ,
12+ title : string = 'Created by user' ,
13+ description ?: string
1214) : Promise < boolean > => {
1315 try {
1416 const timestamp = Date . now ( )
@@ -27,8 +29,9 @@ export const create_checkpoint = async (
2729 await copy_workspace_to_dir ( checkpoint_dir_uri , workspace_provider )
2830
2931 const new_checkpoint : Checkpoint = {
30- title : 'Created by user' ,
31- timestamp
32+ title,
33+ timestamp,
34+ description
3235 }
3336
3437 const checkpoints = await get_checkpoints ( context )
Original file line number Diff line number Diff line change @@ -85,6 +85,7 @@ import { Logger } from '@shared/utils/logger'
8585import { CancelTokenSource } from 'axios'
8686import { update_last_used_preset_or_group } from './message-handlers/update-last-used-preset-or-group'
8787import { undo_files } from '@/commands/apply-chat-response-command/utils/file-operations'
88+ import { create_checkpoint } from '@/commands/checkpoints-command/actions'
8889import { dictionary } from '@shared/constants/dictionary'
8990
9091export class ViewProvider implements vscode . WebviewViewProvider {
@@ -455,6 +456,16 @@ export class ViewProvider implements vscode.WebviewViewProvider {
455456 await handle_commit_changes ( this )
456457 } else if ( message . command == 'ACCEPT_COMMIT_MESSAGE' ) {
457458 await handle_accept_commit_message ( this , message . commit_message )
459+
460+ const title = 'Committed changes'
461+ const description = message . commit_message
462+
463+ await create_checkpoint (
464+ this . workspace_provider ,
465+ this . context ,
466+ title ,
467+ description
468+ )
458469 } else if ( message . command == 'CANCEL_COMMIT_MESSAGE' ) {
459470 await handle_cancel_commit_message ( this )
460471 } else if ( message . command == 'MANAGE_CONFIGURATIONS' ) {
You can’t perform that action at this time.
0 commit comments