mirror of
https://github.com/penpot/penpot.git
synced 2026-11-21 01:22:01 +00:00
A switch carries the overrides of a copy's children into the new variant where both variants agree on the attribute, but it never carried their layout item attributes: margins, sizing, limits, absolute position, z-index and alignment. The switch walked the attributes a sync updates, which leave those out, and its list of attributes a switch may keep did not have them either, so a copy child lost its own margin or its absolute position, and the override with it. A switched child now carries them under the same rule; the switched head keeps its own placement as before. Benchmark (scripts/bench-components, ms, lower 2.5% quantile): | world | baseline | now | ratio | |------------------------------------+----------+---------+-------| | deepest-edit-through-three-levels | 35.215 | 21.753 | 0.62 | | edit-through-a-chain-of-dependents | 68.931 | 42.985 | 0.62 | | library-update-into-copies | 83.083 | 51.623 | 0.62 | | main-edit-among-many-shapes | 4.837 | 1.988 | 0.41 | | main-edit-into-10-copies | 1.790 | 0.971 | 0.54 | | main-edit-into-100-copies | 15.415 | 9.418 | 0.61 | | main-edit-into-1000-copies | 153.086 | 102.474 | 0.67 | | variant-switch-into-copies | 32.052 | 19.863 | 0.62 | AI-assisted-by: claude-opus-5-5