Module block

Module block 

Source
Expand description

Block CRUD operations.

FunctionsΒ§

collect_leaf_block_ids πŸ”’
Walk a layout-tree node, calling sink once per leaf data.block_id. Phase E.4.B Phase 2 β€” typed traversal (was JSON walks).
create_block
Create a new block in a tab.
delete_block
Delete a block from its parent tab and prune it from the layout tree.
heal_layout
Validate a layout against the set of existing block IDs, removing any orphaned leaf nodes. Called on tab activation as a self-healing pass.
heal_layout_body πŸ”’
Pure heal pass on a LayoutState given the set of block IDs that should still be present. Returns (changed, orphans_removed).
prune_block_from_layout πŸ”’
Remove all references to block_id from a layout’s rootnode tree and leaforder.
prune_node πŸ”’
Recursively remove child nodes whose data.block_id matches block_id. If removing a child leaves a parent with only one child, collapse by promoting the sole child to replace the parent node.
resolve_block_id_from_prefix
Resolve a block ID from an 8-character prefix within a tab.