Commit graph

128 commits

Author SHA1 Message Date
Danila Poyarkov 6ee0e5f9e8 fix(kiwi): preserve imported boolean geometry 2026-05-31 13:28:41 +03:00
Danila Poyarkov 883782846f docs(cli): use released openpencil command 2026-05-29 15:56:52 +03:00
Danila Poyarkov ef1ef0c9b1 test(kiwi): use public schema runtime export 2026-05-28 15:15:40 +03:00
Danila Poyarkov 6ae425ee3b fix(core): address compatibility review findings 2026-05-28 09:57:46 +03:00
Danila Poyarkov 5fcd8e0e9c fix(canvas): support stretched layout grids 2026-05-28 05:39:40 +03:00
Danila Poyarkov 64e8b21949 fix(canvas): render imported page guides 2026-05-27 19:00:23 +03:00
Danila Poyarkov 711106518e test(kiwi): record raw metadata oracle 2026-05-27 15:37:14 +03:00
Danila Poyarkov da537c05a7 test(canvas): summarize pattern oracle deltas 2026-05-27 14:25:10 +03:00
Danila Poyarkov ca775f05c1 test(kiwi): cover raw metadata preservation 2026-05-27 14:17:20 +03:00
Danila Poyarkov f67c6c78c7 test(kiwi): record pattern alignment oracle 2026-05-27 13:21:44 +03:00
Danila Poyarkov 82eec28b3f test(kiwi): cover raw effect invalidation 2026-05-27 10:53:13 +03:00
Danila Poyarkov fa6e97b24b fix(kiwi): preserve unsupported effect payloads 2026-05-27 10:27:02 +03:00
Danila Poyarkov 5c6808e219 test(kiwi): record Figma noise effect payloads 2026-05-27 02:56:05 +03:00
Danila Poyarkov 16e523380b test(canvas): tighten pattern visual oracle 2026-05-26 21:12:57 +03:00
Danila Poyarkov c1532610db fix(canvas): tighten Figma text and pattern fidelity 2026-05-26 18:30:08 +03:00
Danila Poyarkov d208cc326e fix(canvas): render Figma pattern fills 2026-05-26 17:33:45 +03:00
Danila Poyarkov 63f391d694 test(kiwi): add Figma mask oracle coverage 2026-05-26 16:34:33 +03:00
Danila Poyarkov 3348115a04 test(kiwi): record pattern paint oracle gap 2026-05-26 16:24:55 +03:00
Danila Poyarkov 1e1d78c7f6 fix(canvas): render Figma leading trim 2026-05-26 16:23:59 +03:00
Danila Poyarkov 3ea310d092 fix(io): preserve imported canvas background paints 2026-05-26 16:00:50 +03:00
Danila Poyarkov 3e1a37d34d fix(kiwi): preserve mask outline metadata 2026-05-26 15:44:35 +03:00
Danila Poyarkov c2a0de5f0c fix(kiwi): support Figma OpenType variant fields 2026-05-26 15:14:23 +03:00
Danila Poyarkov a53ab45e86 fix(kiwi): use Figma mask schema fields 2026-05-26 14:53:23 +03:00
Danila Poyarkov 80daa0d1e9 fix(canvas): render Figma text decoration styles 2026-05-26 13:22:56 +03:00
Danila Poyarkov f77f58e2f6 fix(kiwi): support raw OpenType toggles 2026-05-26 12:01:03 +03:00
Danila Poyarkov 4cd187c766 fix(kiwi): preserve more Figma metadata 2026-05-26 11:57:13 +03:00
Danila Poyarkov e31234a0ed test(kiwi): audit fig schema coverage 2026-05-26 11:33:52 +03:00
Danila Poyarkov a79d671873 fix(kiwi): preserve pattern spacing 2026-05-25 10:23:19 +03:00
Danila Poyarkov 75412ed59f fix(kiwi): preserve rich text schema metadata 2026-05-25 09:19:46 +03:00
Danila Poyarkov 84cf18ba80 fix(kiwi): preserve schema paint fields 2026-05-25 09:19:25 +03:00
Danila Poyarkov 1ed7de6056 chore(lint): reject broad unknown type assertions
- Add AST-based lint checks for broad unknown object assertions and local JsonObject aliases
- Centralize JsonObject in core and package-local MCP RPC JSON typing
- Replace baseline Record<string, unknown> assertions with named shared/domain types
2026-05-25 00:26:02 +03:00
Danila Poyarkov b4dfd90da0 fix(kiwi): resolve variable radius overrides
- Resolve numeric variable aliases in symbol override radius fields
- Preserve imported 999 corner sentinels through G0 to G1 roundtrips
- Remove the resolved corner-radius roundtrip TODO
2026-05-24 23:46:29 +03:00
Danila Poyarkov 22280cc758 fix(kiwi): preserve imported derived text data
- Prefer raw derivedTextData for imported Figma nodes during export
- Keep G1 exports idempotent with preserved text glyph and baseline payloads
- Remove the resolved derivedTextData roundtrip TODO
2026-05-24 22:27:31 +03:00
Danila Poyarkov 8a10552c94 test(kiwi): verify component prop roundtrips
- Add semantic raw verifier for componentPropDefs
- Keep derived text raw checks focused on stable metadata
- Split raw verifier helpers to keep roundtrip test utilities small
2026-05-24 19:39:39 +03:00
Danila Poyarkov 35db955cb9 fix(kiwi): improve fig roundtrip fidelity
- Refresh the bundled Figma Kiwi schema from a newer embedded schema
- Preserve additional raw node fields and omitted imported stack sizing
- Tighten idempotent roundtrip checks while documenting known G0 import gaps
2026-05-24 19:27:19 +03:00
Joseph Cumines bfe1b63299 fix(formatting) 2026-05-24 21:10:27 +10:00
Joseph Cumines 2a6c455464 Merge remote-tracking branch 'upstream/HEAD' into fix/fig-roundtrip-fidelity 2026-05-24 21:09:42 +10:00
Danila Poyarkov abd795bd9a chore: format codebase 2026-05-24 12:15:29 +03:00
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
Danila Poyarkov c337905a02 fix(canvas): preserve text OpenType toggles 2026-05-23 01:43:00 +03:00
Danila Poyarkov 054199ac15 fix(kiwi): preserve edited font variation axes 2026-05-23 00:26:58 +03:00
Danila Poyarkov 8c85d2b953 fix(canvas): improve Figma mask and text fidelity 2026-05-23 00:18:33 +03:00
Danila Poyarkov 3dc0904466 fix(canvas): support luminance masks and tile transforms 2026-05-22 23:44:10 +03:00
Danila Poyarkov 24ac31d4ab fix(fig): restore lazy badge visibility overrides 2026-05-21 14:54:18 +03:00
Danila Poyarkov da9dbbb9c6 fix(editor): preserve edits over imported metadata 2026-05-21 14:54:17 +03:00
Danila Poyarkov b5451c354f fix(fig): preserve kiwi version in export worker 2026-05-21 14:54:17 +03:00
Danila Poyarkov a48b23129f fix(fig): stabilize engine test suite 2026-05-21 14:54:17 +03:00
Danila Poyarkov dfea52475c test(fig): cover source metadata roundtrips 2026-05-21 14:54:17 +03:00
Danila Poyarkov 213db6373a refactor(kiwi): group fig format internals
- Move codec, NodeChange conversion, and instance overrides under kiwi/fig
- Flatten the codec entrypoint to kiwi/fig/codec
- Keep schema-runtime as the generic Kiwi parser/compiler boundary
2026-05-21 14:54:13 +03:00
Danila Poyarkov 54310308dc refactor(kiwi): split schema text from runtime
- Move the Kiwi runtime under schema-runtime to match folder naming
- Load the Figma schema from a .kiwi text asset with static validation
- Assert Figma clipboard-derived field numbers for fragile layout/text fields
2026-05-21 14:54:12 +03:00
Danila Poyarkov 68ebef5f9b fix(fig): omit populated instance children on export
- Match Figma files where INSTANCE node changes carry symbol refs, not child nodes
- Prevent exported roundtrips from expanding every populated instance subtree
- Tighten glyph blob preservation now that instance children are omitted
2026-05-21 14:54:11 +03:00
Danila Poyarkov c1ddbf7039 fix(fig): deduplicate exported text glyph blobs
- Preserve imported Figma glyph outlines for fallback rendering
- Reuse identical glyph command blobs across exported text nodes
- Cover real fixture preservation and generated glyph deduplication
2026-05-21 14:54:10 +03:00
Danila Poyarkov e6da2736fe fix(fig): sync lazy link component overrides
- Carry resolved text styling and glyph data through component-property text clones
- Align lazy cloned child placement and hidden chevrons with their resolved source
- Cover the gold-preview dropzone link lazy import regression
2026-05-20 15:02:01 +03:00
Danila Poyarkov 957db338ba fix(fig): sync lazy instance override clones
- Re-propagate resolved overrides after lazy instance population
- Preserve Figma showShadowBehindNode on effects
- Mask unfilled stroke shadows behind their fill geometry
2026-05-20 13:12:16 +03:00
Danila Poyarkov 82fc5fb7bb fix(fig): propagate cloned component property overrides
- Resolve component-property refs through override keys on cloned children
- Apply instance component-property assignments through clone chains
- Use child shadow shapes for containers without visible fills
- Keep clipped export bounds from leaking hidden descendants
2026-05-20 12:29:51 +03:00
Danila Poyarkov a22d39210c fix(fig): populate lazy pages before export 2026-05-19 21:01:17 +03:00
Danila Poyarkov c11d65fe55 Revert "Revert "fix(fig): preserve OpenPencil round trips""
This reverts commit 9ce6096fc1.
2026-05-19 00:23:23 +03:00
Danila Poyarkov 9ce6096fc1 Revert "fix(fig): preserve OpenPencil round trips"
This reverts commit 5ef8bbd93d.
2026-05-19 00:20:47 +03:00
Danila Poyarkov 5ef8bbd93d fix(fig): preserve OpenPencil round trips 2026-05-19 00:16:41 +03:00
Danila Poyarkov f3649550f2 chore: enable stricter oxlint rules 2026-05-18 18:58:30 +03:00
Danila Poyarkov edf28f3659 fix(fig): scale instance stroke weights 2026-05-18 03:11:47 +03:00
Danila Poyarkov 2d011580f0 fix(fig): scale instance stroke weights 2026-05-18 02:47:05 +03:00
Danila Poyarkov 1de4f65767 fix(fig): propagate derived text glyphs 2026-05-18 02:35:33 +03:00
Danila Poyarkov 773b1539d2 fix(fig): prefer shared stroke styles 2026-05-18 02:30:37 +03:00
Danila Poyarkov ea04a007d3 test(fig): cover derived glyph override patches 2026-05-18 01:33:23 +03:00
Danila Poyarkov 142a973193 fix(fig): render imported text from derived glyphs 2026-05-18 01:17:34 +03:00
Danila Poyarkov 35eb749b70 test(fig): cover field-level override protection 2026-05-18 00:37:56 +03:00
Danila Poyarkov a441e1778b fix(fig): preserve swapped icon stroke styles 2026-05-17 23:49:24 +03:00
Danila Poyarkov 4234cf3b33 fix(fig): apply shared fill styles 2026-05-17 23:31:28 +03:00
Danila Poyarkov 5e782b2850 fix(fig): propagate nested icon swaps 2026-05-17 23:25:09 +03:00
Danila Poyarkov 4d758f26cb fix(fig): apply shared text styles 2026-05-17 23:02:20 +03:00
Danila Poyarkov ff0f072aef fix(fig): use derived text line metrics 2026-05-17 22:49:12 +03:00
Danila Poyarkov 2072f2e916 fix(fig): apply text component props 2026-05-17 22:40:30 +03:00
Danila Poyarkov bb6c537b8e Merge master into image fill hash fix 2026-05-17 13:02:00 +03:00
Danila Poyarkov bf636155cf test(engine): stabilize render and heavy fig tests 2026-05-16 13:39:45 +03:00
Danila Poyarkov ab700fd8be test(engine): stabilize full engine smoke 2026-05-16 13:27:46 +03:00
Danila Poyarkov 39acdd82c7 test(engine): split image coverage by domain 2026-05-16 12:38:00 +03:00
Danila Poyarkov a710841392 test(engine): align io tests with source tree 2026-05-16 11:59:02 +03:00