24910 Commits

Author SHA1 Message Date
alonso.torres
a7e39ae8cb 🐛 Find the main of a copy's child through every parent head
The remote shape of a copy's child was looked up in the component of its
outermost copy, then in the component of its nearest head. A copy nested
in a swapped copy refers to the main of the swapped copy's component,
which is neither: a switch of that nested copy found no remote shape for
it, paired a touched child with the new root and crashed comparing their
geometry.

The fallback tries the component of each parent head, from the nearest
one up.

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

| world                              | baseline |     now | ratio |
|------------------------------------+----------+---------+-------|
| deepest-edit-through-three-levels  |   35.215 |  21.863 |  0.62 |
| edit-through-a-chain-of-dependents |   68.931 |  39.725 |  0.58 |
| library-update-into-copies         |   83.083 |  48.505 |  0.58 |
| main-edit-among-many-shapes        |    4.837 |   2.747 |  0.57 |
| main-edit-into-10-copies           |     1.79 |   1.019 |  0.57 |
| main-edit-into-100-copies          |   15.415 |   9.565 |  0.62 |
| main-edit-into-1000-copies         |  153.086 | 100.188 |  0.65 |
| variant-switch-into-copies         |   32.052 |  21.229 |  0.66 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:46 +01:00
alonso.torres
4266de0f7c 🐛 Size a grid's fill child in the frame a turn leaves it in
A fill child of a grid takes the size of its content, resized along its
own axes. Those axes were read from the stored shape, while the same
modifiers may be turning it: turning a grid copy whose child fills its
width resized the child along its unturned axes and skewed it, and a
full sync then placed it unskewed.

The content size, and the check for a child turned in its grid, use the
frame the modifiers being calculated leave the shape in.

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

| world                              | baseline |     now | ratio |
|------------------------------------+----------+---------+-------|
| deepest-edit-through-three-levels  |   35.215 |  21.852 |  0.62 |
| edit-through-a-chain-of-dependents |   68.931 |  39.822 |  0.58 |
| library-update-into-copies         |   83.083 |  47.443 |  0.57 |
| main-edit-among-many-shapes        |    4.837 |   2.162 |  0.45 |
| main-edit-into-10-copies           |     1.79 |   1.028 |  0.57 |
| main-edit-into-100-copies          |   15.415 |  10.453 |  0.68 |
| main-edit-into-1000-copies         |  153.086 | 103.422 |  0.68 |
| variant-switch-into-copies         |   32.052 |  20.087 |  0.63 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:46 +01:00
alonso.torres
1f332c396f 🐛 Keep a turned head's first corner when a switch keeps its turn
A swap gives the new head the orientation of the head it replaces and,
when that turns it, puts it at the old head's first corner. A head that
already had that orientation, like a flipped copy of a flipped variant,
kept the untransformed top-left of the old one instead, so a wider
flipped variant grew to the other side; sync and the expected placement
keep a turned or flipped head's first corner.

A turned or flipped head takes the place of the old one at its first
corner also when its orientation does not change.

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

| world                              | baseline |     now | ratio |
|------------------------------------+----------+---------+-------|
| deepest-edit-through-three-levels  |   35.215 |   19.42 |  0.55 |
| edit-through-a-chain-of-dependents |   68.931 |  40.335 |  0.59 |
| library-update-into-copies         |   83.083 |   50.62 |  0.61 |
| main-edit-among-many-shapes        |    4.837 |   2.306 |  0.48 |
| main-edit-into-10-copies           |     1.79 |   0.963 |  0.54 |
| main-edit-into-100-copies          |   15.415 |  10.159 |  0.66 |
| main-edit-into-1000-copies         |  153.086 |  93.147 |  0.61 |
| variant-switch-into-copies         |   32.052 |  21.501 |  0.67 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:46 +01:00
alonso.torres
a95f26b601 🐛 Let a grid's fill alone size a child turned in the grid
A fill child of a grid takes the size of its content along its own axes,
and the grid's fill then scales its box to the cell along the grid's
axes. For a child turned in the grid the two disagree: each scale along
the grid's axes skews the turned child and leaves it narrower than its
content, and the next reflow widens it again. A grid board that fills
its cell and is turned 45 degrees grew and skewed on every reflow, and
its layout never settled.

A fill child turned in its grid no longer takes its content's size; the
grid's fill alone sizes it along the grid's axes.

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

| world                              | baseline |     now | ratio |
|------------------------------------+----------+---------+-------|
| deepest-edit-through-three-levels  |   35.215 |  20.311 |  0.58 |
| edit-through-a-chain-of-dependents |   68.931 |  39.017 |  0.57 |
| library-update-into-copies         |   83.083 |   47.52 |  0.57 |
| main-edit-among-many-shapes        |    4.837 |   2.313 |  0.48 |
| main-edit-into-10-copies           |     1.79 |   1.039 |  0.58 |
| main-edit-into-100-copies          |   15.415 |  10.063 |  0.65 |
| main-edit-into-1000-copies         |  153.086 |  94.681 |  0.62 |
| variant-switch-into-copies         |   32.052 |  22.649 |  0.71 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:46 +01:00
alonso.torres
2219737151 🐛 Keep the turn a detached copy shows when its main has another
A detach makes the nested copies of the copy it detaches refer one level
up. A swapped head turned 45 degrees by the position it filled becomes a
copy root of its own unturned component; its turn was not its own, so
the next sync turned it back to 0 and moved its children. The geometry of
such a copy was made its own only under a copy parent.

Under a plain parent, where a copy is placed freely, the copy now keeps
as its own an orientation or a size that differs from its main turned
like that parent. The orientation is compared by composing the axes of
the plain parent, of the main's parent and of the main, without placing
anything, so a main at the root of its page, whose parent is the page's
0x0 frame, compares right too; the size is compared with the main's. The
model expects the same.

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

| world                              | baseline |     now | ratio |
|------------------------------------+----------+---------+-------|
| deepest-edit-through-three-levels  |   35.215 |  19.758 |  0.56 |
| edit-through-a-chain-of-dependents |   68.931 |  41.031 |  0.60 |
| library-update-into-copies         |   83.083 |  51.567 |  0.62 |
| main-edit-among-many-shapes        |    4.837 |   2.314 |  0.48 |
| main-edit-into-10-copies           |     1.79 |   0.933 |  0.52 |
| main-edit-into-100-copies          |   15.415 |   9.007 |  0.58 |
| main-edit-into-1000-copies         |  153.086 |  90.173 |  0.59 |
| variant-switch-into-copies         |   32.052 |  21.637 |  0.68 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:46 +01:00
alonso.torres
b8a17af502 🐛 Keep the main's size when update main pushes a size a constraint keeps
A copy child that authors a constraint tying one of its dimensions to its
copy parent keeps the size it shows when its main changes size; that size
is kept by sync, not set by the user. Update main pushed it into the main
with the constraint, so a main's nested copy lost the height it authors.

Update main pushes such a copy shape, and its untouched descendants, with
the main's geometry: the main keeps its own size and takes only what the
copy authors.

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

| world                              | baseline |     now | ratio |
|------------------------------------+----------+---------+-------|
| deepest-edit-through-three-levels  |   35.215 |  20.743 |  0.59 |
| edit-through-a-chain-of-dependents |   68.931 |  41.304 |  0.60 |
| library-update-into-copies         |   83.083 |   51.06 |  0.61 |
| main-edit-among-many-shapes        |    4.837 |   2.565 |  0.53 |
| main-edit-into-10-copies           |     1.79 |   1.045 |  0.58 |
| main-edit-into-100-copies          |   15.415 |  10.021 |  0.65 |
| main-edit-into-1000-copies         |  153.086 | 107.311 |  0.70 |
| variant-switch-into-copies         |   32.052 |  22.143 |  0.69 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:46 +01:00
alonso.torres
5da7886351 🐛 Place a tiny swapped head at the first corner of its turned place
A sync places a swapped copy head where the shape it replaces would be.
When both are turned alike, it lines up their first corners; otherwise
it lines up the corners of their unrotated rectangles. Two transforms
counted as turned alike only when their matrices were close, and the
transform of a head at the 0.01 px minimum size scales its axes by its
rounding (0.706 for 0.707). So a tiny head in a turned copy was placed
by the unrotated corner of a 100 px board, and its selrect ended 50 px
away from its own corners.

