diff --git a/webui/src/components/OperationTreeView.tsx b/webui/src/components/OperationTreeView.tsx
index 337f974a..e51661b2 100644
--- a/webui/src/components/OperationTreeView.tsx
+++ b/webui/src/components/OperationTreeView.tsx
@@ -297,7 +297,8 @@ const DisplayOperationTree = ({
level.groupingFn,
(groupKey: string, ops: FlowDisplayInfo[]) => {
const exemplar = ops[0];
- const children = new Set(ops.map(childGroupFn)).size;
+ const children = ops.length;
+ const expanded = expandedKeys.has(groupKey);
return {
key: groupKey,
title: (
@@ -305,7 +306,7 @@ const DisplayOperationTree = ({
{level.titleFn(exemplar)}
- {!expandedKeys.has(groupKey) && (
+ {!expanded && (
),
- children: expandedKeys.has(groupKey)
+ children: expanded
? fn(ops, expandedKeys, groupKey)
: [{ key: groupKey + "_loading", title: "Loading..." }],
};