find_next_insert_location

Function find_next_insert_location 

Source
fn find_next_insert_location(
    tree: &LayoutNode,
    max_children: usize,
) -> (&LayoutNode, usize)
Expand description

Find the best insertion location using the TypeScript scoring heuristic (Math.pow(depth, index + maxChildren)). Collects all candidates, then sorts by ascending score. Mirrors findNextInsertLocation in frontend/layout/lib/layoutNode.ts.