The placement compares the directions of the transforms' axes, without
their lengths, as the sync of a parent's descendants already does.

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

| world                              | baseline |     now | ratio |
|------------------------------------+----------+---------+-------|
| deepest-edit-through-three-levels  |   35.215 |  20.375 |  0.58 |
| edit-through-a-chain-of-dependents |   68.931 |  39.744 |  0.58 |
| library-update-into-copies         |   83.083 |  49.053 |  0.59 |
| main-edit-among-many-shapes        |    4.837 |   2.269 |  0.47 |
| main-edit-into-10-copies           |     1.79 |   1.082 |  0.60 |
| main-edit-into-100-copies          |   15.415 |   9.911 |  0.64 |
| main-edit-into-1000-copies         |  153.086 |  95.772 |  0.63 |
| variant-switch-into-copies         |   32.052 |  21.539 |  0.67 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:46 +01:00
alonso.torres
5077c22ab9 🐛 Settle the descendants of a reflected copy child as sync does
Reflecting a shape can leave a turned descendant's flip flags in another
decomposition of the same transform (rotation 270 with a vertical flip
for rotation 90 with a horizontal one), and a later sync of the copy
rewrites them. The transform settles the descendants of a reflected copy
head from its copy root so both agree. A plain copy shape with children,
such as the nested head a main detached, was left out.

Any reflected copy shape with children settles from its copy root.

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

| world                              | baseline |     now | ratio |
|------------------------------------+----------+---------+-------|
| deepest-edit-through-three-levels  |   35.215 |  19.748 |  0.56 |
| edit-through-a-chain-of-dependents |   68.931 |  42.466 |  0.62 |
| library-update-into-copies         |   83.083 |  51.313 |  0.62 |
| main-edit-among-many-shapes        |    4.837 |   2.445 |  0.51 |
| main-edit-into-10-copies           |     1.79 |   0.988 |  0.55 |
| main-edit-into-100-copies          |   15.415 |   9.629 |  0.62 |
| main-edit-into-1000-copies         |  153.086 | 100.363 |  0.66 |
| variant-switch-into-copies         |   32.052 |  21.275 |  0.66 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:46 +01:00
alonso.torres
a737c17788 🐛 Keep the moved place of a copy child a swap replaces as its own
A copy child of a copy can be moved, which marks its geometry as its own.
Swapping it for another component keeps the place it was moved to, but
the new head only has the swap override, so the next sync brought it back
to the place its position in the main gives it. A variant switch already
marked that place as the new head's own geometry.

A swap marks it too, and the model expects that place as authored.

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

| world                              | baseline |     now | ratio |
|------------------------------------+----------+---------+-------|
| deepest-edit-through-three-levels  |   35.215 |  21.099 |  0.60 |
| edit-through-a-chain-of-dependents |   68.931 |  41.629 |  0.60 |
| library-update-into-copies         |   83.083 |  52.415 |  0.63 |
| main-edit-among-many-shapes        |    4.837 |   2.644 |  0.55 |
| main-edit-into-10-copies           |     1.79 |   1.104 |  0.62 |
| main-edit-into-100-copies          |   15.415 |  10.707 |  0.69 |
| main-edit-into-1000-copies         |  153.086 |  98.141 |  0.64 |
| variant-switch-into-copies         |   32.052 |  22.688 |  0.71 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:46 +01:00
alonso.torres
c095c6cce6 🐛 Keep the reset attributes of children a resized copy carries
A sync that resizes a copy shape carries its subtree through the
constraints of its children. It placed that subtree from the objects as
they were before the sync, so it wrote back the attributes the sync had
just given the children. A reset of a resized copy root left its child's
overridden layout item margin type in place, while clearing its touched
flag.

The subtree is placed from the objects as the sync left them, under the
parent as it was before the sync.

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

| world                              | baseline |     now | ratio |
|------------------------------------+----------+---------+-------|
| deepest-edit-through-three-levels  |   35.215 |  18.845 |  0.54 |
| edit-through-a-chain-of-dependents |   68.931 |  37.053 |  0.54 |
| library-update-into-copies         |   83.083 |   46.11 |  0.55 |
| main-edit-among-many-shapes        |    4.837 |   2.087 |  0.43 |
| main-edit-into-10-copies           |     1.79 |   0.921 |  0.51 |
| main-edit-into-100-copies          |   15.415 |    8.99 |  0.58 |
| main-edit-into-1000-copies         |  153.086 |  91.573 |  0.60 |
| variant-switch-into-copies         |   32.052 |  18.962 |  0.59 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:46 +01:00
alonso.torres
65cc2cf7c6 🔥 Remove the unused sync offset helper
geometry-sync-delta gave the offset a sync applies to a swapped child's
top-left. The sync places a swapped child with update-swapped-placement,
so nothing calls it.

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

| world                              | baseline |     now | ratio |
|------------------------------------+----------+---------+-------|
| deepest-edit-through-three-levels  |   35.215 |  19.099 |  0.54 |
| edit-through-a-chain-of-dependents |   68.931 |  37.265 |  0.54 |
| library-update-into-copies         |   83.083 |  47.334 |  0.57 |
| main-edit-among-many-shapes        |    4.837 |   2.055 |  0.42 |
| main-edit-into-10-copies           |     1.79 |   1.007 |  0.56 |
| main-edit-into-100-copies          |   15.415 |    9.18 |  0.60 |
| main-edit-into-1000-copies         |  153.086 |  92.235 |  0.60 |
| variant-switch-into-copies         |   32.052 |   20.23 |  0.63 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:46 +01:00
alonso.torres
288e43dd7a 🐛 Make a kept swapped child follow its parent's change on switch
A variant switch moves a swapped child of the old copy into the new one
and gives it the place of the new variant's occupant. The new copy is
created at its main's size, so in a copy that a layout had made wider the
child kept the size and place the wider parent gave it: a child the user
moved, with a right constraint, stayed by the old right edge, and one with
a scale constraint kept its grown size, which the layout then scaled again.

The child and its subtree now follow the change from the old parent to the
new one through their own constraints before taking that place.

The switch tests of develop's swapped and moved children placement cover
it.

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

| world                              | baseline |     now | ratio |
|------------------------------------+----------+---------+-------|
| deepest-edit-through-three-levels  |   35.215 |  21.321 |  0.61 |
| edit-through-a-chain-of-dependents |   68.931 |  42.794 |  0.62 |
| library-update-into-copies         |   83.083 |  50.007 |  0.60 |
| main-edit-among-many-shapes        |    4.837 |   2.297 |  0.47 |
| main-edit-into-10-copies           |     1.79 |   1.003 |  0.56 |
| main-edit-into-100-copies          |   15.415 |   9.732 |  0.63 |
| main-edit-into-1000-copies         |  153.086 |   98.04 |  0.64 |
| variant-switch-into-copies         |   32.052 |   20.73 |  0.65 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:46 +01:00
alonso.torres
b64de794a2 🐛 Make kept copy children follow a parent the sync resizes
A sync gives an untouched copy shape the geometry of its main, and it
carries the subtree of a shape it moves, turns or flips. A shape it only
resizes, like a copy root that a layout had made wider, left its kept
children where they were: a child the user moved, or a swapped one. The
layout then grew the parent back and moved them through their constraints
again, so a child with a right constraint drifted and one with a scale
constraint grew on every sync.

