openpencil/tests/engine
Danila Poyarkov 5146e7f7e5
fix(fig): keep variable metadata, plugin data and default mode on save (#848)
* fix(fig): keep variable metadata, plugin data and default mode on save

Saving a .fig rebuilt every variable record from the model, which held none
of Figma's variable metadata, so each save wrote variables as published to
all scopes with no description or code names, dropped other plugins' data,
and made the first mode the default.

Variables now carry scopes, codeSyntax and pluginData, collections carry
pluginData, and the reader and writer translate description,
symbolDescription, isPublishable, variableScopes and codeSyntax. Figma has
no default-mode field, so setting a default moves that mode first (undo
restores the order) and the writer orders the default first.

This is the base for design tokens: the CSS name will live in
codeSyntax.WEB and unit and mode conditions in OpenPencil plugin data.

* refactor(scene-graph): share the default-first mode order

setDefaultMode and the .fig writer both moved the default mode first by
hand; modesDefaultFirst does it once, with es-toolkit's partition.

* fix(core): undo a default mode change on the collection currently in the graph

Undoing a collection's removal restores a copy of it, so the inverse of
setDefaultMode wrote the previous order and default to an object the
graph no longer held when both were undone. Look the collection up by id
when undoing, as the forward step already does.
2026-10-04 12:53:04 +04:00
..
acp
app feat(ai): render tool calls as summarized, highlighted cards (#811) 2026-10-03 22:04:31 +04:00
cli feat(fig): occurrence-scoped instance interpretation as the single .fig reader 2026-10-01 11:20:27 +04:00
clipboard fix(fig): read, render, and write Figma slots (#850) 2026-10-04 00:45:10 +04:00
collab Release v0.15.0 2026-09-16 17:57:35 +03:00
color refactor!: move shared primitives below dom-css and core (#771) 2026-09-26 11:39:11 +04:00
core feat(fig): occurrence-scoped instance interpretation as the single .fig reader 2026-10-01 11:20:27 +04:00
dom-css
figma/api feat(fig): occurrence-scoped instance interpretation as the single .fig reader 2026-10-01 11:20:27 +04:00
geometry feat(editor): checkpoint live interaction improvements 2026-09-15 11:36:17 +03:00
hit-test perf(scene-graph): accelerate axis-aligned hit tests (#534) 2026-08-16 15:43:25 +03:00
icons fix(core): preserve inline SVG primitives (#485) 2026-08-12 16:02:45 +03:00
io fix(fig): keep variable metadata, plugin data and default mode on save (#848) 2026-10-04 12:53:04 +04:00
kiwi feat(fig): occurrence-scoped instance interpretation as the single .fig reader 2026-10-01 11:20:27 +04:00
layout test: fix heavy unit-test measurement and round-trip checks (#655) 2026-09-07 00:33:12 +03:00
library build: upgrade oxfmt and format Vue imports (#669) 2026-09-10 02:45:13 +03:00
lint test: migrate Scene Graph tests into the package and gate new tests/engine files (#790) 2026-09-30 04:53:28 +04:00
mcp fix(MCP): add read-only file lifecycle tools (#722) 2026-09-18 11:55:06 +03:00
pen feat: export components as Storybook stories (#751) 2026-09-30 03:16:47 +04:00
profiler
random
render refactor: print OpenPencil JSX export as syntax trees (#799) 2026-10-01 21:22:43 +04:00
snap
tauri fix(fonts): explain PingFang substitution and draw its CJK text (#781) 2026-09-26 11:14:30 +04:00
text fix(text): render variable font styles at their named instances (#773) 2026-09-26 11:25:01 +04:00
tools feat(ai): show what each AI edit changed in its tool call (#812) 2026-10-03 23:32:37 +04:00
vector feat(canvas): render arrow stroke caps on lines and open vectors 2026-08-31 21:25:38 +03:00
vue fix: convert document colour profiles, keep text edits live, and fix .fig exports (#716) 2026-09-18 00:43:10 +03:00
perf.bench.ts