flatten Stylish Tree
fun <T> flattenStylishTree(nodes: List<StylishTreeNode<T>>, expandedIds: Set<Any>): List<StylishVisibleTreeNode<T>>
Flattens only expanded branches of a tree in display order.
The result is suitable for LazyColumn, so collapsed or off-screen branches do not create a recursive composition tree. IDs must be stable and unique within the supplied tree.