File tree Expand file tree Collapse file tree
packages/vscode/src/commands/apply-chat-response-command Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ import {
1717} from './utils/preview-handler'
1818import { process_chat_response , CommandArgs } from './response-processor'
1919import { Checkpoint } from '../checkpoints-command/types'
20+ import { CHECKPOINTS_STATE_KEY } from '@/constants/state-keys'
2021
2122export const apply_chat_response_command = (
2223 context : vscode . ExtensionContext ,
@@ -72,7 +73,7 @@ export const apply_chat_response_command = (
7273 before_checkpoint = await create_checkpoint (
7374 workspace_provider ,
7475 context ,
75- 'Before applying changes ' ,
76+ 'Before response previewed ' ,
7677 args ?. raw_instructions
7778 )
7879
@@ -171,6 +172,24 @@ export const apply_chat_response_command = (
171172 } )
172173
173174 if ( changes_accepted ) {
175+ if ( before_checkpoint ) {
176+ const checkpoints =
177+ context . workspaceState . get < Checkpoint [ ] > (
178+ CHECKPOINTS_STATE_KEY ,
179+ [ ]
180+ ) ?? [ ]
181+ const checkpoint_to_update = checkpoints . find (
182+ ( c ) => c . timestamp == before_checkpoint ! . timestamp
183+ )
184+ if ( checkpoint_to_update ) {
185+ checkpoint_to_update . title = 'Before changes approved'
186+ await context . workspaceState . update (
187+ CHECKPOINTS_STATE_KEY ,
188+ checkpoints
189+ )
190+ }
191+ }
192+
174193 await create_checkpoint (
175194 workspace_provider ,
176195 context ,
You can’t perform that action at this time.
0 commit comments