pub fn replace_node(
root: &mut LayoutNode,
target_id: &str,
new_node: LayoutNode,
) -> Result<(), LayoutError>Expand description
Replace the node at target_id with new_node, preserving the target’s
size. If target is root, replaces root-in-place (caller’s Option<LayoutNode>
doesn’t change reference — the fields are updated on the root node).