From 22d7859d14370fb4017482e6cab310488d73823a Mon Sep 17 00:00:00 2001 From: Vemulapalli Akshay Date: Thu, 19 Feb 2026 15:52:33 +0800 Subject: [PATCH 01/26] Added the removeDeadFrames feature Only dead frames disappear as of right now, for function objects and the rest, work to be done Animations : will be done by Keying! --- .../content/SideContentCseMachine.tsx | 38 ++++++++++++++++++- src/features/cseMachine/CseMachine.tsx | 16 ++++++++ src/features/cseMachine/CseMachineLayout.tsx | 2 + src/features/cseMachine/components/Frame.tsx | 4 ++ 4 files changed, 58 insertions(+), 2 deletions(-) diff --git a/src/commons/sideContent/content/SideContentCseMachine.tsx b/src/commons/sideContent/content/SideContentCseMachine.tsx index 96a60442ab..ac28669c4b 100644 --- a/src/commons/sideContent/content/SideContentCseMachine.tsx +++ b/src/commons/sideContent/content/SideContentCseMachine.tsx @@ -42,6 +42,7 @@ type State = { lastStep: boolean; stepLimitExceeded: boolean; chapter: Chapter; + hideDeadFrames: boolean; }; type CseMachineProps = OwnProps & StateProps & DispatchProps; @@ -82,7 +83,8 @@ class SideContentCseMachineBase extends React.Component height: this.calculateHeight(props.sideContentHeight), lastStep: false, stepLimitExceeded: false, - chapter: props.chapter + chapter: props.chapter, + hideDeadFrames: false }; if (this.isJava()) { JavaCseMachine.init( @@ -300,8 +302,35 @@ class SideContentCseMachineBase extends React.Component onClick={this.stepNextBreakpoint} /> + {!this.isJava() && ( + + { + if (this.state.visualization) { + this.setState( + prevState => ({ + hideDeadFrames: !prevState.hideDeadFrames + }), + () => { + CseMachine.setHideDeadFrames(this.state.hideDeadFrames); + CseMachine.clearCachedLayouts(); + CseMachine.redraw(); + } + ); + } + }} + icon="eye-off" + disabled={!this.state.visualization} + > + + + { @@ -396,9 +425,14 @@ class SideContentCseMachineBase extends React.Component }; private sliderShift = (newValue: number) => { + if (this.state.hideDeadFrames) { + CseMachine.setHideDeadFrames(false); + CseMachine.clearCachedLayouts(); + CseMachine.redraw(); + } this.props.handleStepUpdate(newValue); this.setState((state: State) => { - return { value: newValue }; + return { value: newValue, hideDeadFrames: false }; }); }; diff --git a/src/features/cseMachine/CseMachine.tsx b/src/features/cseMachine/CseMachine.tsx index f829344807..c9cfad2c54 100644 --- a/src/features/cseMachine/CseMachine.tsx +++ b/src/features/cseMachine/CseMachine.tsx @@ -34,6 +34,19 @@ export default class CseMachine { public static toggleStackTruncated(): void { CseMachine.stackTruncated = !CseMachine.stackTruncated; } + public static setHideDeadFrames(enabled: boolean): void { + Layout.hideDeadFrames = enabled; + } + public static clearCachedLayouts(): void { + Layout.currentLight = undefined; + Layout.currentDark = undefined; + Layout.currentStackDark = undefined; + Layout.currentStackTruncDark = undefined; + Layout.currentStackLight = undefined; + Layout.currentStackTruncLight = undefined; + Layout.prevLayout = undefined; + Layout.key = 0; + } public static getCurrentEnvId(): string { return CseMachine.currentEnvId; } @@ -80,6 +93,7 @@ export default class CseMachine { throw new Error('CSE machine not initialized'); CseMachine.control = context.runtime.control; CseMachine.stash = context.runtime.stash; + CseMachine.setHideDeadFrames(false); Layout.setContext( context.runtime.environmentTree as EnvTree, @@ -156,6 +170,8 @@ export default class CseMachine { CseMachine.control = undefined; CseMachine.stash = undefined; } + CseMachine.setHideDeadFrames(false); + CseMachine.clearCachedLayouts(); this.clear(); } } diff --git a/src/features/cseMachine/CseMachineLayout.tsx b/src/features/cseMachine/CseMachineLayout.tsx index 0729009d27..980af23d73 100644 --- a/src/features/cseMachine/CseMachineLayout.tsx +++ b/src/features/cseMachine/CseMachineLayout.tsx @@ -90,6 +90,8 @@ export class Layout { /** all environment and value IDs that are live in the current context */ static liveEnvIDs: Set = new Set(); static liveObjectIDs: Set = new Set(); + /** hide non-live frames temporarily for the current step */ + static hideDeadFrames: boolean = false; /** * memoized values, where keys are either ids for arrays and closures, diff --git a/src/features/cseMachine/components/Frame.tsx b/src/features/cseMachine/components/Frame.tsx index b78c7fdbd3..d1b55966d4 100644 --- a/src/features/cseMachine/components/Frame.tsx +++ b/src/features/cseMachine/components/Frame.tsx @@ -203,6 +203,10 @@ export class Frame extends Visible implements IHoverable { onMouseLeave = () => {}; draw(): React.ReactNode { + if (Layout.hideDeadFrames && !this.isLive) { + return null; + } + return ( {this.name.draw()} From f02260afaba41cdfb344e1b7788bd6343c70dd64 Mon Sep 17 00:00:00 2001 From: Vemulapalli Akshay Date: Thu, 19 Feb 2026 16:20:53 +0800 Subject: [PATCH 02/26] Added the functionality for toggle of dead vs ONLY live for function closure objects Generic Arrow Text (recursively automated) Arrays and hence pairs as well --- src/features/cseMachine/components/ArrayEmptyUnit.tsx | 3 +++ src/features/cseMachine/components/Binding.tsx | 4 ++++ src/features/cseMachine/components/arrows/GenericArrow.tsx | 4 ++++ src/features/cseMachine/components/values/ArrayValue.tsx | 3 +++ src/features/cseMachine/components/values/FnValue.tsx | 4 +++- 5 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/features/cseMachine/components/ArrayEmptyUnit.tsx b/src/features/cseMachine/components/ArrayEmptyUnit.tsx index e6769d45c5..9db671b944 100644 --- a/src/features/cseMachine/components/ArrayEmptyUnit.tsx +++ b/src/features/cseMachine/components/ArrayEmptyUnit.tsx @@ -21,6 +21,9 @@ export class ArrayEmptyUnit extends Visible { } draw(): React.ReactNode { + if (Layout.hideDeadFrames && !this.parent.isLive) { + return null; + } const strokeColor = this.parent.isReferenced() && this.parent.isEnclosingFrameLive() ? defaultStrokeColor() diff --git a/src/features/cseMachine/components/Binding.tsx b/src/features/cseMachine/components/Binding.tsx index bc71ecdbf6..a8acf0f5f3 100644 --- a/src/features/cseMachine/components/Binding.tsx +++ b/src/features/cseMachine/components/Binding.tsx @@ -95,6 +95,10 @@ export class Binding extends Visible { ? ((this.value as any).isLive?.() ?? false) : this.frame.isLive; + if (Layout.hideDeadFrames && !isLive) { + return null; + } + this.key.options.faded = !isLive; if (this.value instanceof PrimitiveValue || this.value instanceof UnassignedValue) { diff --git a/src/features/cseMachine/components/arrows/GenericArrow.tsx b/src/features/cseMachine/components/arrows/GenericArrow.tsx index 7a1a243c31..5825ac7d29 100644 --- a/src/features/cseMachine/components/arrows/GenericArrow.tsx +++ b/src/features/cseMachine/components/arrows/GenericArrow.tsx @@ -105,6 +105,10 @@ export class GenericArrow exte draw() { this.updateIsLive(); //just before drawijng, update liveness for the arrows (since this was causing erroes earlier ) + if (Layout.hideDeadFrames && !this.isLive) { + return null; + } + const stroke = this.isLive ? defaultStrokeColor() : fadedStrokeColor(); return ( diff --git a/src/features/cseMachine/components/values/ArrayValue.tsx b/src/features/cseMachine/components/values/ArrayValue.tsx index 35c716139f..e7a44f5872 100644 --- a/src/features/cseMachine/components/values/ArrayValue.tsx +++ b/src/features/cseMachine/components/values/ArrayValue.tsx @@ -118,6 +118,9 @@ export class ArrayValue extends Value implements IHoverable { }; draw(): React.ReactNode { + if (Layout.hideDeadFrames && !this.isLive) { + return null; + } if (this.isDrawn()) return null; this._isDrawn = true; return ( diff --git a/src/features/cseMachine/components/values/FnValue.tsx b/src/features/cseMachine/components/values/FnValue.tsx index 8ffaf01a57..ec0c8ea107 100644 --- a/src/features/cseMachine/components/values/FnValue.tsx +++ b/src/features/cseMachine/components/values/FnValue.tsx @@ -150,7 +150,9 @@ export class FnValue extends Value implements IHoverable { const textColor = isLive ? defaultTextColor() : fadedTextColor(); const strokeColor = isLive ? defaultStrokeColor() : fadedStrokeColor(); //dont need to check isReferenced here since live is ALL we need to know - + if (Layout.hideDeadFrames && !isLive) { + return null; + } return ( From 321f22df828120d024d3a21d229f8fc4f83ec605 Mon Sep 17 00:00:00 2001 From: Vemulapalli Akshay Date: Thu, 19 Feb 2026 16:51:39 +0800 Subject: [PATCH 03/26] Fix : Removed gaps Finally processed the logic by recomputing the envTree for the specific step when the toggle is on --- src/features/cseMachine/CseMachineLayout.tsx | 36 ++++++++++++++++++-- src/features/cseMachine/components/Frame.tsx | 4 --- 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/src/features/cseMachine/CseMachineLayout.tsx b/src/features/cseMachine/CseMachineLayout.tsx index 980af23d73..3e49acdd28 100644 --- a/src/features/cseMachine/CseMachineLayout.tsx +++ b/src/features/cseMachine/CseMachineLayout.tsx @@ -41,6 +41,7 @@ import { isBuiltInFn, isClosure, isDataArray, + isEmptyEnvironment, isEnvEqual, isGlobalFn, isNonGlobalFn, @@ -360,7 +361,9 @@ export class Layout { /** initializes grid */ private static initializeGrid(): void { this.levels = []; - let frontier: EnvTreeNode[] = [Layout.globalEnvNode]; + let frontier: EnvTreeNode[] = Layout.hideDeadFrames + ? Layout.getVisibleChildren([Layout.globalEnvNode]) + : [Layout.globalEnvNode]; let prevLevel: Level | null = null; let currLevel: Level; @@ -371,7 +374,9 @@ export class Layout { frontier.forEach(e => { e.children.forEach(c => { - const nextChildren = getNextChildren(c as EnvTreeNode); + const nextChildren = Layout.hideDeadFrames + ? Layout.getVisibleChildren([c as EnvTreeNode]) + : getNextChildren(c as EnvTreeNode); nextChildren.forEach(c => (c.parent = e)); nextFrontier.push(...nextChildren); }); @@ -382,6 +387,33 @@ export class Layout { } } + /** + * Returns the next environment nodes that should be rendered. + * When broom mode is on, dead environments are skipped and their children are promoted. + * Empty environments are also skipped to preserve existing behavior. + * + * @param nodes candidate nodes + */ + private static getVisibleChildren(nodes: EnvTreeNode[]): EnvTreeNode[] { + const result: EnvTreeNode[] = []; + + const visit = (node: EnvTreeNode) => { + const isLive = Layout.liveEnvIDs.has(node.environment.id); + const isEmpty = isEmptyEnvironment(node.environment); + const shouldSkip = isEmpty || !isLive; + + if (!shouldSkip) { + result.push(node); + return; + } + + node.children.forEach(child => visit(child as EnvTreeNode)); + }; + + nodes.forEach(node => visit(node)); + return result; + } + /** Creates an instance of the corresponding `Value` if it doesn't already exists, * else, returns the existing value */ static createValue(data: Data, reference: ReferenceType): Value { diff --git a/src/features/cseMachine/components/Frame.tsx b/src/features/cseMachine/components/Frame.tsx index d1b55966d4..b78c7fdbd3 100644 --- a/src/features/cseMachine/components/Frame.tsx +++ b/src/features/cseMachine/components/Frame.tsx @@ -203,10 +203,6 @@ export class Frame extends Visible implements IHoverable { onMouseLeave = () => {}; draw(): React.ReactNode { - if (Layout.hideDeadFrames && !this.isLive) { - return null; - } - return ( {this.name.draw()} From 39a1ac0e06aff98dcb7bee17e5a891cf29e823cc Mon Sep 17 00:00:00 2001 From: Vemulapalli Akshay Date: Thu, 19 Feb 2026 19:03:21 +0800 Subject: [PATCH 04/26] Fix : CI format errors and made it from checkbox -> onClick button! --- .../SideContentCseMachine.test.tsx.snap | 38 +++++++++++++++++++ .../content/SideContentCseMachine.tsx | 8 +--- .../components/arrows/GenericArrow.tsx | 2 +- .../__snapshots__/Playground.test.tsx.snap | 29 ++++++++++++++ 4 files changed, 69 insertions(+), 8 deletions(-) diff --git a/src/commons/sideContent/__tests__/__snapshots__/SideContentCseMachine.test.tsx.snap b/src/commons/sideContent/__tests__/__snapshots__/SideContentCseMachine.test.tsx.snap index a62bd86c63..75b199dad6 100644 --- a/src/commons/sideContent/__tests__/__snapshots__/SideContentCseMachine.test.tsx.snap +++ b/src/commons/sideContent/__tests__/__snapshots__/SideContentCseMachine.test.tsx.snap @@ -335,6 +335,44 @@ exports[`CSE Machine component renders correctly 1`] = `
+ + + + + + + + + }} icon="eye-off" disabled={!this.state.visualization} - > - - + > exte if (Layout.hideDeadFrames && !this.isLive) { return null; } - + const stroke = this.isLive ? defaultStrokeColor() : fadedStrokeColor(); return ( diff --git a/src/pages/playground/__tests__/__snapshots__/Playground.test.tsx.snap b/src/pages/playground/__tests__/__snapshots__/Playground.test.tsx.snap index f50e5ebea9..83c74df2de 100644 --- a/src/pages/playground/__tests__/__snapshots__/Playground.test.tsx.snap +++ b/src/pages/playground/__tests__/__snapshots__/Playground.test.tsx.snap @@ -1146,6 +1146,35 @@ and also the
+ + + + + From 2c3897cdffe8645de0a57d45edcbf748c1bb1c91 Mon Sep 17 00:00:00 2001 From: Vemulapalli Akshay Date: Thu, 19 Feb 2026 19:28:53 +0800 Subject: [PATCH 05/26] Fix : Toggle -> One time cleanup --- src/commons/sideContent/content/SideContentCseMachine.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commons/sideContent/content/SideContentCseMachine.tsx b/src/commons/sideContent/content/SideContentCseMachine.tsx index d67901f83e..773942e28b 100644 --- a/src/commons/sideContent/content/SideContentCseMachine.tsx +++ b/src/commons/sideContent/content/SideContentCseMachine.tsx @@ -311,7 +311,7 @@ class SideContentCseMachineBase extends React.Component if (this.state.visualization) { this.setState( prevState => ({ - hideDeadFrames: !prevState.hideDeadFrames + hideDeadFrames: true }), () => { CseMachine.setHideDeadFrames(this.state.hideDeadFrames); From 44e1f30c8e42a85c44e936752a4a2dc1080d9bce Mon Sep 17 00:00:00 2001 From: Vemulapalli Akshay Date: Mon, 23 Feb 2026 20:09:02 +0800 Subject: [PATCH 06/26] Changed from Hide -> Clear and the icon --- src/commons/sideContent/content/SideContentCseMachine.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commons/sideContent/content/SideContentCseMachine.tsx b/src/commons/sideContent/content/SideContentCseMachine.tsx index 773942e28b..f29838a9b8 100644 --- a/src/commons/sideContent/content/SideContentCseMachine.tsx +++ b/src/commons/sideContent/content/SideContentCseMachine.tsx @@ -305,7 +305,7 @@ class SideContentCseMachineBase extends React.Component {!this.isJava() && ( - + { if (this.state.visualization) { @@ -321,7 +321,7 @@ class SideContentCseMachineBase extends React.Component ); } }} - icon="eye-off" + icon="eraser" disabled={!this.state.visualization} > From d6c68817773708a6d4aca5c95e13a11bbf7b5534 Mon Sep 17 00:00:00 2001 From: Vemulapalli Akshay Date: Tue, 3 Mar 2026 11:30:02 +0800 Subject: [PATCH 07/26] Fixed the following errors and implemented suggestions 1. Fixed the snapshot and lint erros 2. Added the disable feature (as suggested by @sayomaki) where to suggest that its CLEAR and not HIDE, we disable after pressing once!! 3. Changed all instances of hide to clear in our current implementation! --- .coverage-fix.tmp | 1 + .../SideContentCseMachine.test.tsx.snap | 6 +++--- .../content/SideContentCseMachine.tsx | 17 +++++++++-------- src/features/cseMachine/CseMachine.tsx | 8 ++++---- src/features/cseMachine/CseMachineLayout.tsx | 6 +++--- .../cseMachine/components/ArrayEmptyUnit.tsx | 2 +- src/features/cseMachine/components/Binding.tsx | 2 +- .../components/arrows/GenericArrow.tsx | 2 +- .../cseMachine/components/values/ArrayValue.tsx | 2 +- .../cseMachine/components/values/FnValue.tsx | 2 +- src/{global.d.ts => global.ts} | 0 .../__snapshots__/Playground.test.tsx.snap | 6 +++--- 12 files changed, 28 insertions(+), 26 deletions(-) create mode 100644 .coverage-fix.tmp rename src/{global.d.ts => global.ts} (100%) diff --git a/.coverage-fix.tmp b/.coverage-fix.tmp new file mode 100644 index 0000000000..e4e5614e41 --- /dev/null +++ b/.coverage-fix.tmp @@ -0,0 +1 @@ +./src/global.ts diff --git a/src/commons/sideContent/__tests__/__snapshots__/SideContentCseMachine.test.tsx.snap b/src/commons/sideContent/__tests__/__snapshots__/SideContentCseMachine.test.tsx.snap index 75b199dad6..dd3388d38b 100644 --- a/src/commons/sideContent/__tests__/__snapshots__/SideContentCseMachine.test.tsx.snap +++ b/src/commons/sideContent/__tests__/__snapshots__/SideContentCseMachine.test.tsx.snap @@ -356,17 +356,17 @@ exports[`CSE Machine component renders correctly 1`] = ` > diff --git a/src/commons/sideContent/content/SideContentCseMachine.tsx b/src/commons/sideContent/content/SideContentCseMachine.tsx index f29838a9b8..4ba1e72a8b 100644 --- a/src/commons/sideContent/content/SideContentCseMachine.tsx +++ b/src/commons/sideContent/content/SideContentCseMachine.tsx @@ -12,6 +12,7 @@ import { IconNames } from '@blueprintjs/icons'; import { HotkeyItem } from '@mantine/hooks'; import { bindActionCreators } from '@reduxjs/toolkit'; import classNames from 'classnames'; +import { clear } from 'console'; import { t } from 'i18next'; import { Chapter } from 'js-slang/dist/langs'; import { debounce } from 'lodash'; @@ -42,7 +43,7 @@ type State = { lastStep: boolean; stepLimitExceeded: boolean; chapter: Chapter; - hideDeadFrames: boolean; + clearDeadFrames: boolean; }; type CseMachineProps = OwnProps & StateProps & DispatchProps; @@ -84,7 +85,7 @@ class SideContentCseMachineBase extends React.Component lastStep: false, stepLimitExceeded: false, chapter: props.chapter, - hideDeadFrames: false + clearDeadFrames: false }; if (this.isJava()) { JavaCseMachine.init( @@ -311,10 +312,10 @@ class SideContentCseMachineBase extends React.Component if (this.state.visualization) { this.setState( prevState => ({ - hideDeadFrames: true + clearDeadFrames: true }), () => { - CseMachine.setHideDeadFrames(this.state.hideDeadFrames); + CseMachine.setClearDeadFrames(this.state.clearDeadFrames); CseMachine.clearCachedLayouts(); CseMachine.redraw(); } @@ -322,7 +323,7 @@ class SideContentCseMachineBase extends React.Component } }} icon="eraser" - disabled={!this.state.visualization} + disabled={this.state.clearDeadFrames || !this.state.visualization} > @@ -419,14 +420,14 @@ class SideContentCseMachineBase extends React.Component }; private sliderShift = (newValue: number) => { - if (this.state.hideDeadFrames) { - CseMachine.setHideDeadFrames(false); + if (this.state.clearDeadFrames) { + CseMachine.setClearDeadFrames(false); CseMachine.clearCachedLayouts(); CseMachine.redraw(); } this.props.handleStepUpdate(newValue); this.setState((state: State) => { - return { value: newValue, hideDeadFrames: false }; + return { value: newValue, clearDeadFrames: false }; }); }; diff --git a/src/features/cseMachine/CseMachine.tsx b/src/features/cseMachine/CseMachine.tsx index 406544e864..a1f91e8615 100644 --- a/src/features/cseMachine/CseMachine.tsx +++ b/src/features/cseMachine/CseMachine.tsx @@ -35,8 +35,8 @@ export default class CseMachine { public static toggleStackTruncated(): void { CseMachine.stackTruncated = !CseMachine.stackTruncated; } - public static setHideDeadFrames(enabled: boolean): void { - Layout.hideDeadFrames = enabled; + public static setClearDeadFrames(enabled: boolean): void { + Layout.clearDeadFrames = enabled; } public static clearCachedLayouts(): void { Layout.currentLight = undefined; @@ -95,7 +95,7 @@ export default class CseMachine { throw new Error('CSE machine not initialized'); CseMachine.control = context.runtime.control; CseMachine.stash = context.runtime.stash; - CseMachine.setHideDeadFrames(false); + CseMachine.setClearDeadFrames(false); Layout.setContext( context.runtime.environmentTree as EnvTree, @@ -172,7 +172,7 @@ export default class CseMachine { CseMachine.control = undefined; CseMachine.stash = undefined; } - CseMachine.setHideDeadFrames(false); + CseMachine.setClearDeadFrames(false); CseMachine.clearCachedLayouts(); this.clear(); } diff --git a/src/features/cseMachine/CseMachineLayout.tsx b/src/features/cseMachine/CseMachineLayout.tsx index 347f5c5b21..145f7bfdd2 100644 --- a/src/features/cseMachine/CseMachineLayout.tsx +++ b/src/features/cseMachine/CseMachineLayout.tsx @@ -93,7 +93,7 @@ export class Layout { static liveEnvIDs: Set = new Set(); static liveObjectIDs: Set = new Set(); /** hide non-live frames temporarily for the current step */ - static hideDeadFrames: boolean = false; + static clearDeadFrames: boolean = false; /** * memoized values, where keys are either ids for arrays and closures, @@ -363,7 +363,7 @@ export class Layout { /** initializes grid */ private static initializeGrid(): void { this.levels = []; - let frontier: EnvTreeNode[] = Layout.hideDeadFrames + let frontier: EnvTreeNode[] = Layout.clearDeadFrames ? Layout.getVisibleChildren([Layout.globalEnvNode]) : [Layout.globalEnvNode]; let prevLevel: Level | null = null; @@ -376,7 +376,7 @@ export class Layout { frontier.forEach(e => { e.children.forEach(c => { - const nextChildren = Layout.hideDeadFrames + const nextChildren = Layout.clearDeadFrames ? Layout.getVisibleChildren([c as EnvTreeNode]) : getNextChildren(c as EnvTreeNode); nextChildren.forEach(c => (c.parent = e)); diff --git a/src/features/cseMachine/components/ArrayEmptyUnit.tsx b/src/features/cseMachine/components/ArrayEmptyUnit.tsx index 9db671b944..cdda46e492 100644 --- a/src/features/cseMachine/components/ArrayEmptyUnit.tsx +++ b/src/features/cseMachine/components/ArrayEmptyUnit.tsx @@ -21,7 +21,7 @@ export class ArrayEmptyUnit extends Visible { } draw(): React.ReactNode { - if (Layout.hideDeadFrames && !this.parent.isLive) { + if (Layout.clearDeadFrames && !this.parent.isLive) { return null; } const strokeColor = diff --git a/src/features/cseMachine/components/Binding.tsx b/src/features/cseMachine/components/Binding.tsx index a8acf0f5f3..d115cd66a3 100644 --- a/src/features/cseMachine/components/Binding.tsx +++ b/src/features/cseMachine/components/Binding.tsx @@ -95,7 +95,7 @@ export class Binding extends Visible { ? ((this.value as any).isLive?.() ?? false) : this.frame.isLive; - if (Layout.hideDeadFrames && !isLive) { + if (Layout.clearDeadFrames && !isLive) { return null; } diff --git a/src/features/cseMachine/components/arrows/GenericArrow.tsx b/src/features/cseMachine/components/arrows/GenericArrow.tsx index 762c60750c..401da3ced0 100644 --- a/src/features/cseMachine/components/arrows/GenericArrow.tsx +++ b/src/features/cseMachine/components/arrows/GenericArrow.tsx @@ -224,7 +224,7 @@ export class GenericArrow draw() { this.updateIsLive(); //just before drawijng, update liveness for the arrows (since this was causing erroes earlier ) - if (Layout.hideDeadFrames && !this.isLive) { + if (Layout.clearDeadFrames && !this.isLive) { return null; } diff --git a/src/features/cseMachine/components/values/ArrayValue.tsx b/src/features/cseMachine/components/values/ArrayValue.tsx index e7a44f5872..f64df35d96 100644 --- a/src/features/cseMachine/components/values/ArrayValue.tsx +++ b/src/features/cseMachine/components/values/ArrayValue.tsx @@ -118,7 +118,7 @@ export class ArrayValue extends Value implements IHoverable { }; draw(): React.ReactNode { - if (Layout.hideDeadFrames && !this.isLive) { + if (Layout.clearDeadFrames && !this.isLive()) { return null; } if (this.isDrawn()) return null; diff --git a/src/features/cseMachine/components/values/FnValue.tsx b/src/features/cseMachine/components/values/FnValue.tsx index ec0c8ea107..c0340222b7 100644 --- a/src/features/cseMachine/components/values/FnValue.tsx +++ b/src/features/cseMachine/components/values/FnValue.tsx @@ -150,7 +150,7 @@ export class FnValue extends Value implements IHoverable { const textColor = isLive ? defaultTextColor() : fadedTextColor(); const strokeColor = isLive ? defaultStrokeColor() : fadedStrokeColor(); //dont need to check isReferenced here since live is ALL we need to know - if (Layout.hideDeadFrames && !isLive) { + if (Layout.clearDeadFrames && !isLive) { return null; } return ( diff --git a/src/global.d.ts b/src/global.ts similarity index 100% rename from src/global.d.ts rename to src/global.ts diff --git a/src/pages/playground/__tests__/__snapshots__/Playground.test.tsx.snap b/src/pages/playground/__tests__/__snapshots__/Playground.test.tsx.snap index 83c74df2de..1744fc958f 100644 --- a/src/pages/playground/__tests__/__snapshots__/Playground.test.tsx.snap +++ b/src/pages/playground/__tests__/__snapshots__/Playground.test.tsx.snap @@ -1158,17 +1158,17 @@ and also the >