Commit graph

2 commits

Author SHA1 Message Date
Danila Poyarkov 6a9b69f677
fix: keep bound text and visibility in step with their variables (#954)
* fix: keep bound text and visibility in step with their variables

Text bound to a string variable was resolved only when a .fig file was read, and visibility bound to a boolean never, so editing the value or switching a mode left them showing the old one. The binding reconcile, renamed reconcileVariableBindings, now resolves text and visibility with numbers, scoped the same way, and .fig export writes them resolved in each collection's default mode. A bound font family is left as stored, since changing it needs the font loaded.

* fix: keep text and visibility an instance overrides over their bindings

Typing in a bound layer inside an instance or toggling its eye records an override but keeps the binding, so the next value edit or mode switch replaced what was typed or hidden. An overridden text or visibility now keeps its value, as an overridden width or height does.
2026-10-07 18:37:15 +00:00
Danila Poyarkov e8b5d75339
perf: scope variable changes to what they can reach (#935)
* perf: resolve only the layers a variable change can reach

Every value edit, mode change, and binding change re-resolved every bound layer in the document. A value or mode change now reaches the layers bound to its variables or to variables aliasing them, and a binding or variable-mode change reaches the layer's own subtree, so layers elsewhere whose saved values differ from their bindings stay as saved and are not laid out again.

* perf: keep the canvas as drawn when a variable change shows nothing on it

Every variable change bumped sceneVersion, which also keys the canvas's recorded pictures, so renaming or reordering a variable re-recorded every visible layer. The canvas now redraws on its own canvasVersion, which requestRender bumps; requestRefresh bumps only sceneVersion, so views, saving, and recovery still follow. Adding, renaming, reordering, and duplicating variables and collections, renaming modes, and token fields, conditions, and the switch attribute use it.

* test: give the text undo editor double requestRefresh

The double builds EditorContext by hand and missed the new requestRefresh and canvasVersion, which failed check:test-types in the merge queue.
2026-10-07 11:32:18 +00:00