handleCommandDragGroupOperation method

void handleCommandDragGroupOperation(
  1. String nodeId,
  2. bool isCommandPressed
)

Handle Command+drag group operations (add nodes to groups)

This provides intuitive group management:

  • Command+drag node onto group → adds node to group
  • Visual feedback shows which group will be affected
  • Only works during Command+drag, preventing accidental operations

Implementation

void handleCommandDragGroupOperation(String nodeId, bool isCommandPressed) {
  if (!isCommandPressed) return;

  final intersectingGroup = findIntersectingGroup(nodeId);

  if (intersectingGroup != null) {
    // Node intersects with a group - add it if not already in group
    if (!intersectingGroup.dependencies.contains(nodeId)) {
      addNodeDependency(intersectingGroup.id, nodeId);
    }
  }
  // Note: Ungroup functionality via Command+drag has been removed
  // Use keyboard shortcuts (Cmd+Shift+G) for ungrouping instead
}