A resized shape now carries its subtree too, through the constraints of
its children, as it already did when it was also turned.

The sync tests of develop's swapped and moved children placement (the
right and scale constraints of a filled card) cover it.

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

| world                              | baseline |     now | ratio |
|------------------------------------+----------+---------+-------|
| deepest-edit-through-three-levels  |   35.215 |  19.216 |  0.55 |
| edit-through-a-chain-of-dependents |   68.931 |  40.478 |  0.59 |
| library-update-into-copies         |   83.083 |  45.274 |  0.54 |
| main-edit-among-many-shapes        |    4.837 |   2.131 |  0.44 |
| main-edit-into-10-copies           |     1.79 |    0.91 |  0.51 |
| main-edit-into-100-copies          |   15.415 |   8.947 |  0.58 |
| main-edit-into-1000-copies         |  153.086 |  88.109 |  0.58 |
| variant-switch-into-copies         |   32.052 |  21.369 |  0.67 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:46 +01:00
alonso.torres
ae0326d63f 🐛 Keep the layout item overrides of a switched copy head
A swap gives the new head the layout item values of the head it
replaces, without touching it. A variant switch then carries the old
head's overrides, but skips any attribute that already has the old
value, so the kept layout item values lost the overrides that authored
them: a later sync of a copy could replace them, and reset no longer
saw them.

A switch also gives the new head the touched groups of the kept
attributes the old head had. The model expects the old head's layout
item overrides to survive a switch.

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

| world                              | baseline |     now | ratio |
|------------------------------------+----------+---------+-------|
| deepest-edit-through-three-levels  |   35.215 |  18.466 |  0.52 |
| edit-through-a-chain-of-dependents |   68.931 |  38.447 |  0.56 |
| library-update-into-copies         |   83.083 |  45.429 |  0.55 |
| main-edit-among-many-shapes        |    4.837 |   2.162 |  0.45 |
| main-edit-into-10-copies           |     1.79 |   1.064 |  0.59 |
| main-edit-into-100-copies          |   15.415 |   9.072 |  0.59 |
| main-edit-into-1000-copies         |  153.086 |   89.75 |  0.59 |
| variant-switch-into-copies         |   32.052 |  19.484 |  0.61 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:46 +01:00
alonso.torres
8f0b749563 🐛 Place a reset nested copy beside the parent its layout moved
A reset nested copy under a copy that keeps its own geometry takes the
placement that a sync of that copy gives its subtree. That sync places
the reset head's parent before the parent's layout does, so when a copy
layout placed the parent elsewhere than its main, as a reversed flex
direction does, the reset head moved by the parent's main offset and
was left apart from the parent it belongs to.

The placement follows the parent where it is: it moves by the offset
between the parent's proposed and actual places.

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

| world                              | baseline |     now | ratio |
|------------------------------------+----------+---------+-------|
| deepest-edit-through-three-levels  |   35.215 |  18.762 |  0.53 |
| edit-through-a-chain-of-dependents |   68.931 |  39.749 |  0.58 |
| library-update-into-copies         |   83.083 |  46.429 |  0.56 |
| main-edit-among-many-shapes        |    4.837 |   2.079 |  0.43 |
| main-edit-into-10-copies           |     1.79 |   0.943 |  0.53 |
| main-edit-into-100-copies          |   15.415 |   8.922 |  0.58 |
| main-edit-into-1000-copies         |  153.086 |  91.435 |  0.60 |
| variant-switch-into-copies         |   32.052 |   20.56 |  0.64 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:46 +01:00
alonso.torres
babab40c93 🐛 Reassign the cells of an untouched grid without authoring them
Updating shapes reassigns the cell positions of the grids among them.
That reassignment ignored the update's touched options, so a layout
reflow, which updates every layout without touching it, marked the cells
of a copy grid as its own whenever they moved, as when a copy child
switched to a hidden variant left its cell.

Each grid reassigns its cells with the touched options of its own
update. The model expects a copy grid's direction change to author its
cells only when the change itself moves auto items, not when the reflow
after it makes a cell manual.

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

| world                              | baseline |     now | ratio |
|------------------------------------+----------+---------+-------|
| deepest-edit-through-three-levels  |   35.215 |  21.005 |  0.60 |
| edit-through-a-chain-of-dependents |   68.931 |  39.064 |  0.57 |
| library-update-into-copies         |   83.083 |  48.602 |  0.58 |
| main-edit-among-many-shapes        |    4.837 |   2.246 |  0.46 |
| main-edit-into-10-copies           |     1.79 |   0.984 |  0.55 |
| main-edit-into-100-copies          |   15.415 |  10.081 |  0.65 |
| main-edit-into-1000-copies         |  153.086 | 100.708 |  0.66 |
| variant-switch-into-copies         |   32.052 |  20.063 |  0.63 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:46 +01:00
alonso.torres
0e812b1f5e 🐛 Keep the inherited turn of a switched copy child without an override
A switch keeps an orientation that the copy, or a shape along its
reference chain, authored when both variants share it, and compares it
with the new copy's own orientation instead of the place its position
gives it. Any geometry override along the chain counted as authoring
it, so a copy child whose position main was only resized carried the
turn it inherits from its turned copy parent, and the switch marked that
inherited turn as a geometry override.

The orientation is carried only when it differs from its component's
orientation turned and flipped with its parent; an inherited one is
compared with the place its position gives it.

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

| world                              | baseline |     now | ratio |
|------------------------------------+----------+---------+-------|
| deepest-edit-through-three-levels  |   35.215 |  19.316 |  0.55 |
| edit-through-a-chain-of-dependents |   68.931 |  39.369 |  0.57 |
| library-update-into-copies         |   83.083 |  45.503 |  0.55 |
| main-edit-among-many-shapes        |    4.837 |   2.125 |  0.44 |
| main-edit-into-10-copies           |     1.79 |   0.933 |  0.52 |
| main-edit-into-100-copies          |   15.415 |   9.092 |  0.59 |
| main-edit-into-1000-copies         |  153.086 |  92.629 |  0.61 |
| variant-switch-into-copies         |   32.052 |  20.538 |  0.64 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:46 +01:00
alonso.torres
1b2c74da68 🐛 Keep the moved place of a copy child a switch replaces as its own
A copy child of a copy can be moved, which marks its geometry as its own.
Switching it to another variant keeps the place it was moved to, but the
new head only has the swap override, so the next sync brought it back to
the place its position in the main gives it.

When the switch keeps a first corner that the head's position would not
give it inside its copy parent, the new head's geometry is marked as its
own. The model expects that place as authored.

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

| world                              | baseline |     now | ratio |
|------------------------------------+----------+---------+-------|
| deepest-edit-through-three-levels  |   35.215 |  18.478 |  0.52 |
| edit-through-a-chain-of-dependents |   68.931 |  37.022 |  0.54 |
| library-update-into-copies         |   83.083 |  45.307 |  0.55 |
| main-edit-among-many-shapes        |    4.837 |   2.118 |  0.44 |
| main-edit-into-10-copies           |     1.79 |   0.975 |  0.54 |
| main-edit-into-100-copies          |   15.415 |   9.505 |  0.62 |
| main-edit-into-1000-copies         |  153.086 |  96.857 |  0.63 |
| variant-switch-into-copies         |   32.052 |  19.846 |  0.62 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:46 +01:00
alonso.torres
b5804addae 🚑 Keep the gap of a space-around grid without tracks
A grid layout with space-around content alignment divides its free space
by its number of tracks to find the gap. A grid with no columns or no
rows divided by zero, which throws on the JVM and gives an infinite gap
in JS. Without tracks there is no space to distribute, so the gap stays
the configured one.

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

