mirror of
https://github.com/penpot/penpot.git
synced 2026-11-21 01:22:01 +00:00
Undoing the creation of a component removed it from the file. A copy another file had made of it in the meantime, as a consumer of a library can after a variant is added there, then pointed at a component that did not exist: the file failed validation, and the copy could not find its main shapes or be restored. Undoing the creation now marks the component deleted and keeps its main's shapes in it, as deleting it does; redoing it adds it again. The undo and redo checks of the component tests compare files without their deleted components, since an undone creation leaves one where there was none. Benchmark (scripts/bench-components, ms, lower 2.5% quantile): | world | baseline | now | ratio | |------------------------------------+----------+---------+-------| | deepest-edit-through-three-levels | 35.215 | 19.745 | 0.56 | | edit-through-a-chain-of-dependents | 68.931 | 37.914 | 0.55 | | library-update-into-copies | 83.083 | 48.026 | 0.58 | | main-edit-among-many-shapes | 4.837 | 1.944 | 0.40 | | main-edit-into-10-copies | 1.790 | 1.047 | 0.58 | | main-edit-into-100-copies | 15.415 | 10.179 | 0.66 | | main-edit-into-1000-copies | 153.086 | 91.854 | 0.60 | | variant-switch-into-copies | 32.052 | 21.546 | 0.67 | AI-assisted-by: claude-opus-5-5