Skip to content

Commit 31fd2c9

Browse files
committed
update page
1 parent c967341 commit 31fd2c9

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

visual-tree-search-app/components/LATSVisual.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ const LATSVisual: React.FC<SimpleSearchVisualProps> = ({ messages }) => {
9595
}
9696

9797
// Handle tree structure updates
98-
if ((data.type === 'tree_update_node_expansion' || data.type === 'tree_update_node_children_evaluation')
98+
if ((data.type === 'tree_update_node_expansion' || data.type === 'tree_update_node_children_evaluation' || data.typ === 'tree_update_node_backpropagation')
9999
&& Array.isArray(data.tree)) {
100100
// Preserve simulation flags when updating from tree
101101
if (updatedTreeNodes.some(node => node.isSimulated)) {
@@ -151,11 +151,8 @@ const LATSVisual: React.FC<SimpleSearchVisualProps> = ({ messages }) => {
151151

152152
// Handle simulation removal
153153
if (data.type === 'removed_simulation') {
154-
// Remove simulation flags instead of removing nodes
155-
updatedTreeNodes = updatedTreeNodes.map(node => ({
156-
...node,
157-
isSimulated: false // Remove simulation flag
158-
}));
154+
// Remove all simulated nodes from the tree
155+
updatedTreeNodes = updatedTreeNodes.filter(node => !node.isSimulated);
159156

160157
newSimulatedNodes = []; // Clear simulated nodes list
161158
newSimulationStartNodeId = null; // Clear simulation start node

0 commit comments

Comments
 (0)