diff --git a/src/commons/application/ApplicationTypes.ts b/src/commons/application/ApplicationTypes.ts index fe9393a1df..603ff84c07 100644 --- a/src/commons/application/ApplicationTypes.ts +++ b/src/commons/application/ApplicationTypes.ts @@ -413,6 +413,7 @@ export const defaultWorkspaceManager: WorkspaceManagerState = { currentStep: -1, stepsTotal: 0, breakpointSteps: [], + changepointSteps: [], activeEditorTabIndex: 0, editorTabs: [ { @@ -466,6 +467,7 @@ export const defaultWorkspaceManager: WorkspaceManagerState = { currentStep: -1, stepsTotal: 0, breakpointSteps: [], + changepointSteps: [], activeEditorTabIndex: 0, editorTabs: [ { diff --git a/src/commons/sagas/WorkspaceSaga/helpers/evalCode.ts b/src/commons/sagas/WorkspaceSaga/helpers/evalCode.ts index 946f643146..b2cb236a16 100644 --- a/src/commons/sagas/WorkspaceSaga/helpers/evalCode.ts +++ b/src/commons/sagas/WorkspaceSaga/helpers/evalCode.ts @@ -248,6 +248,9 @@ export function* evalCode( yield put( actions.updateBreakpointSteps(context.runtime.breakpointSteps, workspaceLocation) ); + yield put( + actions.updateChangePointSteps(context.runtime.changepointSteps, workspaceLocation) + ); } } else { // Safe to use ! as storyEnv will be defined from above when we call from EVAL_STORY @@ -315,6 +318,7 @@ export function* evalCode( // But TS can't infer that yet, so we need a typecast here. yield put(actions.toggleUpdateCse(false, workspaceLocation as any)); yield put(actions.updateBreakpointSteps(context.runtime.breakpointSteps, workspaceLocation)); + yield put(actions.updateChangePointSteps(context.runtime.changepointSteps, workspaceLocation)); } // Stop the home icon from flashing for an error if it is doing so since the evaluation is successful if (context.executionMethod === 'cse-machine' || context.executionMethod === 'interpreter') { diff --git a/src/commons/sagas/__tests__/PlaygroundSaga.ts b/src/commons/sagas/__tests__/PlaygroundSaga.ts index a577224d51..56fa53175c 100644 --- a/src/commons/sagas/__tests__/PlaygroundSaga.ts +++ b/src/commons/sagas/__tests__/PlaygroundSaga.ts @@ -87,7 +87,8 @@ describe('Playground saga tests', () => { updateCse: true, currentStep: -1, stepsTotal: 0, - breakpointSteps: [] + breakpointSteps: [], + changepointSteps: [] } } }; @@ -154,7 +155,8 @@ describe('Playground saga tests', () => { updateCse: true, currentStep: -1, stepsTotal: 0, - breakpointSteps: [] + breakpointSteps: [], + changepointSteps: [] } } }; @@ -221,7 +223,8 @@ describe('Playground saga tests', () => { updateCse: true, currentStep: -1, stepsTotal: 0, - breakpointSteps: [] + breakpointSteps: [], + changepointSteps: [] } } }; @@ -271,7 +274,8 @@ describe('Playground saga tests', () => { updateCse: true, currentStep: -1, stepsTotal: 0, - breakpointSteps: [] + breakpointSteps: [], + changepointSteps: [] } } }; @@ -340,7 +344,8 @@ describe('Playground saga tests', () => { updateCse: true, currentStep: -1, stepsTotal: 0, - breakpointSteps: [] + breakpointSteps: [], + changepointSteps: [] } } }; @@ -398,7 +403,8 @@ describe('Playground saga tests', () => { updateCse: true, currentStep: -1, stepsTotal: 0, - breakpointSteps: [] + breakpointSteps: [], + changepointSteps: [] } } }; diff --git a/src/commons/sideContent/content/SideContentCseMachine.tsx b/src/commons/sideContent/content/SideContentCseMachine.tsx index 39f0a7621c..009c2aec85 100644 --- a/src/commons/sideContent/content/SideContentCseMachine.tsx +++ b/src/commons/sideContent/content/SideContentCseMachine.tsx @@ -50,6 +50,7 @@ type StateProps = { stepsTotal: number; currentStep: number; breakpointSteps: number[]; + changepointSteps: number[]; needCseUpdate: boolean; machineOutput: InterpreterOutput[]; }; @@ -257,12 +258,14 @@ class SideContentCseMachineBase extends React.Component