A detach advances the references of nested copies, and marks the
geometry of one authored when its new main would place it elsewhere. For
a nested copy a layout places, that compared the place and the sizes
the layout gives it: a grid that starts its tracks at 0.01 px, or a copy
that fills its grid, made its geometry an override, while the contract
keeps the place of a layout child and the sizes it fills or hugs the
layout's. Such a copy now keeps as authored only an orientation or a
size of its own, leaving out the dimensions its layout gives it, and the
model checks the same.
Tests: detaching-after-a-main-adds-a-row-leaves-the-copy-boards-unauthored
(the grid gate program of seed 673701779) and
detaching-keeps-unauthored-a-nested-copy-a-grid-fills (a random grid
program of the common suite).
Common suite: 2466 tests; only the open red tests and a new random shape
structure case (F488 family) fail.
Benchmark (scripts/bench-components, ms, lower 2.5% quantile), measured
with the next commit's change in the tree as well:
| :world | :baseline | :now | :mean | :ratio |
|------------------------------------+-----------+---------+---------+--------|
| deepest-edit-through-three-levels | 35.215 | 22.04 | 22.52 | 0.63 |
| edit-through-a-chain-of-dependents | 68.931 | 43.463 | 44.28 | 0.63 |
| library-update-into-copies | 83.083 | 48.024 | 50.138 | 0.58 |
| main-edit-among-many-shapes | 4.837 | 2.247 | 2.418 | 0.46 |
| main-edit-into-10-copies | 1.79 | 1.06 | 1.078 | 0.59 |
| main-edit-into-100-copies | 15.415 | 10.242 | 11.303 | 0.66 |
| main-edit-into-1000-copies | 153.086 | 110.068 | 112.273 | 0.72 |
| variant-switch-into-copies | 32.052 | 22.921 | 23.391 | 0.72 |
AI-assisted-by: claude-opus-5-5