alonso.torres 0ca00b7286 🐛 Keep a variant's name when its main is updated from a renamed copy
Updating a main from a copy with a name override renamed the component
and its main to the copy's name. A variant takes its name from its
set, though, and every member carries it, so a renamed copy of a
variant left the file failing validation (a variant main and component
with a name other than their set's). Updating the main of a variant
copy now pushes everything but the name, and the copy keeps its name as
an override. The component model and its update-main check expect the
same.

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

| world                              | baseline |     now | ratio |
|------------------------------------+----------+---------+-------|
| deepest-edit-through-three-levels  |   35.215 |  20.618 |  0.59 |
| edit-through-a-chain-of-dependents |   68.931 |  40.714 |  0.59 |
| library-update-into-copies         |   83.083 |  49.993 |  0.60 |
| main-edit-among-many-shapes        |    4.837 |   2.112 |  0.44 |
| main-edit-into-10-copies           |    1.790 |   1.105 |  0.62 |
| main-edit-into-100-copies          |   15.415 |   9.427 |  0.61 |
| main-edit-into-1000-copies         |  153.086 | 101.540 |  0.66 |
| variant-switch-into-copies         |   32.052 |  21.918 |  0.68 |

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