Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
e92d3ab
StreamViz arrow drawing
of89p Apr 6, 2026
e254f4b
Update js-slang dependency version in package.json
DaRealTristan Apr 6, 2026
02c8ea1
package.json fix and formatting
Akshay-2007-1 Apr 6, 2026
0013166
deleted useless ts file
Akshay-2007-1 Apr 6, 2026
71f111c
Merge branch 'master' into streamVis
DaRealTristan Apr 8, 2026
484a680
removed debug logs as per gemini suggestion
TristanTayYuHng Apr 8, 2026
2d48357
removed debug logs as per gemini suggestion
TristanTayYuHng Apr 8, 2026
6344e48
Fixed merger with layout feature
TristanTayYuHng Apr 8, 2026
8fe8c43
Merge branch 'master' into streamVis
DaRealTristan Apr 8, 2026
7b21298
missing curly brace
of89p Apr 8, 2026
d8758f4
Simplifying features to integrate with arrows team
DaRealTristan Apr 8, 2026
5319513
Merge branch 'master' into streamVis
martin-henz Apr 8, 2026
5114633
removed streamsPointStep
of89p Apr 9, 2026
f4d64e3
Merge branch 'streamVis' of https://github.com/source-academy/fronten…
DaRealTristan Apr 9, 2026
fe322c0
Merge branch 'streamVis' of https://github.com/source-academy/fronten…
TristanTayYuHng Apr 9, 2026
9b9a019
Removed local resolution for 'js-slang' package.
DaRealTristan Apr 9, 2026
ecc11c5
simplified for mvp
TristanTayYuHng Apr 9, 2026
e48d282
simplified for mvp
TristanTayYuHng Apr 9, 2026
27ee97c
removed redundant draw
TristanTayYuHng Apr 9, 2026
599b74f
Merge branch 'master' into streamVis
martin-henz Apr 10, 2026
db43ec6
Drifting fixed!!
Akshay-2007-1 Apr 10, 2026
755bcef
print mode dotted line colour change
TristanTayYuHng Apr 10, 2026
a7c1787
Update js-slang dependency resolution in yarn.lock
DaRealTristan Apr 10, 2026
05e6d15
Update js-slang package version
DaRealTristan Apr 10, 2026
155e6d7
yarn format
TristanTayYuHng Apr 10, 2026
53a5458
bumping js-slang to 1.0.90
martin-henz Apr 17, 2026
05407ec
Merge branch 'master' into streamVis
martin-henz Apr 17, 2026
d4a1a6c
Merge branch 'master' into streamVis
martin-henz Apr 17, 2026
334e2a3
trying to fix testcase
martin-henz Apr 17, 2026
a98d4d2
Merge remote-tracking branch 'origin/streamVis' into streamVis
martin-henz Apr 17, 2026
4e795ea
streamvis now survives run
DaRealTristan Apr 19, 2026
e7e374f
Merge branch 'master' into streamVis
martin-henz Apr 20, 2026
54af008
bumping js-slang
martin-henz Apr 20, 2026
8fd160c
Fixed multiple arrows to pair issue
DaRealTristan Apr 21, 2026
df7b92c
Merge branch 'master' into streamVis
martin-henz Apr 22, 2026
917f345
Merge branch 'master' of https://github.com/source-academy/frontend i…
RichDom2185 May 6, 2026
967f06c
Merge branch 'master' into streamVis
DaRealTristan May 26, 2026
050f95f
resolved merge conflicts and ran yarn format
DaRealTristan May 26, 2026
c52c48b
yarn format
DaRealTristan May 26, 2026
a2475fe
fix: Line 81 bug. Removed redundant code due to mismatched ordering
Akshay-2007-1 May 27, 2026
dd5a1f2
Merge branch 'master' into streamVis
RichDom2185 May 31, 2026
fad0127
Merge branch 'master' into streamVis
martin-henz Jun 1, 2026
37d480e
Merge branch 'master' into streamVis
martin-henz Jun 1, 2026
34373de
removed comments and console logs
DaRealTristan Jun 1, 2026
c0cefd0
Merge branch 'master' into streamVis
martin-henz Jun 2, 2026
a117f8a
Merge branch 'master' into streamVis
martin-henz Jun 3, 2026
53377b8
Merge branch 'master' into streamVis
RichDom2185 Jun 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,6 @@
},
"resolutions": {
"@types/estree": "1.0.8",
"vite": "^8.0.0"
"vite": "^8.0.0",
Comment thread
Akshay-2007-1 marked this conversation as resolved.
Outdated
}
}
2 changes: 2 additions & 0 deletions src/commons/application/ApplicationTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,7 @@ export const defaultWorkspaceManager: WorkspaceManagerState = {
stepsTotal: 0,
breakpointSteps: [],
changepointSteps: [],
streamsPointSteps: [],
activeEditorTabIndex: 0,
editorTabs: [
{
Expand Down Expand Up @@ -504,6 +505,7 @@ export const defaultWorkspaceManager: WorkspaceManagerState = {
stepsTotal: 0,
breakpointSteps: [],
changepointSteps: [],
streamsPointSteps: [],
activeEditorTabIndex: 0,
editorTabs: [
{
Expand Down
3 changes: 2 additions & 1 deletion src/commons/mocks/ContextMocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ export function mockRuntimeContext(): Context {
objectCount: 0,
envStepsTotal: 0,
breakpointSteps: [],
changepointSteps: []
changepointSteps: [],
streamsPointSteps: []
};
return context;
}
Expand Down
4 changes: 4 additions & 0 deletions src/commons/sagas/WorkspaceSaga/helpers/evalCode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,8 @@ export function* evalCodeSaga(
yield put(
actions.updateChangePointSteps(context.runtime.changepointSteps, workspaceLocation)
);
const streamsPointSteps = (context.runtime as any).streamsPointSteps ?? [];
yield put(actions.updateStreamsPointSteps(streamsPointSteps, workspaceLocation));
}
}
} else {
Expand Down Expand Up @@ -444,6 +446,8 @@ export function* evalCodeSaga(
yield put(actions.toggleUpdateCse(false, workspaceLocation as any));
yield put(actions.updateBreakpointSteps(context.runtime.breakpointSteps, workspaceLocation));
yield put(actions.updateChangePointSteps(context.runtime.changepointSteps, workspaceLocation));
const streamsPointSteps = (context.runtime as any).streamsPointSteps ?? [];
yield put(actions.updateStreamsPointSteps(streamsPointSteps, 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') {
Expand Down
18 changes: 12 additions & 6 deletions src/commons/sagas/__tests__/PlaygroundSaga.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ describe('Playground saga tests', () => {
currentStep: -1,
stepsTotal: 0,
breakpointSteps: [],
changepointSteps: []
changepointSteps: [],
streamsPointSteps: []
}
}
};
Expand Down Expand Up @@ -157,7 +158,8 @@ describe('Playground saga tests', () => {
currentStep: -1,
stepsTotal: 0,
breakpointSteps: [],
changepointSteps: []
changepointSteps: [],
streamsPointSteps: []
}
}
};
Expand Down Expand Up @@ -226,7 +228,8 @@ describe('Playground saga tests', () => {
currentStep: -1,
stepsTotal: 0,
breakpointSteps: [],
changepointSteps: []
changepointSteps: [],
streamsPointSteps: []
}
}
};
Expand Down Expand Up @@ -278,7 +281,8 @@ describe('Playground saga tests', () => {
currentStep: -1,
stepsTotal: 0,
breakpointSteps: [],
changepointSteps: []
changepointSteps: [],
streamsPointSteps: []
}
}
};
Expand Down Expand Up @@ -349,7 +353,8 @@ describe('Playground saga tests', () => {
currentStep: -1,
stepsTotal: 0,
breakpointSteps: [],
changepointSteps: []
changepointSteps: [],
streamsPointSteps: []
}
}
};
Expand Down Expand Up @@ -409,7 +414,8 @@ describe('Playground saga tests', () => {
currentStep: -1,
stepsTotal: 0,
breakpointSteps: [],
changepointSteps: []
changepointSteps: [],
streamsPointSteps: []
}
}
};
Expand Down
35 changes: 32 additions & 3 deletions src/commons/sideContent/content/SideContentCseMachine.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ type StateProps = {
currentStep: number;
breakpointSteps: number[];
changepointSteps: number[];
streamsPointSteps: number[];
needCseUpdate: boolean;
machineOutput: InterpreterOutput[];
chapter: Chapter;
Expand Down Expand Up @@ -300,6 +301,25 @@ class SideContentCseMachineBase extends React.Component<CseMachineProps, State>
/>
</AnchorButton>
</Tooltip>
<Tooltip content="Pair Visualisation" compact>
<AnchorButton
onMouseUp={() => {
if (this.state.visualization) {
CseMachine.togglePairCreationMode();
Layout.draw();
CseMachine.redraw();
}
}}
icon="array"
disabled={!this.state.visualization}
>
<Checkbox
checked={CseMachine.getPairCreationMode()}
disabled={!this.state.visualization}
style={{ margin: 0 }}
/>
</AnchorButton>
</Tooltip>
</ButtonGroup>
)}
<ButtonGroup>
Expand Down Expand Up @@ -540,7 +560,8 @@ class SideContentCseMachineBase extends React.Component<CseMachineProps, State>
};