| world                              | baseline |     now | ratio |
|------------------------------------+----------+---------+-------|
| deepest-edit-through-three-levels  |   35.215 |  18.284 |  0.52 |
| edit-through-a-chain-of-dependents |   68.931 |   36.15 |  0.52 |
| library-update-into-copies         |   83.083 |  45.659 |  0.55 |
| main-edit-among-many-shapes        |    4.837 |   2.184 |  0.45 |
| main-edit-into-10-copies           |     1.79 |   0.925 |  0.52 |
| main-edit-into-100-copies          |   15.415 |   8.865 |  0.58 |
| main-edit-into-1000-copies         |  153.086 |  88.254 |  0.58 |
| variant-switch-into-copies         |   32.052 |  20.181 |  0.63 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:46 +01:00
alonso.torres
0436156e27 🐛 Keep the moved place of a copy child a pushed switch replaces
A copy in a main can move one of its nested children, which marks the
child's geometry as its own. When a copy of that main switches the child
to another variant and the switch is pushed into the main, the new
nested copy replaces the moved child at the same place, but nothing
marked that place as its own. The next sync brought it back to its
component's place and the main's nested copy no longer matched.

The pushed head now takes the placement groups the replaced child had
touched, so it keeps the place it inherits. The model expects them with
the head's geometry in the main.

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

| world                              | baseline |     now | ratio |
|------------------------------------+----------+---------+-------|
| deepest-edit-through-three-levels  |   35.215 |  21.215 |  0.60 |
| edit-through-a-chain-of-dependents |   68.931 |  41.146 |  0.60 |
| library-update-into-copies         |   83.083 |  48.017 |  0.58 |
| main-edit-among-many-shapes        |    4.837 |   2.678 |  0.55 |
| main-edit-into-10-copies           |     1.79 |   1.023 |  0.57 |
| main-edit-into-100-copies          |   15.415 |   9.272 |  0.60 |
| main-edit-into-1000-copies         |  153.086 |  94.933 |  0.62 |
| variant-switch-into-copies         |   32.052 |  24.787 |  0.77 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:46 +01:00
alonso.torres
a3afd4cd76 🐛 Bring a swapped component's size to a copy child with its own constraint
A copy child whose copy sets a constraint that ties one of its
dimensions to its parent keeps the geometry it shows at sync, since
the constraint applies to later resizes. That rule also held when the
main swapped the child for another component, so the child kept the
old component's 100x100 while the other copies showed the new 120x140,
and update mains then pushed the old size into the main.

The child keeps its geometry only while it shows its main's component;
a swap reaching it brings the new component's size.

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

| world                              | baseline |     now | ratio |
|------------------------------------+----------+---------+-------|
| deepest-edit-through-three-levels  |   35.215 |  20.406 |  0.58 |
| edit-through-a-chain-of-dependents |   68.931 |  38.828 |  0.56 |
| library-update-into-copies         |   83.083 |  50.763 |  0.61 |
| main-edit-among-many-shapes        |    4.837 |   2.508 |  0.52 |
| main-edit-into-10-copies           |     1.79 |   1.013 |  0.57 |
| main-edit-into-100-copies          |   15.415 |   9.418 |  0.61 |
| main-edit-into-1000-copies         |  153.086 |  91.613 |  0.60 |
| variant-switch-into-copies         |   32.052 |  21.561 |  0.67 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:46 +01:00
alonso.torres
5f4ef66314 🐛 Resize a copy's subtree through constraints when sync also turns it
When sync turns a copy parent, it turns and moves the parent's whole
subtree, geometry overrides included, by the parent's center. When the
same sync also resizes the parent, that center shift carries half the
resize, so a child with its own geometry moved as if its constraint were
center: a top-constrained child ended 10 px above its place after an
update main turned its parent back and shrank it by 20 px.

A parent that is turned and resized at once now resizes its subtree
through the children's constraints first, then turns and moves it as one
piece, as the main's subtree is placed into a copy.

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

| world                              | baseline |     now | ratio |
|------------------------------------+----------+---------+-------|
| deepest-edit-through-three-levels  |   35.215 |  23.162 |  0.66 |
| edit-through-a-chain-of-dependents |   68.931 |  43.751 |  0.63 |
| library-update-into-copies         |   83.083 |  52.008 |  0.63 |
| main-edit-among-many-shapes        |    4.837 |   2.897 |  0.60 |
| main-edit-into-10-copies           |     1.79 |   1.103 |  0.62 |
| main-edit-into-100-copies          |   15.415 |  10.807 |  0.70 |
| main-edit-into-1000-copies         |  153.086 | 105.726 |  0.69 |
| variant-switch-into-copies         |   32.052 |  24.017 |  0.75 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:46 +01:00
alonso.torres
d7ade70b57 🐛 Store the turn a mirrored shape's transform decomposes into
When sync turns a subtree, it added the head's angle to the rotation of
every shape in it. A shape mirrored relative to the head stores its turn
the other way, so it kept the right transform and corners with a stored
rotation 90 degrees off: 225 for a transform that its vertical flip
decomposes as 315.

Each turned shape now stores its rotation plus the angle, or minus it
when only that one decomposes its transform with its flips. A copy
flipped through a turned nested head now stores 90, the turn its
transform decomposes into, where it stored 270; the test that recorded
270 checks that the oracle still accepts either sign.

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

| world                              | baseline |     now | ratio |
|------------------------------------+----------+---------+-------|
| deepest-edit-through-three-levels  |   35.215 |  21.321 |  0.61 |
| edit-through-a-chain-of-dependents |   68.931 |  40.817 |  0.59 |
| library-update-into-copies         |   83.083 |  52.024 |  0.63 |
| main-edit-among-many-shapes        |    4.837 |   2.486 |  0.51 |
| main-edit-into-10-copies           |     1.79 |   0.972 |  0.54 |
| main-edit-into-100-copies          |   15.415 |   9.993 |  0.65 |
| main-edit-into-1000-copies         |  153.086 | 102.183 |  0.67 |
| variant-switch-into-copies         |   32.052 |  23.063 |  0.72 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:46 +01:00
alonso.torres
7fd46d516b 🐛 Keep a detached nested copy child where it is
Detaching a copy links each nested copy to the next main up. A nested
copy that keeps a size of its own then places its children against the
new main's size, so a child with its own center constraint stayed in
place at the detach but moved at the next sync of that component, with
no change to the main.

Detach now marks the geometry of each shape it links to a new main as
the copy's own when its next sync would place it elsewhere, so it stays
where it is. Swapped heads still take their new place. The model
predicts the same override.

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

| world                              | baseline |     now | ratio |
|------------------------------------+----------+---------+-------|
| deepest-edit-through-three-levels  |   35.215 |  20.643 |  0.59 |
| edit-through-a-chain-of-dependents |   68.931 |  40.331 |  0.59 |
| library-update-into-copies         |   83.083 |  46.648 |  0.56 |
| main-edit-among-many-shapes        |    4.837 |   2.336 |  0.48 |
| main-edit-into-10-copies           |     1.79 |   0.995 |  0.56 |
| main-edit-into-100-copies          |   15.415 |    9.07 |  0.59 |
| main-edit-into-1000-copies         |  153.086 |  91.388 |  0.60 |
| variant-switch-into-copies         |   32.052 |  21.317 |  0.67 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:46 +01:00
alonso.torres
c73b30cb56 🚑 Lay out a single-line flex board aligned by space-between
A wrapped flex board whose content is aligned by space-between shares its
free space between its lines, dividing it by the number of lines minus
one. With a single line and integer sizes that is a division by zero,
which throws in Clojure. The gap after a single line goes unused, so it
now takes the layout's own gap.

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

