Expand description
Block CRUD operations.
FunctionsΒ§
- collect_
leaf_ πblock_ ids - Walk a layout-tree node, calling
sinkonce per leafdata.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_idfrom a layoutβs rootnode tree and leaforder. - prune_
node π - Recursively remove child nodes whose
data.block_idmatchesblock_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.