Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
22d7859
Added the removeDeadFrames feature
Akshay-2007-1 Feb 19, 2026
baebfb5
Merge branch 'backup-branch'
Akshay-2007-1 Feb 19, 2026
f02260a
Added the functionality for toggle of dead vs ONLY live for
Akshay-2007-1 Feb 19, 2026
321f22d
Fix : Removed gaps
Akshay-2007-1 Feb 19, 2026
39a1ac0
Fix : CI format errors and made it from checkbox -> onClick button!
Akshay-2007-1 Feb 19, 2026
2c3897c
Fix : Toggle -> One time cleanup
Akshay-2007-1 Feb 19, 2026
44e1f30
Changed from Hide -> Clear and the icon
Akshay-2007-1 Feb 23, 2026
95d00a6
Merge branch 'master' into master
martin-henz Feb 25, 2026
26345cb
Merge branch 'master' into master
RichDom2185 Feb 27, 2026
d6c6881
Fixed the following errors and implemented suggestions
Akshay-2007-1 Mar 3, 2026
50f2b77
Merge branch 'master' into master
Akshay-2007-1 Mar 3, 2026
2ef3c48
Fixed tsc error
Akshay-2007-1 Mar 3, 2026
99f8301
Fixed the sentry bot suggestion
Akshay-2007-1 Mar 3, 2026
e00e5f2
Fixed the error where the frames WERE not moving due to the Layout te…
Akshay-2007-1 Mar 3, 2026
25755a4
Version 1
Akshay-2007-1 Mar 3, 2026
6906fe9
Version 2
Akshay-2007-1 Mar 3, 2026
492dc91
Added the following functionalities
Akshay-2007-1 Mar 3, 2026
7b32eb4
Fixed a bug where the gap between two frames was not dynamically bein…
Akshay-2007-1 Mar 3, 2026
c7b6466
Merge branch 'source-academy:master' into fix-cse
Akshay-2007-1 Mar 3, 2026
2cfc936
Merge branch 'source-academy:master' into fix-cse
Akshay-2007-1 Mar 4, 2026
d4de2c8
Fixed format error
Akshay-2007-1 Mar 4, 2026
a6eb238
Merge branch 'fix-cse' of https://github.com/Akshay-2007-1/CSE_livene…
Akshay-2007-1 Mar 4, 2026
547101e
cse layout: normalize frame width accounting and add printable fn des…
Akshay-2007-1 Mar 5, 2026
b82a03d
Fixed format errors
Akshay-2007-1 Mar 5, 2026
7e2ea03
Fixed sentry's bot error
Akshay-2007-1 Mar 5, 2026
e37bb21
Merge remote-tracking branch 'upstream/master' into fix-cse
Akshay-2007-1 Mar 5, 2026
f6e6880
Merge remote-tracking branch 'upstream/master' into fix-cse
Akshay-2007-1 Mar 5, 2026
38f3060
Merge branch 'source-academy:master' into fix-cse
Akshay-2007-1 Mar 9, 2026
f479f58
Fixed #3639 by adding closing parantheses
Akshay-2007-1 Mar 9, 2026
b47811a
Fix stationary x-coordinates for normal and printable modes:
gigopogy Mar 9, 2026
1663799
removed comments and console logs
gigopogy Mar 9, 2026
e112dec
template for storing y added in the layout map, as
ThatLi Mar 10, 2026
ed6cb06
Fixed format errors
Akshay-2007-1 Mar 9, 2026
f0e7938
Merge branch 'master' of https://github.com/source-academy/frontend
ThatLi Mar 16, 2026
86ae003
Merge branch 'master' of https://github.com/source-academy/frontend
ThatLi Mar 16, 2026
a5b7ae5
Merge remote-tracking branch 'upstream/master'
ThatLi Apr 7, 2026
de48e60
Merge branch 'upstream/master' into layout-cache
ThatLi Apr 7, 2026
d3879f2
Merge branch 'master' of https://github.com/source-academy/frontend
ThatLi May 21, 2026
0b5c3d8
Make arrow filtering and center alignment persistent
ThatLi May 22, 2026
c4c52af
remove unnecessary files
ThatLi May 22, 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
9 changes: 7 additions & 2 deletions src/commons/sideContent/content/SideContentCseMachine.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,14 +210,19 @@
this.handleResize();
}
if (prevProps.needCseUpdate && !this.props.needCseUpdate) {
CseMachine.resetArrowOriginFilters();
const preservedStep = Math.max(this.state.value, 0);
this.setState({ arrowFilterOpen: false });
this.stepFirst();

if (this.isJava()) {
JavaCseMachine.clearCse();
} else {
CseMachine.clearCse();
}

// Re-run the stepper at the preserved step so the display remains at the
// same step after editor update while still refreshing the CSE internals.
this.sliderShift(preservedStep);
this.sliderRelease(preservedStep);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

Calling this.sliderRelease(preservedStep) inside componentDidUpdate will trigger an infinite loop of evaluations.

When an evaluation finishes, needCseUpdate transitions from true to false, triggering this block. sliderRelease then calls handleEditorEval, which dispatches evalEditor. In Playground.tsx, evalEditor sets updateCse (the source for needCseUpdate) back to true. Once that evaluation completes, needCseUpdate becomes false again, and the cycle repeats.

If the goal is to restore the step after a code change, this logic needs a guard to prevent re-triggering evaluation if it was already initiated by this restoration process, or the step reset logic in Playground.tsx should be adjusted instead.

}
}