| world                              | baseline |     now | ratio |
|------------------------------------+----------+---------+-------|
| deepest-edit-through-three-levels  |   35.215 |   20.49 |  0.58 |
| edit-through-a-chain-of-dependents |   68.931 |  41.045 |  0.60 |
| library-update-into-copies         |   83.083 |  51.057 |  0.61 |
| main-edit-among-many-shapes        |    4.837 |   2.253 |  0.47 |
| main-edit-into-10-copies           |     1.79 |   1.055 |  0.59 |
| main-edit-into-100-copies          |   15.415 |   9.948 |  0.65 |
| main-edit-into-1000-copies         |  153.086 | 108.962 |  0.71 |
| variant-switch-into-copies         |   32.052 |  21.743 |  0.68 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:46 +01:00
alonso.torres
3beb329bc7 🐛 Carry a copy child's flip over a variant switch
A switch carries the geometry overrides that both variants agree on,
but the flip flags were not among the attributes it may keep, and the
carried points were built with the new copy's transform. A copy child
flipped horizontally kept its flipped transform after a switch while
losing its flip flag and the flipped corner order. The flags now carry
like the rotation, and the carried points follow the transform the
switch carries.

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

| world                              | baseline |     now | ratio |
|------------------------------------+----------+---------+-------|
| deepest-edit-through-three-levels  |   35.215 |  21.073 |  0.60 |
| edit-through-a-chain-of-dependents |   68.931 |   38.55 |  0.56 |
| library-update-into-copies         |   83.083 |  46.597 |  0.56 |
| main-edit-among-many-shapes        |    4.837 |   2.177 |  0.45 |
| main-edit-into-10-copies           |     1.79 |   0.924 |  0.52 |
| main-edit-into-100-copies          |   15.415 |  10.188 |  0.66 |
| main-edit-into-1000-copies         |  153.086 |  93.214 |  0.61 |
| variant-switch-into-copies         |   32.052 |  20.662 |  0.64 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:46 +01:00
alonso.torres
05ae99a666 🐛 Keep a copy child's geometry when the copy authors its constraint
A copy resized after its main keeps a child with top constraints at its
size. Setting that child's vertical constraint to scale in the copy
moves nothing, but the next sync resized the child through the new
constraint by the whole earlier resize: a 20 px child of a copy twice
its main's height became 40 px, at whatever later moment a sync came. A
constraint applies to the resizes after it, so a copy child whose copy
authors a constraint that ties one of its dimensions keeps the geometry
it shows, and its children follow it. The test oracle expects the same.

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

| world                              | baseline |     now | ratio |
|------------------------------------+----------+---------+-------|
| deepest-edit-through-three-levels  |   35.215 |  20.631 |  0.59 |
| edit-through-a-chain-of-dependents |   68.931 |  39.243 |  0.57 |
| library-update-into-copies         |   83.083 |  46.415 |  0.56 |
| main-edit-among-many-shapes        |    4.837 |   2.091 |  0.43 |
| main-edit-into-10-copies           |     1.79 |   1.073 |  0.60 |
| main-edit-into-100-copies          |   15.415 |   9.951 |  0.65 |
| main-edit-into-1000-copies         |  153.086 | 100.057 |  0.65 |
| variant-switch-into-copies         |   32.052 |  20.292 |  0.63 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:46 +01:00
alonso.torres
0b30155159 🐛 Keep the parent's turn out of an update main of a resized top copy
A top copy turned with its parent board keeps that turn when the board
is detached. Resizing the copy gives it a geometry of its own, and
update main then pushed the board's turn into the main, while sync
composes the copy with its parent's turn again: the copy turned twice.
Update main now turns back the parent's turn for a top copy root with
its own geometry, as it does for nested roots; under an unturned parent
that is no turn.

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

| world                              | baseline |     now | ratio |
|------------------------------------+----------+---------+-------|
| deepest-edit-through-three-levels  |   35.215 |  19.207 |  0.55 |
| edit-through-a-chain-of-dependents |   68.931 |  37.719 |  0.55 |
| library-update-into-copies         |   83.083 |  47.009 |  0.57 |
| main-edit-among-many-shapes        |    4.837 |    2.17 |  0.45 |
| main-edit-into-10-copies           |     1.79 |   1.039 |  0.58 |
| main-edit-into-100-copies          |   15.415 |  10.179 |  0.66 |
| main-edit-into-1000-copies         |  153.086 | 101.906 |  0.67 |
| variant-switch-into-copies         |   32.052 |  20.838 |  0.65 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:46 +01:00
alonso.torres
c13dcdd71f 🐛 Keep a copy text's own variant when both sides show its weight
A copy text that sets its own family and weight keeps the variant id its
family names for that weight. When the main later shows the same weight,
the weight is equal on both sides and sync does not place it, so the
family's variant ids were not given either: the copy's Roboto run took
the main's "bold", a variant of another family. The family's side now
gives its variants whenever the family is placed and the weight is not.

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

| world                              | baseline |     now | ratio |
|------------------------------------+----------+---------+-------|
| deepest-edit-through-three-levels  |   35.215 |  20.095 |  0.57 |
| edit-through-a-chain-of-dependents |   68.931 |  39.445 |  0.57 |
| library-update-into-copies         |   83.083 |  45.617 |  0.55 |
| main-edit-among-many-shapes        |    4.837 |   2.227 |  0.46 |
| main-edit-into-10-copies           |     1.79 |   0.961 |  0.54 |
| main-edit-into-100-copies          |   15.415 |   9.374 |  0.61 |
| main-edit-into-1000-copies         |  153.086 |  94.792 |  0.62 |
| variant-switch-into-copies         |   32.052 |  20.436 |  0.64 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:46 +01:00
alonso.torres
1fb421277b 🐛 Order a copy grid with its own cells by the flow of those cells
A copy grid that keeps its own cells held its children in its main's
order, which can differ from the order its cells flow in. Updating the
main from such a copy gave the main that order with the copy's cells,
and a later reflow put the main back in its own flow while its copies
kept the old order.

A copy grid with its own cells now orders its children by the flow of
its cells: sync orders it after taking them, and the grid reorder of an
edit includes it, which a copy reorder has to allow. Update-main gives
the main the copy's order in one change, as moving each child to its
place could not be undone to the main's former order.

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

| world                              | baseline |     now | ratio |
|------------------------------------+----------+---------+-------|
| deepest-edit-through-three-levels  |   35.215 |   18.54 |  0.53 |
| edit-through-a-chain-of-dependents |   68.931 |  37.494 |  0.54 |
| library-update-into-copies         |   83.083 |   46.85 |  0.56 |
| main-edit-among-many-shapes        |    4.837 |   2.199 |  0.45 |
| main-edit-into-10-copies           |     1.79 |   0.943 |  0.53 |
| main-edit-into-100-copies          |   15.415 |   8.927 |  0.58 |
| main-edit-into-1000-copies         |  153.086 |  91.773 |  0.60 |
| variant-switch-into-copies         |   32.052 |  20.421 |  0.64 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:45 +01:00
alonso.torres
c9316735a8 🐛 Place a reset nested head as a resized copy around it places it
A copy taller than its main scales a nested head that is set to scale
vertically. Resetting that head gave it the size of its main and kept
its place, and the next sync scaled it again. Only a head with its own
geometry took the placement a sync of the enclosing copy gives; a head
under a copy with its own geometry, up to that enclosing copy, takes it
too.

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

