Skip to content

AI-native design editor. Open-source Figma alternative.

fix(kiwi): preserve imported derived text data

Danila Poyarkov22280cc75875
diff --git a/packages/core/src/kiwi/fig/node-change/export-node.ts b/packages/core/src/kiwi/fig/node-change/export-node.ts
index c67a19d14..34fc82235 100644
--- a/packages/core/src/kiwi/fig/node-change/export-node.ts
+++ b/packages/core/src/kiwi/fig/node-change/export-node.ts
@@ -342,6 +342,10 @@ function applyRawFigmaNodeFields(
;(nc as Record<string, unknown>)[key] = converted
continue
}
+ if (key === 'derivedTextData' && node.source.id) {
+ ;(nc as Record<string, unknown>)[key] = materialized[key]
+ continue
+ }
// Skip any key already set on nc — explicit serialization takes priority
if (key in (nc as Record<string, unknown>)) continue
;(nc as Record<string, unknown>)[key] = materialized[key]
diff --git a/tests/engine/io/fig/roundtrip/exhaustive.test.ts b/tests/engine/io/fig/roundtrip/exhaustive.test.ts
index e44dea006..13956d00b 100644
--- a/tests/engine/io/fig/roundtrip/exhaustive.test.ts
+++ b/tests/engine/io/fig/roundtrip/exhaustive.test.ts
@@ -61,8 +61,8 @@ const SPECS: FixtureSpec[] = [
thumbnailHeight: 239,
imageCount: 3,
figKiwiVersion: 101,
- g1ExportSize: 595922,
- g2ExportSize: 595922
+ g1ExportSize: 594522,
+ g2ExportSize: 594522
}
]
@@ -588,9 +588,6 @@ function verifyFixture(spec: FixtureSpec): void {
test.todo(
'BUG: corner radius 999 sentinel lost for non-pill nodes on scene import (40 nodes, raw data preserved)'
)
- test.todo(
- 'BUG: derivedTextData baseline precision differs from raw (14 instances, font metrics)'
- )
})
}