mirror of
https://github.com/penpot/penpot.git
synced 2026-10-29 22:10:34 +00:00
A fix and a check in the variant switch (Phase 3c). - Keep a fixed-sizing size on a switch when both variants agree. A keep-touched variant switch carries a copy's resized size when the old and new variants agree on it (decision (a)). A shape whose :layout-item-h-sizing or :layout-item-v-sizing is :fix took the new variant's size on that axis even when both variants had the same one, so a resize the user made was lost (F61). The fixed axes now follow the same rule as the others: the copy's size when the variants agree, the new variant's when they differ, which is what the tests of a switch between variants of different sizes already expect. variants-switch-test: a fixed-width rect keeps its resized size. - Leave the shape out of child-of-swapped? by id. A keep-touched switch skips the touched shapes below a swapped child, which move with it. child-of-swapped? looked for a swap among the heads between the switched root and the shape, and left the shape out by dropping the last head, which is the shape only when it is a head; below a swapped child, a shape that is not a head saw that child dropped instead and was not skipped (F100). The switch still did the right thing, as such a shape finds nothing to pair with in the new variant. The shape is now left out by its id. The golden master is unchanged. variants-switch-test: an override inside a swapped child survives a keep-touched switch. - Check a switched resized copy text keeps only its geometry. A keep-touched variant switch of a copy whose text was resized, between variants whose texts are measured differently, carries the size and touches only :geometry-group: it adds no :content-group for the position data it leaves to be measured again (F101 does not happen). Benchmark (lower quantile, ms; baseline / now / ratio): deepest-edit-through-three-levels 35.2 / 16.7 / 0.47 edit-through-a-chain-of-dependents 68.9 / 33.1 / 0.48 library-update-into-copies 83.1 / 65.1 / 0.78 main-edit-among-many-shapes 4.8 / 3.6 / 0.73 main-edit-into-10-copies 1.8 / 0.8 / 0.47 main-edit-into-100-copies 15.4 / 8.3 / 0.54 main-edit-into-1000-copies 153.1 / 86.6 / 0.57 variant-switch-into-copies 32.1 / 20.1 / 0.63 AI-assisted-by: claude-opus-5-5