| world                              | baseline |     now | ratio |
|------------------------------------+----------+---------+-------|
| deepest-edit-through-three-levels  |   35.215 |  19.071 |  0.54 |
| edit-through-a-chain-of-dependents |   68.931 |  40.616 |  0.59 |
| library-update-into-copies         |   83.083 |  46.556 |  0.56 |
| main-edit-among-many-shapes        |    4.837 |   2.149 |  0.44 |
| main-edit-into-10-copies           |     1.79 |   1.003 |  0.56 |
| main-edit-into-100-copies          |   15.415 |   9.518 |  0.62 |
| main-edit-into-1000-copies         |  153.086 |  94.056 |  0.61 |
| variant-switch-into-copies         |   32.052 |  20.334 |  0.63 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:45 +01:00
alonso.torres
c318971107 🐛 Refuse an update of a main that loops through several held mains
Updating a main from its copy checked the copies the copy holds and the
mains of those, but no deeper. A chain of mains, each holding the next
through a copy that swapped its head away, could still end in the
component being updated, which then nested inside itself.

The check now follows the held components through every level.

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

| world                              | baseline |     now | ratio |
|------------------------------------+----------+---------+-------|
| deepest-edit-through-three-levels  |   35.215 |   18.93 |  0.54 |
| edit-through-a-chain-of-dependents |   68.931 |  38.249 |  0.55 |
| library-update-into-copies         |   83.083 |  44.715 |  0.54 |
| main-edit-among-many-shapes        |    4.837 |   2.166 |  0.45 |
| main-edit-into-10-copies           |     1.79 |   0.949 |  0.53 |
| main-edit-into-100-copies          |   15.415 |   9.513 |  0.62 |
| main-edit-into-1000-copies         |  153.086 | 102.177 |  0.67 |
| variant-switch-into-copies         |   32.052 |  20.994 |  0.65 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:45 +01:00
alonso.torres
6ebac310ba 🐛 Refuse a swap that loops through the main of a held component
Swapping or switching a head for a component checked only the copies in
that component's main against the head's parents. A copy there could
have swapped away a component that its own main still holds, so the
swap passed, and a sync or reset that brought the held component back
nested a component inside itself.

The check now follows each component the new main holds into its main,
through every level, as the nest check does.

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

| world                              | baseline |     now | ratio |
|------------------------------------+----------+---------+-------|
| deepest-edit-through-three-levels  |   35.215 |  19.108 |  0.54 |
| edit-through-a-chain-of-dependents |   68.931 |  39.394 |  0.57 |
| library-update-into-copies         |   83.083 |  45.356 |  0.55 |
| main-edit-among-many-shapes        |    4.837 |   2.251 |  0.47 |
| main-edit-into-10-copies           |     1.79 |   0.974 |  0.54 |
| main-edit-into-100-copies          |   15.415 |   9.266 |  0.60 |
| main-edit-into-1000-copies         |  153.086 |  94.168 |  0.62 |
| variant-switch-into-copies         |   32.052 |  20.366 |  0.64 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:45 +01:00
alonso.torres
a7ae3140c5 🐛 Keep the children of a copy sized on its own when its main fills
A nested copy made absolute in a copy keeps its own geometry. Its main
was then set to fill a grid and shrank. Sync places the main's children
like the copy: it resized the main to the copy's size, but the grid's
reflow refilled it to its cell, and the move that lines the two up
shifted the copy's children by the difference.

The main's subtree is now resized out of its parent's layout, since the
copy's size is its own and no layout of the main owns it.

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

| world                              | baseline |     now | ratio |
|------------------------------------+----------+---------+-------|
| deepest-edit-through-three-levels  |   35.215 |   18.99 |  0.54 |
| edit-through-a-chain-of-dependents |   68.931 |   37.28 |  0.54 |
| library-update-into-copies         |   83.083 |   49.96 |  0.60 |
| main-edit-among-many-shapes        |    4.837 |   2.233 |  0.46 |
| main-edit-into-10-copies           |     1.79 |   1.017 |  0.57 |
| main-edit-into-100-copies          |   15.415 |   9.558 |  0.62 |
| main-edit-into-1000-copies         |  153.086 |  91.362 |  0.60 |
| variant-switch-into-copies         |   32.052 |  20.725 |  0.65 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:45 +01:00
alonso.torres
6e3c8b1cb2 🐛 Refuse a nest that loops through the main of a held component
A copy whose nested head was switched to another variant was nested into
the main of the component that head's main still holds. The loop check
only compared the components in the moved subtree with the parent
chain, so it let the nest through; a reset then brought the held
component back, and the sync cascade grew the cycle until it gave up.

The check now follows each component the moved shapes hold into its
main, through every level, as sync and reset can bring any of them
back. Moving, pasting and dropping in the layers share it.

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

| world                              | baseline |     now | ratio |
|------------------------------------+----------+---------+-------|
| deepest-edit-through-three-levels  |   35.215 |  19.778 |  0.56 |
| edit-through-a-chain-of-dependents |   68.931 |  39.309 |  0.57 |
| library-update-into-copies         |   83.083 |  49.107 |  0.59 |
| main-edit-among-many-shapes        |    4.837 |   2.271 |  0.47 |
| main-edit-into-10-copies           |     1.79 |   1.001 |  0.56 |
| main-edit-into-100-copies          |   15.415 |   10.29 |  0.67 |
| main-edit-into-1000-copies         |  153.086 | 101.796 |  0.66 |
| variant-switch-into-copies         |   32.052 |   20.72 |  0.65 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:45 +01:00
alonso.torres
fcd9128575 🐛 Leave no override when a shape moved out of a layout loses its margins
A copy in a flex main kept its margin type through a reset, since its
placement belongs to its position. Nesting it out of the layout cleared
its layout-item data, and the relocation marked a margin override,
although the copy now matched its main.

Clearing layout-item data when a shape leaves a layout is a consequence
of the move, not an edit of those attributes, so it marks no override.

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

| world                              | baseline |    now | ratio |
|------------------------------------+----------+--------+-------|
| deepest-edit-through-three-levels  |   35.215 | 18.992 |  0.54 |
| edit-through-a-chain-of-dependents |   68.931 | 39.094 |  0.57 |
| library-update-into-copies         |   83.083 | 46.864 |  0.56 |
| main-edit-among-many-shapes        |    4.837 |  2.236 |  0.46 |
| main-edit-into-10-copies           |     1.79 |  0.941 |  0.53 |
| main-edit-into-100-copies          |   15.415 |  9.524 |  0.62 |
| main-edit-into-1000-copies         |  153.086 | 95.507 |  0.62 |
| variant-switch-into-copies         |   32.052 | 22.002 |  0.69 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:45 +01:00
alonso.torres
a59fcb8b26 🐛 Keep a head switched in a turned main at its first corner
A head in a main turned 45 degrees switched to a wider variant. The new
head was placed at the old one's untransformed top-left and turned about
its own centre, so it landed off the old head's first corner, while its
copies follow the main at their first corner through sync.

The turned new head now moves so its first corner meets the old head's,
the place a turned or flipped swap takes in a copy. Switching and then
turning the main gives the same result as turning and then switching.

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

| world                              | baseline |    now | ratio |
|------------------------------------+----------+--------+-------|
| deepest-edit-through-three-levels  |   35.215 | 20.289 |  0.58 |
| edit-through-a-chain-of-dependents |   68.931 | 39.832 |  0.58 |
| library-update-into-copies         |   83.083 | 45.839 |  0.55 |
| main-edit-among-many-shapes        |    4.837 |  2.079 |  0.43 |
| main-edit-into-10-copies           |     1.79 |  0.933 |  0.52 |
| main-edit-into-100-copies          |   15.415 |  9.056 |  0.59 |
| main-edit-into-1000-copies         |  153.086 | 99.369 |  0.65 |
| variant-switch-into-copies         |   32.052 | 21.489 |  0.67 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:45 +01:00
alonso.torres
fa0ba43c48 🐛 Compare a switched head's orientation with its position in a copy
A nested head whose position in the enclosing main has a geometry
override, such as a resize, switched to a variant whose main is turned.
The switch keeps the old head's orientation, which agrees with its
position, the placement a sync gives a swapped head; but because the
reference chain had a geometry override, the switch compared the kept
orientation with the new main and marked a geometry override that no
later sync needs.

