alonso.torres 8242ddbec7 🐛 Fill a grid copy's free cells in its references' layer order
An ungroup in a grid main ungroups its copies too. A copy with its own
cells gave the shapes the ungroup brings into it its free cells in the
reverse of its own layer order. That matches sync only when the copy
keeps the reverse of its references' order, as under a main, whose grid
the layout update reorders by its cells. A copy of a copy refers to a
copy, which keeps the order the ungroup gives, so its shapes took each
other's cells (F581).

The copy now ranks them by where their references sit in the grid it
refers to; a main's grid is ranked as `ctl/reorder-grid-children` leaves
it. Shapes whose reference is not there follow, in the reverse of the
copy's own order.

Test (composable-gen-test, fails before the fix; the earlier ungroup
tests pass):
`an-ungroup-fills-a-grid-copy-of-a-copy-in-its-references-layer-order`.

Benchmark (bench-components, alone):

|                             :world | :baseline |   :now |   :mean | :ratio |
|------------------------------------+-----------+--------+---------+--------|
|  deepest-edit-through-three-levels |    35.215 | 22.348 |  22.994 |   0.63 |
| edit-through-a-chain-of-dependents |    68.931 |  44.01 |  45.457 |   0.64 |
|         library-update-into-copies |    83.083 | 51.822 |  52.723 |   0.62 |
|        main-edit-among-many-shapes |     4.837 |  2.384 |   2.681 |   0.49 |
|           main-edit-into-10-copies |      1.79 |  1.107 |   1.139 |   0.62 |
|          main-edit-into-100-copies |    15.415 | 10.509 |  10.797 |   0.68 |
|         main-edit-into-1000-copies |   153.086 | 99.974 | 103.416 |   0.65 |
|         variant-switch-into-copies |    32.052 | 21.852 |  22.437 |   0.68 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:50 +01:00
..
2022-11-08 13:02:14 +01:00