alonso.torres 72304d023b 🐛 Give a switched swap the grid cell of the child it replaces
A switch keeps a copy's swapped child: it moves the swap into the new
copy in place of the new child at its path and deletes that child. In a
grid copy whose cells were its main's, nothing carries the cells, so the
deleted child's cell stayed empty and the swap had no cell; the next
layout of the grid failed on the uncelled child.

`keep-swapped-item` gives the swap the cell of the child it replaces.

Benchmark (scripts/bench-components, ms, lower 2.5% quantile):

|                             :world | :baseline |   :now |   :mean | :ratio |
|------------------------------------+-----------+--------+---------+--------|
|  deepest-edit-through-three-levels |    35.215 | 22.929 |  23.421 |   0.65 |
| edit-through-a-chain-of-dependents |    68.931 | 41.595 |  45.427 |    0.6 |
|         library-update-into-copies |    83.083 | 47.657 |  49.963 |   0.57 |
|        main-edit-among-many-shapes |     4.837 |  2.118 |    2.33 |   0.44 |
|           main-edit-into-10-copies |      1.79 |  1.126 |   1.158 |   0.63 |
|          main-edit-into-100-copies |    15.415 | 10.291 |  11.027 |   0.67 |
|         main-edit-into-1000-copies |   153.086 | 101.89 | 104.528 |   0.67 |
|         variant-switch-into-copies |    32.052 | 21.203 |  22.033 |   0.66 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:47 +01:00
..