The kept orientation is compared with the new main only when an
orientation override carries: the reference chain has a geometry
override and the old and new variant mains share their orientation.
Otherwise, inside a copy, it is compared with the position.

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

| world                              | baseline |    now | ratio |
|------------------------------------+----------+--------+-------|
| deepest-edit-through-three-levels  |   35.215 | 20.017 |  0.57 |
| edit-through-a-chain-of-dependents |   68.931 | 37.029 |  0.54 |
| library-update-into-copies         |   83.083 | 45.694 |  0.55 |
| main-edit-among-many-shapes        |    4.837 |  2.094 |  0.43 |
| main-edit-into-10-copies           |     1.79 |   0.95 |  0.53 |
| main-edit-into-100-copies          |   15.415 |   9.21 |  0.60 |
| main-edit-into-1000-copies         |  153.086 | 93.672 |  0.61 |
| variant-switch-into-copies         |   32.052 | 20.466 |  0.64 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:45 +01:00
alonso.torres
79b909a0bd 🐛 Keep turned copies and swaps at their first corner
A sync lined up a copy with its main by their untransformed top-left.
Once the main is turned or flipped, a width change moves that point, so
every copy that follows the main drifted about 7 px off the corner the
resize keeps, and a child it overrides left its place. A swapped head of
another size than its position did the same when its board turned: it
was lined up by the untransformed boxes and turned about its own centre.

An untouched copy root turned or flipped like its main now lines up
with it at their first corner, and a swapped head turned like its
position takes its place at that corner, so both turn rigidly with
their board. The oracle resizes an expected turned head about its first
corner in the same way.

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

| world                              | baseline |    now | ratio |
|------------------------------------+----------+--------+-------|
| deepest-edit-through-three-levels  |   35.215 | 18.808 |  0.53 |
| edit-through-a-chain-of-dependents |   68.931 | 38.155 |  0.55 |
| library-update-into-copies         |   83.083 | 46.798 |  0.56 |
| main-edit-among-many-shapes        |    4.837 |  2.193 |  0.45 |
| main-edit-into-10-copies           |     1.79 |  0.962 |  0.54 |
| main-edit-into-100-copies          |   15.415 |  9.315 |  0.60 |
| main-edit-into-1000-copies         |  153.086 | 93.184 |  0.61 |
| variant-switch-into-copies         |   32.052 |  20.55 |  0.64 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:45 +01:00
alonso.torres
e10ce2dba9 🐛 Turn and skew layout children with their layout board
A turned board that fills its flex parent skews, and so does a grid
board it holds. In the layout pass a layout board handed its modifiers
only to its absolute children, so the layout moved the others without
the board's turn or skew: they stayed rigid, while the WASM layout and a
component sync skew them. The layout pass now hands a layout board's
modifiers to all its children, which keep their size along its axes,
and the layout places them from the transformed bounds.

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

| world                              | baseline |     now | ratio |
|------------------------------------+----------+---------+-------|
| deepest-edit-through-three-levels  |   35.215 |  20.425 |  0.58 |
| edit-through-a-chain-of-dependents |   68.931 |  41.077 |  0.60 |
| library-update-into-copies         |   83.083 |  47.075 |  0.57 |
| main-edit-among-many-shapes        |    4.837 |   2.276 |  0.47 |
| main-edit-into-10-copies           |     1.79 |   0.998 |  0.56 |
| main-edit-into-100-copies          |   15.415 |  11.243 |  0.73 |
| main-edit-into-1000-copies         |  153.086 | 109.801 |  0.72 |
| variant-switch-into-copies         |   32.052 |  20.218 |  0.63 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:45 +01:00
alonso.torres
afabcbca3a 🐛 Place grid children by their coordinates along a skewed frame's axes
A turned board that fills its flex parent is skewed, and so is a grid
board it holds. The grid took a child's coordinates along the frame's
axes as dot products with the unit axes and rebuilt points as
h * hv + v * vv, which only holds for perpendicular axes: in a skewed
frame the child landed hundreds of pixels outside the grid, further the
further the frame sat from the page origin. frame_coords solves
p = hv * h + vv * v for any pair of axes.

cargo test --bin render_wasm: 358 tests pass. The component benchmark
covers common sync code, not render-wasm, and is not run.

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:45 +01:00
alonso.torres
bb909e383f 🐛 Measure a reset head's turn after the mirror of its main's parent
A library turns and flips an outer component; a file that has not
accepted it resets a nested head of an unturned copy. The loaded main is
turned onto the copy's parent with the angle between the parents, but
under a mirror apply-transform negates the rotation before adding the
turn: the head and its child got rotation 90 with an identity transform.
The angle is now measured against the parent once transformed, as
orient-like does.

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

| world                              | baseline |     now | ratio |
|------------------------------------+----------+---------+-------|
| deepest-edit-through-three-levels  |   35.215 |  18.135 |  0.51 |
| edit-through-a-chain-of-dependents |   68.931 |  39.807 |  0.58 |
| library-update-into-copies         |   83.083 |  44.721 |  0.54 |
| main-edit-among-many-shapes        |    4.837 |   1.972 |  0.41 |
| main-edit-into-10-copies           |     1.79 |   0.964 |  0.54 |
| main-edit-into-100-copies          |   15.415 |   9.318 |  0.60 |
| main-edit-into-1000-copies         |  153.086 |  90.874 |  0.59 |
| variant-switch-into-copies         |   32.052 |  20.887 |  0.65 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:45 +01:00
alonso.torres
026819056c 🐛 Push a swap into its main without the turn the copy inherits
A nested copy turned with the main that holds it swaps a child, and
update-main pushes that child into its own unturned main. Update-main turns
paired shapes back to the main's orientation, but add-shape-to-main cloned
the pushed child as it was in the copy, so the main took the copy's turn
and its copies turned twice.

A pushed shape and its placement reference now take the same inherited
turn before they are repositioned into the main. The model leaves the
inherited turn out of a pushed swap's geometry likewise.

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

| world                              | baseline |     now | ratio |
|------------------------------------+----------+---------+-------|
| deepest-edit-through-three-levels  |   35.215 |  19.463 |  0.55 |
| edit-through-a-chain-of-dependents |   68.931 |    38.1 |  0.55 |
| library-update-into-copies         |   83.083 |    46.7 |  0.56 |
| main-edit-among-many-shapes        |    4.837 |   2.227 |  0.46 |
| main-edit-into-10-copies           |     1.79 |   1.064 |  0.59 |
| main-edit-into-100-copies          |   15.415 |  10.225 |  0.66 |
| main-edit-into-1000-copies         |  153.086 | 101.264 |  0.66 |
| variant-switch-into-copies         |   32.052 |  20.333 |  0.63 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:45 +01:00
alonso.torres
aa1797e29e 🐛 Drop a copy's grid cells when sync leaves it without a grid
Grid cell overrides carry over only between grids. When a main swapped a
nested grid head for a component without a grid, its copies kept the
cells they authored, now naming a child that was removed. Sync now drops
the cells and their override from a copy it leaves without a grid, and
the model expects the same once the copy has synced.

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

