openpencil/packages/fig/src/instance-overrides
Danila Poyarkov 2bb43c85dc
fix(fig): keep the sizes Figma derived for instance layers when a page loads (#951)
* fix(fig): keep the sizes Figma derived for instance layers when a page loads

Loading a page resynced every component its new instances used, which copied component sizes over the sizes Figma derived for instance layers on earlier pages, and over those of the page's own new instances. A text field filling a 312px instance came back at its component's 210px.

The page now syncs only the instances it placed, through a new SceneGraph.syncInstance, and then puts back the sizes Figma derived for them unless that component layer's size was edited live. The gold input now matches the captured Figma Content width (374.86 instead of 633.69), and its placeholder matches the 97.51 x 39.38 Figma derived in the file.

* fix(fig): keep live edits to mapped component layers over derived sizes

restoreDerivedSizes checked only a layer's own component for live edits. A
nested instance clone syncs from the layer its owning instance maps it to
through sourceComponentId, so a live width edit to that layer was carried
over by the sync and then replaced by the size Figma derived. The restore
now reads the same source layers as reconcileLiveComponentEdits, through a
shared syncSourceLayers helper.
2026-10-07 20:57:55 +00:00
..
bindings fix(fig): read, render, and write Figma slots (#850) 2026-10-04 00:45:10 +04:00
occurrence fix(fig): read, render, and write Figma slots (#850) 2026-10-04 00:45:10 +04:00
scale fix(fig): read, render, and write Figma slots (#850) 2026-10-04 00:45:10 +04:00
component-closure.ts fix(fig): read, render, and write Figma slots (#850) 2026-10-04 00:45:10 +04:00
derived-symbol-data.ts fix(fig): read, render, and write Figma slots (#850) 2026-10-04 00:45:10 +04:00
fields.ts feat(fig): occurrence-scoped instance interpretation as the single .fig reader 2026-10-01 11:20:27 +04:00
index.ts refactor(fig): export the symbol readers and move the library tests home (#929) 2026-10-06 10:44:22 +00:00
interpret.ts fix(fig): read, render, and write Figma slots (#850) 2026-10-04 00:45:10 +04:00
layers.ts fix(fig): read, render, and write Figma slots (#850) 2026-10-04 00:45:10 +04:00
live-component-edits.ts fix(fig): keep the sizes Figma derived for instance layers when a page loads (#951) 2026-10-07 20:57:55 +00:00
materialize-instance.ts fix(fig): keep Figma's order keys on instances and untouched siblings (#819) 2026-10-04 10:16:01 +00:00
resize.ts fix(fig): read, render, and write Figma slots (#850) 2026-10-04 00:45:10 +04:00
source-children.ts fix(fig): read, render, and write Figma slots (#850) 2026-10-04 00:45:10 +04:00
source-index.ts feat(fig): occurrence-scoped instance interpretation as the single .fig reader 2026-10-01 11:20:27 +04:00
text-provenance.ts feat(fig): occurrence-scoped instance interpretation as the single .fig reader 2026-10-01 11:20:27 +04:00
tree.ts feat(fig): occurrence-scoped instance interpretation as the single .fig reader 2026-10-01 11:20:27 +04:00
types.ts fix(fig): read, render, and write Figma slots (#850) 2026-10-04 00:45:10 +04:00