Expand Down Expand Up @@ -706,7 +711,7 @@
dispatch,
);

export const SideContentCseMachine = connect(

Check warning on line 714 in src/commons/sideContent/content/SideContentCseMachine.tsx

View workflow job for this annotation

GitHub Actions / lint (eslint)

Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components
mapStateToProps,
mapDispatchToProps,
)(SideContentCseMachineBase);
Expand Down
1 change: 0 additions & 1 deletion src/features/cseMachine/CseMachine.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,6 @@ export default class CseMachine {
}

static clearCse() {
CseMachine.resetArrowOriginFilters();
if (this.setVis) {
this.setVis(undefined);
CseMachine.environmentTree = undefined;
Expand Down
6 changes: 6 additions & 0 deletions src/features/cseMachine/CseMachineLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -922,6 +922,12 @@ export class Layout {
const currentWidth = frame.width();
frame.reassignWidth(Math.max(currentWidth, fixedWidth));
}

// get predetermined y coordinate
if (cache.framesY.has(id)) {
const fixedY = Layout.getGhostFrameY(id)!;
frame.reassignCoordinatesY(fixedY);
}
Comment thread
ThatLi marked this conversation as resolved.
});
});
}
Expand Down
7 changes: 6 additions & 1 deletion src/pages/playground/Playground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,12 @@ const Playground: React.FC<PlaygroundProps> = props => {
const autorunButtonHandlers = useMemo(() => {
return {
handleEditorEval: () => {
const wasCenterAligned = CseMachine.getCenterAlignment();
CseMachine.clearCachedLayouts();
if (wasCenterAligned) {
CseMachine.toggleCenterAlignment();
}
Comment on lines +427 to +431
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Manually toggling center alignment here is redundant and potentially ineffective.

  1. Redundancy: CseMachine.drawCse already handles the temporary state management (setting centerAlignment to false) required to build the layout cache internally (see CseMachine.tsx lines 344-363).
  2. Inconsistency: Since evalEditor is an asynchronous operation (it dispatches a saga), the toggle-back at line 447 will execute almost immediately, likely before the CSE machine actually performs its draw. This means the machine will still see the 'on' state during its execution.
  3. Side Effects: toggleCenterAlignment sets the centerAlignmentToggled flag, which may trigger unnecessary coordinate recalculations in redraw.
Suggested change
const wasCenterAligned = CseMachine.getCenterAlignment();
CseMachine.clearCachedLayouts();
if (wasCenterAligned) {
CseMachine.toggleCenterAlignment();
}
CseMachine.clearCachedLayouts();
References
  1. When refactoring components, avoid introducing state tracking mechanisms if the current behavior is an intentional design choice.


// reset stepper before evaluation
dispatch(WorkspaceActions.updateCurrentStep(-1, workspaceLocation));
dispatch(WorkspaceActions.updateStepsTotal(0, workspaceLocation));
Expand All @@ -438,7 +443,7 @@ const Playground: React.FC<PlaygroundProps> = props => {

dispatch(WorkspaceActions.evalEditor(workspaceLocation));
CseMachine.setClearDeadFrames(false);
if (CseMachine.getCenterAlignment()) {
if (wasCenterAligned) {
CseMachine.toggleCenterAlignment();
}
Comment on lines +446 to 448
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

This toggle-back logic should be removed along with the initial toggle at line 430. As noted previously, the internal state management in CseMachine.drawCse is sufficient and more robust for handling layout cache generation.

References
  1. When refactoring components, avoid introducing state tracking mechanisms if the current behavior is an intentional design choice.

},
Expand Down
Loading