private stepNextChangepoint = () => {
for (const step of this.props.changepointSteps) {
const changeSteps = this.getActiveChangeSteps();
for (const step of changeSteps) {
if (step > this.state.value) {
this.sliderShift(step);
this.sliderRelease(step);
Expand All @@ -552,8 +573,9 @@ class SideContentCseMachineBase extends React.Component<CseMachineProps, State>
};

private stepPrevChangepoint = () => {
for (let i = this.props.changepointSteps.length - 1; i >= 0; i--) {
const step = this.props.changepointSteps[i];
const changeSteps = this.getActiveChangeSteps();
for (let i = changeSteps.length - 1; i >= 0; i--) {
const step = changeSteps[i];
if (step < this.state.value) {
this.sliderShift(step);
this.sliderRelease(step);
Expand All @@ -563,6 +585,12 @@ class SideContentCseMachineBase extends React.Component<CseMachineProps, State>
this.sliderShift(0);
this.sliderRelease(0);
};

private getActiveChangeSteps = () => {
return CseMachine.getPairCreationMode()
? this.props.streamsPointSteps
: this.props.changepointSteps;
};
}

const mapStateToProps: MapStateToProps<StateProps, OwnProps, OverallState> = (
Expand Down Expand Up @@ -593,6 +621,7 @@ const mapStateToProps: MapStateToProps<StateProps, OwnProps, OverallState> = (
currentStep: workspace.currentStep,
breakpointSteps: workspace.breakpointSteps,
changepointSteps: workspace.changepointSteps,
streamsPointSteps: workspace.streamsPointSteps,
needCseUpdate: workspace.updateCse,
machineOutput: workspace.output,
chapter: workspace.context.chapter
Expand Down
7 changes: 7 additions & 0 deletions src/commons/workspace/WorkspaceActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,13 @@ const newActions = createActions('workspace', {
changepointSteps,
workspaceLocation
}),
updateStreamsPointSteps: (
streamsPointSteps: number[],
workspaceLocation: WorkspaceLocation
) => ({
streamsPointSteps,
workspaceLocation
}),
updateLastDebuggerResult: (lastDebuggerResult: any, workspaceLocation: WorkspaceLocation) => ({
lastDebuggerResult,
workspaceLocation
Expand Down
1 change: 1 addition & 0 deletions src/commons/workspace/WorkspaceTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ type PlaygroundWorkspaceAttr = {
readonly stepsTotal: number;
readonly breakpointSteps: number[];
readonly changepointSteps: number[];
readonly streamsPointSteps: number[];
};
export type PlaygroundWorkspaceState = PlaygroundWorkspaceAttr & WorkspaceState;

Expand Down
3 changes: 2 additions & 1 deletion src/commons/workspace/__tests__/WorkspaceReducer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,8 @@ describe('LOG_OUT', () => {
currentStep: -1,
stepsTotal: 0,
breakpointSteps: [],
changepointSteps: []
changepointSteps: [],
streamsPointSteps: []
};

const logoutDefaultState: WorkspaceManagerState = {
Expand Down
11 changes: 11 additions & 0 deletions src/commons/workspace/reducers/cseReducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,16 @@ export const handleCseAndStepperActions = (
changepointSteps: action.payload.changepointSteps
}
};
})
.addCase(WorkspaceActions.updateStreamsPointSteps, (state, action) => {
// Keep streams change-points in sync for stream visualiser navigation
const workspaceLocation = getWorkspaceLocation(action);
return {
...state,
[workspaceLocation]: {
...state[workspaceLocation],
streamsPointSteps: action.payload.streamsPointSteps
}
};
});
};
32 changes: 31 additions & 1 deletion src/features/cseMachine/CseMachine.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,29 @@ export default class CseMachine {
private static printableMode: boolean = false;
private static controlStash: boolean = false; // TODO: discuss if the default should be true
private static stackTruncated: boolean = false;
private static pairCreationMode: boolean = false;
private static centerAlignment: boolean = false;
private static centerAlignmentToggled: boolean = false;
private static environmentTree: EnvTree | undefined;
private static currentEnvId: string;
private static control: Control | undefined;
private static stash: Stash | undefined;
private static streamLineage: Map<string, string[]>;
public static togglePrintableMode(): void {
CseMachine.printableMode = !CseMachine.printableMode;
}
public static toggleControlStash(): void {
CseMachine.pairCreationMode = false;
CseMachine.controlStash = !CseMachine.controlStash;
}
public static toggleStackTruncated(): void {
CseMachine.stackTruncated = !CseMachine.stackTruncated;
}
public static togglePairCreationMode(): void {
CseMachine.controlStash = false;
CseMachine.pairCreationMode = !CseMachine.pairCreationMode;
CseMachine.redraw();
}
public static setClearDeadFrames(enabled: boolean): void {
Layout.clearDeadFrames = enabled;
}
Expand Down Expand Up @@ -114,7 +122,22 @@ export default class CseMachine {
}
}
}
public static getStreamLineage(key: string): string[] | undefined {
return CseMachine.streamLineage.get(key);
}
public static findKeyByValueInMap(value: any) {
for (const [key, array] of CseMachine.streamLineage.entries()) {
// console.log(key + array);
Comment thread
DaRealTristan marked this conversation as resolved.
Outdated
if (array.includes(value)) {
return key;
}
}

return undefined;
}
public static getPairCreationMode(): boolean {
return CseMachine.pairCreationMode;
}
public static isControl(): boolean {
return this.control ? !this.control.isEmpty() : false;
}
Expand Down Expand Up @@ -149,6 +172,7 @@ export default class CseMachine {
throw new Error('CSE machine not initialized');
CseMachine.control = context.runtime.control;
CseMachine.stash = context.runtime.stash;
CseMachine.streamLineage = context.streamLineage;
Comment thread
DaRealTristan marked this conversation as resolved.
CseMachine.setClearDeadFrames(false);

Layout.setContext(
Expand Down Expand Up @@ -347,7 +371,13 @@ export default class CseMachine {
CseAnimation.updateAnimation();
}

if (
if (CseMachine.getPairCreationMode()) {
Layout.setContext(CseMachine.environmentTree, CseMachine.control, CseMachine.stash);
this.setVis(Layout.draw());
// this.setVis(Layout.draw());
// console.log(Layout.currentDarkPairs);
// this.setVis(Layout.currentDarkPairs);
Comment thread
DaRealTristan marked this conversation as resolved.
Outdated
} else if (
CseMachine.getPrintableMode() &&
CseMachine.getControlStash() &&
CseMachine.getStackTruncated() &&
Expand Down
Loading
Loading