diff --git a/core/protocol/ideWebview.ts b/core/protocol/ideWebview.ts index 1fa5e84a5..8a07e257c 100644 --- a/core/protocol/ideWebview.ts +++ b/core/protocol/ideWebview.ts @@ -64,9 +64,14 @@ export type EditStatus = | "accepting:full-diff" | "done"; +export type ApplyStateStatus = + | "streaming" // Changes are being applied to the file + | "done" // All changes have been applied, awaiting user to accept/reject + | "closed"; // All changes have been applied. Note that for new files, we immediately set the status to "closed" + export interface ApplyState { streamId: string; - status?: "streaming" | "done" | "closed"; + status?: ApplyStateStatus; numDiffs?: number; filepath?: string; fileContent?: string; diff --git a/gui/src/components/Layout.tsx b/gui/src/components/Layout.tsx index cc09881a3..5879bd2e0 100644 --- a/gui/src/components/Layout.tsx +++ b/gui/src/components/Layout.tsx @@ -162,10 +162,6 @@ const Layout = () => { useWebviewListener( "updateApplyState", async (state) => { - // console.log({ - // filepath: state.filepath, - // content: state.fileContent, - // }); dispatch( updateCurCheckpoint({ filepath: state.filepath, diff --git a/gui/src/redux/slices/stateSlice.ts b/gui/src/redux/slices/stateSlice.ts index 8c95599a6..17be955b8 100644 --- a/gui/src/redux/slices/stateSlice.ts +++ b/gui/src/redux/slices/stateSlice.ts @@ -442,21 +442,6 @@ export const stateSlice = createSlice({ state, { payload }: PayloadAction<{ filepath: string; content: string }>, ) => { - // If the user has explicitly checked out a given checkpoint, `curCheckpointIndex` will be set to that index. - // Else, we assume the current checkpoint index is the end of the checkpoints array. - // const index = - // state.curCheckpointIndex === -1 - // ? state.history.length / 2 - 1 - // : state.curCheckpointIndex; - - console.log("updating checkpoint"); - console.log({ - index: state.curCheckpointIndex, - historyLength: state.history.length, - filepath: payload.filepath, - content: payload.content, - }); - state.checkpoints[state.curCheckpointIndex] = { ...state.checkpoints[state.curCheckpointIndex], [payload.filepath]: payload.content,