clearNodeSelection method

void clearNodeSelection()

Clears all node selections.

Triggers the onNodeSelected callback with null to indicate no selection.

Does nothing if no nodes are currently selected.

Implementation

void clearNodeSelection() {
  if (_selectedNodeIds.isEmpty) return;

  for (final id in _selectedNodeIds) {
    final node = _nodes[id];
    if (node != null) {
      node.selected.value = false;
      // Keep z-index elevated (don't reset)
    }
  }
  _selectedNodeIds.clear();

  // Fire selection callback with null to indicate no selection
  callbacks.onNodeSelected?.call(null);
}