openpencil/tests/engine
Joseph Cumines c4073dc284 fix(kiwi): repair .fig roundtrip - missing nodes, schema mismatch, GUID collisions
Exporting a .fig from OpenPencil and reimporting lost most nodes
(38323 to 57 on gold-preview.fig) and the same files wouldn't open
in Figma. gold-preview.fig now roundtrips into Figma. I haven't
traced each symptom to a specific fix with confidence, but the
changes address the underlying causes:

- fractionalPosition overflow past 94 siblings produced characters
  outside Figma's printable ASCII range (33-126); gold-preview.fig
  has nodes with 492 children so this hit immediately. New telescoping
  ~-prefix scheme matches Figma's own encoding.
- re-export used OpenPencil's subset kiwi schema, likely producing
  field IDs misaligned with the embedded schema. Preserve and use
  the original schema (graph.figSchemaDeflated) instead.
- variable GUIDs assigned before canvas entries could collide with
  source.id-derived canvas GUIDs. Reversed the order, scan all
  imported GUIDs to advance the counter.
- auto-layout child sort ignored parentIndex.position, using only
  transform position which may not reflect original tree order for
  imported nodes. Sort by position first, transform as tiebreaker.
- Object.assign of rawNodeFields overwrote explicit serialization.
  Materialize with paint variables, apply blocklist, skip keys
  already set on nc.

Also fixes: strokeWeight defaulting on strokeless nodes, colorVar
assetRef to guid conversion, per-corner radii emission, textAlignVertical
hardcoding, textAutoResize override for imported nodes, stackReverseZIndex
roundtrip, variable key/version preservation, blendMode on effects,
textCase emission.

Adds exhaustive roundtrip test comparing G0 to G1 to G2 across schema
bytes, node count, tree paths, scene props, and raw node fields.
2026-05-24 18:29:14 +10:00
..
acp chore: enable stricter oxlint rules 2026-05-18 18:58:30 +03:00
app fix(ai): allow custom OpenRouter models 2026-05-19 15:10:32 +03:00
cli chore: enable stricter oxlint rules 2026-05-18 18:58:30 +03:00
clipboard fix(fig): stabilize engine test suite 2026-05-21 14:54:17 +03:00
color test(engine): move root tests into domains 2026-05-16 12:30:27 +03:00
editor refactor(kiwi): group fig format internals 2026-05-21 14:54:13 +03:00
figma/api feat(text): wrap styled outline text 2026-05-17 20:23:55 +03:00
geometry fix(fig): propagate cloned component property overrides 2026-05-20 12:29:51 +03:00
hit-test chore(tests): enforce non-null assertion rule 2026-05-06 11:44:18 +03:00
icons test(engine): move root tests into domains 2026-05-16 12:30:27 +03:00
io fix(kiwi): repair .fig roundtrip - missing nodes, schema mismatch, GUID collisions 2026-05-24 18:29:14 +10:00
kiwi fix(fig): stabilize engine test suite 2026-05-21 14:54:17 +03:00
layout fix(fig): preserve imported instance layout sync 2026-05-18 18:21:27 +03:00
lint test(engine): move root tests into domains 2026-05-16 12:30:27 +03:00
mcp test(mcp): cover websocket routing edge cases 2026-05-19 15:55:52 +03:00
pen chore(tests): narrow no-empty-function exceptions 2026-05-06 12:32:54 +03:00
profiler chore: enable stricter oxlint rules 2026-05-18 18:58:30 +03:00
random test(engine): move root tests into domains 2026-05-16 12:30:27 +03:00
render fix(canvas): preserve text OpenType toggles 2026-05-23 01:43:00 +03:00
scene-graph test(engine): split mutation coverage by domain 2026-05-16 12:51:43 +03:00
snap test(engine): move root tests into domains 2026-05-16 12:30:27 +03:00
tauri fix(fig): stabilize engine test suite 2026-05-21 14:54:17 +03:00
text fix(vue): ignore click jitter before moving selection 2026-05-21 14:54:10 +03:00
tools fix(mcp): improve agent-rendered JSX 2026-05-19 17:57:43 +03:00
vector refactor(vue): centralize canvas menu groups 2026-05-17 14:09:52 +03:00
vue fix(editor): preserve edits over imported metadata 2026-05-21 14:54:17 +03:00
perf.bench.ts chore: enable stricter oxlint rules 2026-05-18 18:58:30 +03:00