diff --git a/.serena/memories/common/core.md b/.serena/memories/common/core.md index 90395588e9..2a584d3a16 100644 --- a/.serena/memories/common/core.md +++ b/.serena/memories/common/core.md @@ -30,7 +30,7 @@ Model, schema, and persistence shape: Geometry and layout: - Shape geometry invariants, coordinate drift and approximate comparisons: `mem:common/geometry`. -- Layout/grid assignment, deassignment, metadata cleanup, and auto-positioning: `mem:common/layout-grid-subtleties`. +- Layout/grid assignment, deassignment, metadata cleanup, and auto-positioning: `mem:common/layout`. Change pipeline, validation, and migrations: - Change construction, undo/redo, application, compaction and schema validation: `mem:common/changes`. diff --git a/.serena/memories/common/layout-grid-subtleties.md b/.serena/memories/common/layout-grid-subtleties.md deleted file mode 100644 index 2a48b9d149..0000000000 --- a/.serena/memories/common/layout-grid-subtleties.md +++ /dev/null @@ -1,16 +0,0 @@ -# Common Layout and Grid Subtleties - -## Layout metadata - -- Layout container data and child layout-item data are removed by different helpers. Do not assume clearing a layout frame also clears all child layout metadata. -- Layout data can affect both container attrs and immediate child attrs; validate behavior for both sides when changing cleanup or propagation. - -## Grid assignment - -- Grid `assign-cells` ensures at least one column and row, skips absolute-position children, creates non-tracked rows/cols when children exceed tracked cells, and asserts that assigned cells do not overlap. -- `position-absolute?` counts HIDDEN shapes as absolute: hiding a grid child frees its cell on the next `assign-cells`. -- `reorder-grid-children` rewrites the parent's `:shapes` to the REVERSE of the sorted cell order, but children with no cell (hidden/absolute) keep their original index — do not "fix" this into moving them to an end; that broke copy/main positional slot alignment (referential-integrity crash). -- The `:reorder-children` change it emits is refused on parents inside component copies unless `allow-altering-copies` (same rule as `:mov-objects`); `pcb/reorder-grid-children` also skips copy grids producer-side. Copy child order is owned by the component sync engine. -- Grid deassignment removes cells for shapes that are no longer direct children or have become absolute-positioned. -- Auto-positioning is not just sorting: some auto cells are converted to manual when empty/manual/span state would break the auto sequence, then auto single-span items can be compacted. -- `fix-overlaps` is marked dev-only and removes one overlapping cell, preferring empty cells first. Avoid depending on it as normal production repair. \ No newline at end of file diff --git a/.serena/memories/common/layout.md b/.serena/memories/common/layout.md new file mode 100644 index 0000000000..3c7e79bbb2 --- /dev/null +++ b/.serena/memories/common/layout.md @@ -0,0 +1,8 @@ +# Common layout and grid + +- Layout container data and child layout-item data are removed by different helpers. Check both the container and immediate children when changing cleanup or propagation. +- `assign-cells` skips absolute-positioned children. Only when eligible children still need cells does it ensure at least one row and column, add tracks if needed and assert that the parent grid cells do not overlap. `position-absolute?` also treats hidden shapes as absolute, so hiding a grid child frees its cell. +- `reorder-grid-children` stores cell children in reverse visual cell order while preserving the indices of children without cells, including hidden and absolute shapes. Moving cell-less children to an end can break component alignment. +- The resulting `:reorder-children` is guarded inside component copies unless `allow-altering-copies`; the builder also skips copy grids. Copy child order belongs to component sync. See `mem:common/components`. +- Deassignment removes cells for shapes that are no longer direct children or become absolute. Auto-positioning can turn auto cells manual when empty, manual or spanning cells break the sequence; eligible single-span auto cells can then be compacted. +- `fix-overlaps` is marked for development in the source and removes an overlapping cell, preferring an empty one. Do not depend on it as normal production repair.