onActionBlockAdded method

void onActionBlockAdded(
  1. FFActionComponent actionBlock
)

Update the graph when an action block is added.

Analyzes the action block's dependencies on custom functions, custom actions, and other action blocks, then adds appropriate edges.

Implementation

void onActionBlockAdded(FFActionComponent actionBlock) {
  if (!actionBlock.hasIdentifier() || actionBlock.identifier.key.isEmpty) {
    return;
  }

  final nodeId = NodeIds.actionBlock(actionBlock.identifier.key);

  // Add the action block node if it doesn't exist
  if (!graph.hasNode(nodeId)) {
    graph.addNode(
      DependencyNode(id: nodeId, type: DependencyNodeType.actionBlock),
    );
  }

  // Analyze and apply dependencies
  final deps = ActionBlockDependencies.analyze(actionBlock);
  deps.applyToGraph(graph, nodeId);
}