expandNonPrimitivesRecursive method

bool expandNonPrimitivesRecursive(
  1. String nodeId
)

Recursively expand non-primitive children of a node and their descendants in blocks-only mode (no edges).

First performs expandNonPrimitives on nodeId, then for each revealed non-primitive child, recursively does the same.

Before operating on each child, any prior expansion state (full expand or partial/port expand) is collapsed so that blocks-only mode starts from a clean slate.

Returns true if any new children were revealed.

Implementation

bool expandNonPrimitivesRecursive(String nodeId) {
  final node = nodeMap[nodeId];
  if (node == null) {
    return false;
  }

  // If the node is currently expanded or partially expanded, collapse
  // it first so expandNonPrimitives can work on its hiddenChildren.
  _ensureCollapsed(node);

  if (!expandNonPrimitives(nodeId, includeEdges: false)) {
    return false;
  }

  // The partial children are the non-primitive children just revealed.
  final revealedIds = node.partialChildIds;
  if (revealedIds == null) {
    return true;
  }

  revealedIds.toList().forEach(expandNonPrimitivesRecursive);
  return true;
}