| world                              | baseline |    now | ratio |
|------------------------------------+----------+--------+-------|
| deepest-edit-through-three-levels  |   35.215 |  20.76 |  0.59 |
| edit-through-a-chain-of-dependents |   68.931 |  37.86 |  0.55 |
| library-update-into-copies         |   83.083 | 46.402 |  0.56 |
| main-edit-among-many-shapes        |    4.837 |   2.19 |  0.45 |
| main-edit-into-10-copies           |     1.79 |  0.976 |  0.55 |
| main-edit-into-100-copies          |   15.415 |  9.456 |  0.61 |
| main-edit-into-1000-copies         |  153.086 | 95.647 |  0.62 |
| variant-switch-into-copies         |   32.052 | 20.652 |  0.64 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:45 +01:00
alonso.torres
9664a1ecc6 🐛 Give a reset head back its grid cell when it leaves absolute
A reset clears a copy head's own layout item values after its sync, so a
head made absolute in the copy came back into its parent grid's flow
after the cells had been assigned, and its cell stayed empty until a full
sync. The reset now assigns its grid parent's cells again at its end.

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

| world                              | baseline |    now | ratio |
|------------------------------------+----------+--------+-------|
| deepest-edit-through-three-levels  |   35.215 |   18.5 |  0.53 |
| edit-through-a-chain-of-dependents |   68.931 |  36.37 |  0.53 |
| library-update-into-copies         |   83.083 | 44.588 |  0.54 |
| main-edit-among-many-shapes        |    4.837 |   2.03 |  0.42 |
| main-edit-into-10-copies           |     1.79 |  0.953 |  0.53 |
| main-edit-into-100-copies          |   15.415 |    9.2 |   0.6 |
| main-edit-into-1000-copies         |  153.086 | 91.647 |   0.6 |
| variant-switch-into-copies         |   32.052 | 20.181 |  0.63 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:45 +01:00
alonso.torres
b2757fdbb9 🐛 Carry a copy child's own position when sync moves its parent
A copy child with a geometry override keeps its place inside its parent.
When sync turned or flipped the parent, the child followed, but when sync
only moved it, for instance a nested copy that its main's layout shifted
to make room for a new child, the child stayed where it was and came loose
from its parent. A parent that sync moves without resizing now carries its
whole subtree as well.

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

| world                              | baseline |    now | ratio |
|------------------------------------+----------+--------+-------|
| deepest-edit-through-three-levels  |   35.215 | 18.821 |  0.53 |
| edit-through-a-chain-of-dependents |   68.931 | 37.929 |  0.55 |
| library-update-into-copies         |   83.083 | 48.193 |  0.58 |
| main-edit-among-many-shapes        |    4.837 |   2.06 |  0.43 |
| main-edit-into-10-copies           |     1.79 |  0.959 |  0.54 |
| main-edit-into-100-copies          |   15.415 |   9.24 |   0.6 |
| main-edit-into-1000-copies         |  153.086 | 92.816 |  0.61 |
| variant-switch-into-copies         |   32.052 | 19.519 |  0.61 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:45 +01:00
alonso.torres
91bb316f9d 🐛 Give a copy head shown again by sync back its grid cell
A grid drops the cell of a child that is hidden. When a reset or a sync
showed a hidden copy head again, its parent grid, outside the copy, kept
no cell for it, and the next layout pass failed on the missing cell.
Syncing a head now assigns its parent grid's cells again when it takes
the head in or out of the grid's flow, as showing or hiding a child in
the editor does.

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

| world                              | baseline |    now | ratio |
|------------------------------------+----------+--------+-------|
| deepest-edit-through-three-levels  |   35.215 | 17.937 |  0.51 |
| edit-through-a-chain-of-dependents |   68.931 | 37.042 |  0.54 |
| library-update-into-copies         |   83.083 | 43.279 |  0.52 |
| main-edit-among-many-shapes        |    4.837 |  2.071 |  0.43 |
| main-edit-into-10-copies           |     1.79 |    0.9 |   0.5 |
| main-edit-into-100-copies          |   15.415 |  9.059 |  0.59 |
| main-edit-into-1000-copies         |  153.086 | 89.032 |  0.58 |
| variant-switch-into-copies         |   32.052 | 19.941 |  0.62 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:45 +01:00
alonso.torres
c09fb3d26c 🐛 Keep a copy child made absolute where its layout placed it
A copy child taken out of its layout's flow stays where the layout put
it, which can differ from its main's place when the copy has its own
layout values. Making it absolute now marks its geometry as an override
too, so sync keeps that place instead of moving it to the main's.

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

| world                              | baseline |    now | ratio |
|------------------------------------+----------+--------+-------|
| deepest-edit-through-three-levels  |   35.215 | 18.081 |  0.51 |
| edit-through-a-chain-of-dependents |   68.931 |  35.42 |  0.51 |
| library-update-into-copies         |   83.083 | 45.335 |  0.55 |
| main-edit-among-many-shapes        |    4.837 |    2.3 |  0.48 |
| main-edit-into-10-copies           |     1.79 |  0.905 |  0.51 |
| main-edit-into-100-copies          |   15.415 |  8.714 |  0.57 |
| main-edit-into-1000-copies         |  153.086 | 88.228 |  0.58 |
| variant-switch-into-copies         |   32.052 | 20.752 |  0.65 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:45 +01:00
alonso.torres
3e934593d1 🐛 Keep a copy text's own family's variant of the main's weight
When sync or a switch takes a text's family from one side and its weight
from the other, a run that shows the same weight and style takes the
variant id of the family's side, which names a variant of that family.
A copy that changed a bold text to Roboto kept the main's "bold" after a
sync instead of Roboto's "700", so a second sync was no longer a no-op.
Runs with another weight keep the weight's variant for the frontend to
fix.

The golden master is recorded again: its Roboto copy texts now hold
Roboto's "700", and update-main carries it to the main.

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

| world                              | baseline |   now | ratio |
|------------------------------------+----------+-------+-------|
| deepest-edit-through-three-levels  |   35.215 | 19.955 |  0.57 |
| edit-through-a-chain-of-dependents |   68.931 | 39.875 |  0.58 |
| library-update-into-copies         |   83.083 | 45.419 |  0.55 |
| main-edit-among-many-shapes        |    4.837 |  2.323 |  0.48 |
| main-edit-into-10-copies           |     1.79 |  1.037 |  0.58 |
| main-edit-into-100-copies          |   15.415 |  9.335 |  0.61 |
| main-edit-into-1000-copies         |  153.086 | 97.201 |  0.63 |
| variant-switch-into-copies         |   32.052 | 24.822 |  0.77 |

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:45 +01:00
alonso.torres
72fb4f8d41 🐛 Restore a reset nested copy's inherited layout item values
Layout item values (margins, sizing, alignment) sync from a layout parent to
its children, not as a shape's own attributes. A reset rooted at a nested
copy head therefore never restored the head's own values: one whose margin
type was overridden kept it while the reset cleared its touched groups.

After a reset, give the head its ref's layout child values when its parent
is the copy of the ref's layout parent, the case in which they are
inherited.

A seed 712 large gate (stale library, program 118) found this; it also
fails on earlier commits. The program regression fails before the fix and
passes after it, with undo and redo. Full common passes lint, JVM,
JavaScript and formatting: JVM 2082 tests / 33907 assertions; JavaScript
2018 / 32562. All six component properties pass 40 programs each at seed
712 in both runtimes.

Compare lower-quantile milliseconds with the saved baseline; keep that
baseline unchanged. The machine/JVM warning makes ratios rough. No world
is flagged.

World                      Baseline       Now    Ratio
Main into 10 copies           1.790     0.909     0.51
Main into 100 copies         15.415     8.804     0.57
Main into 1000 copies       153.086    88.560     0.58
Three nesting levels         35.215    18.272     0.52
Dependency chain             68.931    35.558     0.52
Library update               83.083    45.079     0.54
Many plain shapes             4.837     2.104     0.43
Variant switch               32.052    19.574     0.61

AI-assisted-by: claude-opus-5-5
2026-11-18 10:29:45 +01:00