M6: preserve FigJam sticky and shape content on import (#1341)

This commit is contained in:
Filip Strajnar
2026-10-26 21:52:09 +01:00
parent 740d117313
commit 4e650a1c01
7 changed files with 309 additions and 20 deletions
+3 -1
View File
@@ -2,7 +2,7 @@
**Stage: alpha** · next: beta, ~26 points and ~162–292 h away (one Opus 5.5 agent; ~33–67 h wall-clock with 5 agents)
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-26 · **Change:** minor (colour picker LCH and OKLCH models; non-ASCII layer names transliterate in code export (#1235); branches in live sessions and branch history entries, gap 17; plugin widgets take text input and a property menu (plugin API 4); boards: templates and tables; boards: a shared timer and voting sessions; boards: the dot grid, connector ends dragged to re-attach, curved connectors; Installed weights of an embedded font family (#1246); `.sketch` import, best effort (Sketch 48 and newer); CJK line breaking: JIS X 4051's line-start and line-end sets completed with the halfwidth small kana, the halfwidth and spacing (semi-)voiced sound marks, the iteration marks 〱–〵 and the halfwidth parentheses, with behaviour cases for each; Adobe Fonts found on macOS (#298); egui 0.37 hidden-capture deadline contract; Dev Mode measurements kept on the canvas and a read-only layers panel; boards: a board area row and progress entry; community fixes in #507, #510, #529 and #530: auto-save, a text box by dragging, batch step references, removing someone from a live session, Russian and Turkish catalogs reviewed, Czech and Indonesian drafts, the Japanese draft completed, zoom previews, the web clipboard, Alt-drag snapping and Cmd+D repeat, recovery copies, crash and rollback fixes, colour emoji, `.fig` import fixes; earlier changes are in the revision history below) · **Target:** Figma Design (desktop app 126.10.7)
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-26 · **Change:** minor (FigJam generated sticky and shape backgrounds and text (#1341); colour picker LCH and OKLCH models; non-ASCII layer names transliterate in code export (#1235); branches in live sessions and branch history entries, gap 17; plugin widgets take text input and a property menu (plugin API 4); boards: templates and tables; boards: a shared timer and voting sessions; boards: the dot grid, connector ends dragged to re-attach, curved connectors; Installed weights of an embedded font family (#1246); `.sketch` import, best effort (Sketch 48 and newer); CJK line breaking: JIS X 4051's line-start and line-end sets completed with the halfwidth small kana, the halfwidth and spacing (semi-)voiced sound marks, the iteration marks 〱–〵 and the halfwidth parentheses, with behaviour cases for each; Adobe Fonts found on macOS (#298); egui 0.37 hidden-capture deadline contract; Dev Mode measurements kept on the canvas and a read-only layers panel; boards: a board area row and progress entry; community fixes in #507, #510, #529 and #530: auto-save, a text box by dragging, batch step references, removing someone from a live session, Russian and Turkish catalogs reviewed, Czech and Indonesian drafts, the Japanese draft completed, zoom previews, the web clipboard, Alt-drag snapping and Cmd+D repeat, recovery copies, crash and rollback fixes, colour emoji, `.fig` import fixes; earlier changes are in the revision history below) · **Target:** Figma Design (desktop app 126.10.7)
FigCraft is a clean-room, open-source, pure-Rust reimplementation of the Figma design workflow,
native on macOS, Windows, Linux and FreeBSD and in the browser, fully drivable by agents through
@@ -132,6 +132,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md).
## Progress log
- **2026-10-26** · M6, #1341: FigJam generated sticky notes and shapes with text (#1341): backgrounds, text with its typography and paints, saved bounds and sticky author lines import as editable frame children; synthetic regressions and a local check of the report sample; native board metadata and direct `.jam` opening remain outside this fix. Numbers unchanged.
- **2026-10-26** · Non-ASCII layer names transliterate in code export (M6, #1235): `class_name` runs the name through `deunicode` before its ASCII filter, so 로그인 화면 → `rogeuin-hwamyeon`, кнопка → `knopka`, über → `uber` in the HTML/CSS/React/Leptos class names, component roots and `data-*` variant attributes (SwiftUI/Compose type names unchanged); a name left with nothing (symbols only) takes the node's kind (`.text`, `.frame`) instead of `layer-`, and the 40-character cut lands on a word boundary. New dependency: deunicode (pure Rust tables, zero deps, BSD-3-Clause, the `slug` crate's base). `html_codegen_tests`. Numbers unchanged.
- **2026-10-25** · egui 0.37 capture lifecycle: screenshots with hidden or unknown visibility queue, request a hidden paint, and expire after 60 seconds if no capture arrives (headless-tested contract). Logic-only edits, saves and inspection continue while hidden. Native visible GUI and forced hidden-window paint, browser and Wayland behavior remain unqualified; parity percentages are unchanged.
- **2026-10-24** · Open, Save and the folder dialogs start in the folder of the last file or folder picked in the run (#1290): the Linux portal does not remember it between dialogs as the macOS and Windows panels do. A folder deleted since falls back to the system's choice. No numbers change.
@@ -348,6 +349,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md).
| Date | Change | Summary |
|---|---|---|
| 2026-10-26 | minor | FigJam generated sticky notes and shapes with text (#1341): backgrounds, text with its typography and paints, saved bounds and sticky author lines import as editable frame children; synthetic regressions and a local check of the report sample; native board metadata and direct `.jam` opening remain outside this fix. Numbers unchanged. |
| 2026-10-26 | minor | Non-ASCII layer names transliterate in code export (M6, #1235): `class_name` transliterates through the new `deunicode` dependency (pure Rust tables, zero deps, BSD-3-Clause), so Korean, Cyrillic, Latin-diacritic and CJK names become readable ASCII classes (`rogeuin-hwamyeon`, `knopka`, `uber`, `an-niu`) in HTML/CSS/React/Leptos output, component roots and `data-*` variant attributes; symbols-only names take the node's kind (`.text`) instead of `layer-`, and the 40-character cut lands on a word boundary. `html_codegen_tests` updated and extended. Numbers unchanged |
| 2026-10-25 | minor | egui 0.37 capture lifecycle: screenshots with hidden or unknown visibility queue, request a hidden paint, and expire after 60 seconds if no capture arrives (headless-tested contract). Logic-only edits, saves and inspection continue while hidden. Native visible GUI and forced hidden-window paint, browser and Wayland behavior remain unqualified; parity percentages are unchanged. |
| 2026-10-24 | minor | Server memory (#1134): when the last person leaves a file nobody edited, figcraft-server keeps the client ids it issued in the log instead of rewriting the snapshot (compaction still follows `compact_after`/`compact_mb` and edits), and a snapshot is encoded straight into its file buffer, without a second copy of the body; the file format is unchanged. Numbers unchanged |
+204
View File
@@ -0,0 +1,204 @@
//! FigJam generated layers (#1341). All document content and outlines are synthetic.
use super::*;
fn board_schema() -> Schema {
Schema::parse(&SCHEMA.replace(
"\nmessage Blob ",
", GeneratedData nodeGenerationData, GeneratedData derivedImmutableFrameData, string textAlignHorizontal, string textAlignVertical\nmessage GeneratedData NodeChange[] overrides, uint version\nmessage Blob ",
))
.unwrap()
}
fn record(id: u64, mut fields: Vec<(&'static str, Kv<'static>)>) -> Kv<'static> {
fields.push(("guidPath", o(vec![("guids", arr(vec![o(vec![("sessionID", u(40_000_000)), ("localID", u(id))])]))])));
o(fields)
}
fn text(chars: &str, size: f64) -> Vec<(&'static str, Kv<'static>)> {
vec![
(
"textData",
o(vec![
("characters", s(chars)),
("characterStyleIDs", arr(vec![u(0), u(1)])),
("styleOverrideTable", arr(vec![o(vec![("styleID", u(1)), ("fontSize", f(18.0))])])),
]),
),
("fontSize", f(size)),
("fontName", o(vec![("family", s("Synthetic Sans")), ("style", s("Bold"))])),
("fillPaints", arr(vec![solid(0.0, 0.0, 0.0)])),
("textAlignHorizontal", s("LEFT")),
("textAlignVertical", s("TOP")),
]
}
fn board_node(ty: &'static str) -> Kv<'static> {
let background = record(0, vec![("fillPaints", arr(vec![solid(1.0, 0.75, 0.25)])), ("opacity", f(1.0))]);
let note = record(1, text("Olá\nIdea", 24.0));
let author = record(2, text("Test Author", 12.0));
let bounds = |id, x, y, w, h| record(id, vec![("size", xy(w, h)), ("transform", at(x, y))]);
node(
2,
Some((1, "!")),
ty,
"Board object",
vec![
("size", xy(240.0, 240.0)),
("transform", at(100.0, 150.0)),
("opacity", f(0.5)),
("shapeWithTextType", e("ELLIPSE")),
// Deliberately shuffled: records are addressed by their full template GUID.
("nodeGenerationData", o(vec![("overrides", arr(vec![author, background, note]))])),
(
"derivedImmutableFrameData",
o(vec![
("version", u(1)),
(
"overrides",
arr(vec![
bounds(2, 20.0, 204.0, 200.0, 16.0),
bounds(1, 20.0, 20.0, 200.0, 160.0),
record(
0,
vec![
("size", xy(240.0, 240.0)),
("transform", at(0.0, 0.0)),
("fillGeometry", arr(vec![o(vec![("commandsBlob", u(0)), ("windingRule", e("NONZERO"))])])),
],
),
]),
),
]),
),
],
)
}
fn message(layer: Kv<'static>) -> Kv<'static> {
o(vec![
("nodeChanges", arr(vec![node(0, None, "DOCUMENT", "Synthetic board", vec![]), node(1, Some((0, "!")), "CANVAS", "Page", vec![]), layer])),
("blobs", arr(vec![o(vec![("bytes", Kv::Bytes(triangle_blob()))])])),
])
}
fn imported(layer: Kv<'static>) -> (Document, Vec<String>) {
import(&canvas(&board_schema(), &message(layer)), "Synthetic board").unwrap()
}
#[test]
fn generated_stickies_and_shapes_keep_their_background_text_and_author() {
for ty in ["STICKY", "SHAPE_WITH_TEXT"] {
let (doc, warnings) = imported(board_node(ty));
let frame = named(&doc, "Board object");
assert!(matches!(frame.kind, NodeKind::Frame));
assert_eq!(frame.opacity, 0.5);
assert_eq!(frame.children.len(), if ty == "STICKY" { 3 } else { 2 });
let background = doc.node(frame.children[0]).unwrap();
assert!(matches!(background.kind, NodeKind::Vector { .. }));
assert_eq!(background.fills[0].solid_color().unwrap().to_rgba8(), [255, 191, 64, 255]);
assert_eq!(background.opacity, 1.0);
let note = doc.node(frame.children[1]).unwrap();
let t = note.kind.text().unwrap();
assert_eq!(t.characters, "Olá\nIdea");
assert_eq!(t.style.font_size, 24.0);
assert_eq!(t.style.font_family, "Synthetic Sans");
assert_eq!(note.fills[0].solid_color().unwrap().to_rgba8(), [0, 0, 0, 255]);
assert_eq!(note.transform.translation(), figcraft_doc::geom::Vec2::new(20.0, 20.0));
assert_eq!((note.width, note.height), (200.0, 160.0));
assert!(t.runs.iter().any(|r| r.style.font_size == 18.0), "inline styles survive");
if ty == "STICKY" {
let author = doc.node(frame.children[2]).unwrap();
assert_eq!(author.kind.text().unwrap().characters, "Test Author");
assert_eq!(author.kind.text().unwrap().style.font_size, 12.0);
assert_eq!(author.transform.translation(), figcraft_doc::geom::Vec2::new(20.0, 204.0));
}
assert!(!warnings.iter().any(|w| w.contains("skipped")), "{warnings:?}");
}
}
fn set(value: &mut Kv<'static>, field: &'static str, replacement: Kv<'static>) {
let Kv::Object(fields) = value else { panic!("object") };
if let Some((_, old)) = fields.iter_mut().find(|(name, _)| *name == field) {
*old = replacement;
} else {
fields.push((field, replacement));
}
}
#[test]
fn missing_generated_bounds_warn_without_losing_the_background() {
let mut layer = board_node("STICKY");
set(
&mut layer,
"derivedImmutableFrameData",
o(vec![("version", u(1)), ("overrides", arr(vec![record(0, vec![("size", xy(240.0, 240.0)), ("transform", at(0.0, 0.0))])]))]),
);
let (doc, warnings) = imported(layer);
let frame = named(&doc, "Board object");
assert_eq!(frame.children.len(), 1);
let background = doc.node(frame.children[0]).unwrap();
assert!(matches!(background.kind, NodeKind::Rectangle));
assert_eq!(background.fills.len(), 1);
assert!(warnings.iter().any(|w| w.contains("missing its style or bounds")), "{warnings:?}");
}
#[test]
fn invalid_generated_sizes_and_transforms_are_skipped() {
for (width, x) in [(-1.0, 20.0), (f64::INFINITY, 20.0), (200.0, f64::NAN)] {
let mut layer = board_node("STICKY");
set(
&mut layer,
"derivedImmutableFrameData",
o(vec![("version", u(1)), ("overrides", arr(vec![record(1, vec![("size", xy(width, 160.0)), ("transform", at(x, 20.0))])]))]),
);
// The fixture encoder refuses non-finite floats; exercise the mapper's guard directly.
let msg = message(layer);
let (json, warnings, _) = map::to_rest(&msg, "Invalid bounds", 100);
let (doc, _) = crate::rest::import(&json, &|_| None).unwrap();
assert!(named(&doc, "Board object").children.is_empty());
assert!(warnings.iter().any(|w| w.contains("invalid bounds")), "{warnings:?}");
}
}
#[test]
fn unsupported_generated_versions_keep_the_legacy_fallback() {
let mut layer = board_node("SHAPE_WITH_TEXT");
set(&mut layer, "derivedImmutableFrameData", o(vec![("version", u(2))]));
set(&mut layer, "textData", o(vec![("characters", s("Legacy text"))]));
set(&mut layer, "fillPaints", arr(vec![solid(0.0, 1.0, 0.0)]));
let (doc, warnings) = imported(layer);
let frame = named(&doc, "Board object");
assert_eq!(frame.fills.len(), 1);
assert_eq!(frame.children.len(), 1);
assert_eq!(doc.node(frame.children[0]).unwrap().kind.text().unwrap().characters, "Legacy text");
assert!(warnings.iter().any(|w| w.contains("unsupported")), "{warnings:?}");
}
#[test]
fn generated_children_stay_within_the_layer_budget() {
for cap in 1..6 {
let msg = message(board_node("STICKY"));
let (json, warnings, _) = map::to_rest(&msg, "Budget", cap);
fn count(n: &Value) -> usize {
1 + n.get("children").and_then(Value::as_array).map_or(0, |kids| kids.iter().map(count).sum::<usize>())
}
assert_eq!(count(&json["document"]) - 2, cap.min(4), "{json}");
if cap < 4 {
assert!(warnings.iter().any(|w| w.contains("limit") || w.contains("skipped")), "{warnings:?}");
}
}
}
#[test]
fn malformed_generated_records_never_panic() {
for junk in [Kv::Bool(false), f(f64::NAN), f(f64::INFINITY), s("junk"), arr(vec![]), o(vec![])] {
for field in ["nodeGenerationData", "derivedImmutableFrameData"] {
let mut layer = board_node("STICKY");
set(&mut layer, field, junk.clone());
let msg = message(layer);
let (json, _, _) = map::to_rest(&msg, "Junk", 100);
let _ = crate::rest::import(&json, &|_| None);
}
}
}
+77 -12
View File
@@ -1024,8 +1024,12 @@ impl<'a> Mapper<'a> {
}
}
if stand.is_some_and(|s| s.0 == "FRAME") {
kids.splice(0..0, self.shape_with_text(&mut o, &view, own, &rest_id));
kids.extend(self.inner_text(&o, &view, &rest_id, own == "STICKY"));
if let Some(snapshot) = self.board_snapshot(&mut o, &view, own, &rest_id, depth) {
kids.splice(0..0, snapshot);
} else {
kids.splice(0..0, self.shape_with_text(&mut o, &view, own, &rest_id));
kids.extend(self.inner_text(&o, &view, &rest_id, own == "STICKY"));
}
}
if !kids.is_empty() {
o.insert("children".into(), Value::Array(kids));
@@ -1033,6 +1037,67 @@ impl<'a> Mapper<'a> {
Some(Value::Object(o))
}
/// FigJam notes and shapes keep their paints and text on generated template children,
/// not on the outer node. Keep the saved layout as ordinary editable layers (including a
/// note's author), without applying the background's opacity or transform to the wrapper.
fn board_snapshot(&mut self, o: &mut Obj, v: &View<'a>, own: &str, rest_id: &str, depth: usize) -> Option<Vec<Value>> {
if !matches!(own, "STICKY" | "SHAPE_WITH_TEXT") || v.get("nodeGenerationData").is_none() {
return None;
}
if v.get("derivedImmutableFrameData").and_then(|d| num(d, "version")) != Some(1.0) {
self.warn("note or shape generated layout is missing or unsupported; using its outer frame");
return None;
}
let mut children = Vec::new();
for local_id in 0..if own == "STICKY" { 3 } else { 2 } {
let style = generated_record(v, "nodeGenerationData", local_id);
let bounds = generated_record(v, "derivedImmutableFrameData", local_id);
let (Some(style), Some(bounds)) = (style, bounds) else {
if style.is_some() || bounds.is_some() {
self.warn("note or shape generated child is missing its style or bounds; child skipped");
}
continue;
};
let child = View::of(style).with([bounds]);
let chars = own_text(&child);
if local_id != 0 && chars.is_none() {
continue;
}
if valid_size(child.get("size")).is_none() || child.transform().is_none() {
self.warn("note or shape generated child has invalid bounds; child skipped");
continue;
}
if self.count >= self.budget() || depth >= MAX_DEPTH {
self.warn("note or shape generated children exceed the layer or nesting limit; remaining children skipped");
break;
}
let mut layer = Obj::new();
let ty = if local_id == 0 { "RECTANGLE" } else { "TEXT" };
layer.insert("id".into(), json!(format!("{rest_id};generated{local_id}")));
layer.insert("type".into(), json!(ty));
layer.insert("name".into(), json!(chars.map_or_else(|| "Background".into(), |c| c.chars().take(40).collect::<String>())));
self.common(&mut layer, &child, ty, Affine::IDENTITY, None);
if local_id == 0 {
self.geometry(&mut layer, &child);
if layer.contains_key("fillGeometry") || layer.contains_key("strokeGeometry") || layer.contains_key("vectorNetworkRef") {
layer.insert("type".into(), json!("VECTOR"));
} else if own == "SHAPE_WITH_TEXT" && !matches!(v.str("shapeWithTextType"), None | Some("SQUARE" | "ROUNDED_RECTANGLE")) {
self.warn("shape generated outline is missing or damaged; using its rectangle");
}
o.insert("fills".into(), json!([]));
o.insert("strokes".into(), json!([]));
} else {
self.text(&mut layer, &child);
if let Some(Value::Object(style)) = layer.get_mut("style") {
style.insert("textAutoResize".into(), json!("NONE"));
}
}
self.count += 1;
children.push(Value::Object(layer));
}
Some(children)
}
/// A non-rectangular shape-with-text's shape, as a vector under its frame (which gives up its
/// paints to it).
fn shape_with_text(&mut self, o: &mut Obj, v: &View<'a>, own: &str, rest_id: &str) -> Option<Value> {
@@ -1149,7 +1214,7 @@ impl<'a> Mapper<'a> {
{
return false;
}
let Some(line) = connector_record(v, "derivedImmutableFrameData", 0) else { return false };
let Some(line) = generated_record(v, "derivedImmutableFrameData", 0) else { return false };
if line.get("transform").and_then(matrix).is_none() || valid_size(line.get("size")).is_none() {
return false;
}
@@ -1167,7 +1232,7 @@ impl<'a> Mapper<'a> {
.and_then(|index| self.blobs.get(index as usize))
.and_then(|blob| network::decode(blob))
.is_some_and(|network| !network.segments.is_empty());
(geometry || network) && connector_record(v, "nodeGenerationData", 0).is_some()
(geometry || network) && generated_record(v, "nodeGenerationData", 0).is_some()
}
fn connector_snapshot_flatten(&mut self, out: &mut Obj, v: &View<'a>, rest_id: &str, space: Affine) {
@@ -1212,7 +1277,7 @@ impl<'a> Mapper<'a> {
/// Build the saved vector child or flattened terminal connector from the same child-only view.
fn connector_snapshot_vector(&mut self, v: &View<'a>, rest_id: &str, space: Affine, nested: bool) -> Option<Obj> {
let (Some(line), Some(line_style)) = (connector_record(v, "derivedImmutableFrameData", 0), connector_record(v, "nodeGenerationData", 0))
let (Some(line), Some(line_style)) = (generated_record(v, "derivedImmutableFrameData", 0), generated_record(v, "nodeGenerationData", 0))
else {
return None;
};
@@ -1247,19 +1312,19 @@ impl<'a> Mapper<'a> {
children.push(Value::Object(vector));
self.count += 1;
let Some(text_frame) = connector_record(v, "derivedImmutableFrameData", 1) else {
let Some(text_frame) = generated_record(v, "derivedImmutableFrameData", 1) else {
if connector_has_saved_label(v) {
self.warn("connector label was skipped: derived text bounds are missing");
}
return children;
};
let Some(background) = connector_record(v, "derivedImmutableFrameData", 2) else {
let Some(background) = generated_record(v, "derivedImmutableFrameData", 2) else {
if connector_has_saved_label(v) || valid_size(text_frame.get("size")).is_some_and(|(w, h)| w > 0.0 && h > 0.0) {
self.warn("connector label was skipped: derived background bounds are missing");
}
return children;
};
let Some(text_style) = connector_record(v, "nodeGenerationData", 1) else {
let Some(text_style) = generated_record(v, "nodeGenerationData", 1) else {
if valid_size(text_frame.get("size")).is_some_and(|(w, h)| w > 0.0 && h > 0.0) {
self.warn("connector label was skipped: text style data is missing");
}
@@ -1291,7 +1356,7 @@ impl<'a> Mapper<'a> {
return children;
}
let Some(background_style) = connector_record(v, "nodeGenerationData", 2) else {
let Some(background_style) = generated_record(v, "nodeGenerationData", 2) else {
self.warn("connector label background was skipped: style data is missing");
self.add_connector_text(&mut children, rest_id, characters, text_size, composed_text_transform, &text_view);
return children;
@@ -2539,8 +2604,8 @@ fn own_text<'a>(v: &View<'a>) -> Option<&'a str> {
v.get("textData").and_then(|t| t.get("characters")).and_then(Kv::str).filter(|c| !c.trim().is_empty())
}
/// A generated connector child is identified by one exact template GUID, not its array position.
fn connector_record<'a>(v: &View<'a>, field: &str, local_id: u32) -> Option<&'a Kv<'a>> {
/// A generated child is identified by one exact template GUID, not its array position.
fn generated_record<'a>(v: &View<'a>, field: &str, local_id: u32) -> Option<&'a Kv<'a>> {
v.get(field)?.get("overrides")?.list().iter().find(|row| {
row.get("guidPath").and_then(|path| path.get("guids")).map(Kv::list).is_some_and(|guids| {
guids.len() == 1 && num(&guids[0], "sessionID") == Some(40_000_000.0) && num(&guids[0], "localID") == Some(f64::from(local_id))
@@ -2550,7 +2615,7 @@ fn connector_record<'a>(v: &View<'a>, field: &str, local_id: u32) -> Option<&'a
fn connector_has_saved_label(v: &View<'_>) -> bool {
own_text(v).is_some()
|| connector_record(v, "nodeGenerationData", 1)
|| generated_record(v, "nodeGenerationData", 1)
.and_then(|r| r.get("textData"))
.and_then(|d| d.get("characters"))
.and_then(Kv::str)
+3
View File
@@ -1212,3 +1212,6 @@ fn dump_samples() {
std::fs::write(format!("{out}/{stem}.rest.json"), serde_json::to_string_pretty(&rest).unwrap()).unwrap();
}
}
#[path = "board_import_tests.rs"]
mod board;
+5
View File
@@ -1722,6 +1722,10 @@ name = "English"
"no bleed" = "no bleed"
"nobody else here yet" = "nobody else here yet"
"non-default slot settings are not represented and were skipped" = "non-default slot settings are not represented and were skipped"
"note or shape generated child has invalid bounds; child skipped" = "note or shape generated child has invalid bounds; child skipped"
"note or shape generated child is missing its style or bounds; child skipped" = "note or shape generated child is missing its style or bounds; child skipped"
"note or shape generated children exceed the layer or nesting limit; remaining children skipped" = "note or shape generated children exceed the layer or nesting limit; remaining children skipped"
"note or shape generated layout is missing or unsupported; using its outer frame" = "note or shape generated layout is missing or unsupported; using its outer frame"
"now" = "now"
"offer files to save if it asks to (you choose where each one goes)" = "offer files to save if it asks to (you choose where each one goes)"
"only in a text style or variable" = "only in a text style or variable"
@@ -1745,6 +1749,7 @@ name = "English"
"set-variable actions with values that don't fit the variable were skipped" = "set-variable actions with values that don't fit the variable were skipped"
"set-variable actions without a value were skipped" = "set-variable actions without a value were skipped"
"set-variable-mode actions on collections or modes that aren't in the variables JSON were skipped" = "set-variable-mode actions on collections or modes that aren't in the variables JSON were skipped"
"shape generated outline is missing or damaged; using its rectangle" = "shape generated outline is missing or damaged; using its rectangle"
"slot content assignment target is missing or is not slot content" = "slot content assignment target is missing or is not slot content"
"slot content assignment uses the empty GUID sentinel and was skipped" = "slot content assignment uses the empty GUID sentinel and was skipped"
"slot layers without a matching slot property were imported as frames" = "slot layers without a matching slot property were imported as frames"
+4 -3
View File
@@ -1,6 +1,6 @@
# File format parity
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-26 · **Change:** minor (Android Vector Drawable (XML) export; `.fig` export: files the incumbent imports, with component set properties, and grid track sizes at its field ids; Save and auto-save don't replace changes another app made to the open file (#1330); `.sketch` import, best effort, Sketch 48 and newer; the PNG row names ignore overlapping layers and where include bounding box is offered; the Fonts table's missing-font row describes the Missing fonts window; `.figcraft` carries the file kind (boards); `.fig` import: resized instances and variable modes by asset key; atomic saves; auto-save; SVG export clip of nested frames; SVG/PDF export depth refusal (#208); `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; `.fig` export: written files checked by opening them in other software; experimental `.fig` export; export and inspect behaviour suite and fixes; .fig import: editable vector networks and more layer kinds; embedded image colour profiles; `.fig` import, best effort; animated GIF fills and TIFF images; last major: created, formats from the installed Figma's Info.plist and help center, ours from source; REST import keeps slot layers and instances' slot content (#792); REST import reads grid track sizes (#465); `.fig` import fidelity from the community batches, budgets for large files, the import report, a `.fig` copy from Save as, paste from another design app; instance layers' size and resizing and Hug on import (#731, #732)) · **Target:** Figma Design (desktop app 126.10.7)
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-26 · **Change:** minor (FigJam generated sticky and shape backgrounds and text (#1341); Android Vector Drawable (XML) export; `.fig` export: files the incumbent imports, with component set properties, and grid track sizes at its field ids; Save and auto-save don't replace changes another app made to the open file (#1330); `.sketch` import, best effort, Sketch 48 and newer; the PNG row names ignore overlapping layers and where include bounding box is offered; the Fonts table's missing-font row describes the Missing fonts window; `.figcraft` carries the file kind (boards); `.fig` import: resized instances and variable modes by asset key; atomic saves; auto-save; SVG export clip of nested frames; SVG/PDF export depth refusal (#208); `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; `.fig` export: written files checked by opening them in other software; experimental `.fig` export; export and inspect behaviour suite and fixes; .fig import: editable vector networks and more layer kinds; embedded image colour profiles; `.fig` import, best effort; animated GIF fills and TIFF images; last major: created, formats from the installed Figma's Info.plist and help center, ours from source; REST import keeps slot layers and instances' slot content (#792); REST import reads grid track sizes (#465); `.fig` import fidelity from the community batches, budgets for large files, the import report, a `.fig` copy from Save as, paste from another design app; instance layers' size and resizing and Hug on import (#731, #732)) · **Target:** Figma Design (desktop app 126.10.7)
Every format Figma reads or writes, with FigCraft's support. Sources: `Info.plist` of
`/Applications/Figma.app` (document types only; nothing inside the bundle's code was read), Figma's
@@ -17,9 +17,9 @@ and prototype interactions are still unchecked there.
| Format | Figma | FigCraft read | FigCraft write | Fidelity / testing | Hours |
|---|---|---|---|---|---|
| `.fig` (Figma Design, `com.figma.document`, `application/x-figma`) | native (cloud; "Save local copy") | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | **experimental** ([below](#export-to-fig-experimental)) | `.fig` files open (best effort): the zip, its deflate/zstd chunks and the kiwi schema are decoded generically and mapped by field name onto the REST importer, so pages, the layer tree, geometry, paints (styles resolved), strokes, effects, text with styled runs, vectors as editable vector networks (points, curved segments, filled areas with their winding, per-point corner radius and handle mirroring, end caps; outlines when the network is missing or damaged), auto layout (grid included; a flow that records no primary-axis sizing hugs on that axis, an instance that records no auto layout has its main's), constraints, ellipse arcs, boolean operations, components, sets (with their descriptions), instances (expanded from their main with overrides, derived layout and property values; the size and resizing their layers override stay overrides), styles, variables with modes and bindings, prototyping (set-variable, set-variable-mode and conditional actions included) and image fills from the archive come across; sticky notes, shapes with text, connectors, tables, code blocks, slides and similar layers come in as the closest frames, text layers and vectors, with a warning; anything else is a warning. Since 2026-10-17 (community batches #727, #728): an instance's own identity and the cached library components a file carries, overrides applied by key and order, local text values and instance overrides over a shared text style, grid track sizes (fixed, content-sized, fill), slot content, labels of connectors saved with their drawn path (a static snapshot; the ends aren't live), skip ink, paragraph options and hanging lists, list start numbers, vertical trim, per-point stroke joins, editable text on a path, image adjustments and images carried in the message. Budgets come from the file's own size (one value per compressed byte, 20M–128M, lower ceilings on 32-bit targets; the layer cap follows), so a 15.4 MB synthetic file with 300,000 layers opens whole; the file's bytes stay out of the command journal; an import report lists what was left out or changed once the file opens. Not read: elbowed or curved connectors without a saved path (drawn straight) and labels of connectors without a saved snapshot, table cells beyond their own layers, filled areas with their own fills, variables bound to fields the editor can't bind, video fills. Tested on fixtures generated in code (`crates/format/src/fig/tests.rs`, `tail_tests.rs` and the per-feature `*_tests.rs` beside them, fuzzed) and by reading back what the export writes; no real-world files yet | read tail 5–10, write: checks against real files 5–15 |
| `.fig` (Figma Design, `com.figma.document`, `application/x-figma`) | native (cloud; "Save local copy") | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP) | **experimental** ([below](#export-to-fig-experimental)) | `.fig` files open (best effort): the zip, its deflate/zstd chunks and the kiwi schema are decoded generically and mapped by field name onto the REST importer, so pages, the layer tree, geometry, paints (styles resolved), strokes, effects, text with styled runs, vectors as editable vector networks (points, curved segments, filled areas with their winding, per-point corner radius and handle mirroring, end caps; outlines when the network is missing or damaged), auto layout (grid included; a flow that records no primary-axis sizing hugs on that axis, an instance that records no auto layout has its main's), constraints, ellipse arcs, boolean operations, components, sets (with their descriptions), instances (expanded from their main with overrides, derived layout and property values; the size and resizing their layers override stay overrides), styles, variables with modes and bindings, prototyping (set-variable, set-variable-mode and conditional actions included) and image fills from the archive come across; sticky notes and shapes with text keep their generated backgrounds, styled text, text paints, saved child bounds and sticky author lines as editable frame children (#1341); connectors, tables, code blocks, slides and similar layers come in as the closest frames, text layers and vectors, with a warning; anything else is a warning. Since 2026-10-17 (community batches #727, #728): an instance's own identity and the cached library components a file carries, overrides applied by key and order, local text values and instance overrides over a shared text style, grid track sizes (fixed, content-sized, fill), slot content, labels of connectors saved with their drawn path (a static snapshot; the ends aren't live), skip ink, paragraph options and hanging lists, list start numbers, vertical trim, per-point stroke joins, editable text on a path, image adjustments and images carried in the message. Budgets come from the file's own size (one value per compressed byte, 20M–128M, lower ceilings on 32-bit targets; the layer cap follows), so a 15.4 MB synthetic file with 300,000 layers opens whole; the file's bytes stay out of the command journal; an import report lists what was left out or changed once the file opens. Not read: elbowed or curved connectors without a saved path (drawn straight) and labels of connectors without a saved snapshot, table cells beyond their own layers, filled areas with their own fills, variables bound to fields the editor can't bind, video fills. Tested on fixtures generated in code (`crates/format/src/fig/tests.rs`, `tail_tests.rs` and the per-feature `*_tests.rs` beside them, fuzzed) and by reading back what the export writes; the FigJam report sample from #1341 checked locally only; no representative real-world corpus yet | read tail 5–10, write: checks against real files 5–15 |
| `.sketch` (Sketch 48 and newer) | import (file browser ▸ Import or drop, desktop app too; converted to a Figma file, symbols as components; per the help center) | **yes, best effort** (`file.open`, `file.import`, drop, CLI, MCP; Open With from Finder, Explorer and Linux file managers once installed; recent files show its `previews/preview.png`) | no (out of scope) | zip + JSON read from the public format description; Sketch 43–47 (text as binary property lists) and older (SQLite) files are refused with a message to resave them in a newer Sketch. Pages, artboards as frames with their background, groups; Sketch 2025 and newer: frames (clipping or not) with their style, graphics, stacks as auto layout (direction, gap, alignment, padding, wrap, hug/fill sizing, items ignoring the stack), corners in the style (rounded, smooth with its smoothing; angled, inside square and inside arc as paths), pins and sizing, per-side borders, lists of blurs (progressive background blurs, glass), inner shadows in the shadow list, tints (a graphic's, group's or instance's fill colouring its layers, and colour overrides), text colour and visibility overrides, text sized by its sizing; rectangles with corner radii, ovals, stars and polygons while their points are the generated ones, paths as editable vector networks, shape groups as their shape, as one compound path (children without an operation, by the group's winding rule) or as boolean operations (mixed operations nested from the left); open paths filled as if closed, edited ovals and rectangles as paths, bitmaps (with their colour adjustments as image filters), slices, hotspots; transforms (rotation, flips after it), resizing constraints; fills (solid, gradients with Sketch's geometry, image patterns), borders (the first enabled border's width and position), shadows, inner shadows, layer and background blurs, opacity and blend modes; clipping masks (an outline mask that shows its own style draws a copy under itself, as Sketch does; alpha masks only mask; broken mask chains wrapped), progressive opacity (Fade) as an alpha mask of its gradient; text with styled runs (UTF-16 ranges), paragraph and vertical alignment, lines placed by Sketch's line spacing behaviour, box sizing, fonts found by their PostScript names among the installed ones (else the family read from the name), variable font axes, Sketch's natural line (ascent and descent rounded, no line gap, a fifth more for classic Mac fonts) for text without a fixed line height; symbols as components (library copies on a page of their own) and instances carrying their masters' layers with overrides (text, nested swaps and hiding, images, layer and text styles, nested paths), laid out for their size the way Sketch does it (proportional sharing per pins from format 110, scaling before) and still live; master backgrounds in instances only where Sketch shows them; Apple's system fonts found under the names designs use, with the platform's tracking kept as letter spacing; shared layer styles as paint (fills, border colours) and effect styles, shared text styles as text styles; Color Variables (also library ones) as colour variables with bindings; prototype links, flow starts, export options, layout and square grids (hidden, as Sketch shows them only in its layout view). Instances of a stack laid out at their size and texts an override changed measured again on open. Warnings: noise fills, motion and zoom blurs (drawn as plain blurs), fonts embedded with their data (not used), Smart Layout (kept as laid out), locked overrides, scaled instances. Tested on fixtures built in code (`crates/format/src/sketch/*_tests.rs`, fuzzed) and locally (`FIGCRAFT_SKETCH_SAMPLES`) on one real Sketch 50 file and the public Apache-2.0 IBM Carbon Design Kit saved by Sketch 68 and 83 (70,000 layers open in ~3 s, debug build; its edition saved by Sketch 47 is refused, as it should be); compared artboard by artboard with Sketch 2026's own renders (`FIGCRAFT_SKETCHTOOL`, black-box): the Sketch 50 file's 73 artboards differ in at most 2.3% of their pixels (0.8% on average) (text metrics, fonts FigCraft doesn't find, antialiasing), Carbon 11's 69 1.1% on average and at most 4.4% (text in IBM Plex, which the file embeds and FigCraft doesn't use yet), a Sketch 64 file's 65 artboards 2.1% on average, a Sketch 2026 showcase file's 16 frames 0.9% on average (at most 1.9%) | 5–10 (Smart Layout as auto layout, motion and zoom blurs, several borders of different widths; fonts embedded in the file once `.figcraft` documents can carry fonts: until then they would only last the session) |
| `.jam` (whiteboards), `.deck` (Slides) | native to other Figma products | no | no | `.jam`: not read or written (boards are FigCraft files, see [boards-parity](boards-parity.md)); `.deck` out of scope | — |
| `.jam` (whiteboards), `.deck` (Slides) | native to other Figma products | no | no | direct `.jam` opening is not supported (#1342); its `canvas.fig` can be read best effort after renaming a copy to `.fig`, with generated sticky/shape backgrounds and text kept (#1341), as ordinary design layers rather than native board objects (see [boards-parity](boards-parity.md)); writing `.jam` is not supported; `.deck` out of scope | — |
| REST API file JSON (`GET /v1/files/:key`) + local variables JSON + `images/` folder | the API's output | **yes** (`file.open`, `file.import`, CLI) | no | pages, layer tree, geometry, paints, strokes, effects, text runs, vectors, auto layout (sizing modes left out read as hug, as documented; grid track sizes from `gridColumnsSizing` / `gridRowsSizing`: px, fr, auto, `minmax(0, 1fr)`, `repeat()`), constraints, grids, components, sets, instances with overrides (sizes and resizing included), component properties, slots (`SLOT` layers bound to their slot property; an instance's slot keeps its content as the instance's own unless its property value is the main's default content; slot limits and preferred components are warnings), styles, prototyping (incl. conditionals and variable modes), variables with modes, aliases, scopes and bindings, image adjustments (the same tint sign as `.fig`); the import report after opening; warnings for what's skipped (video triggers and actions, modifier keys). Unit tests in `crates/format/src/rest/*_tests.rs` | — |
| `.figcraft` (ours: zip of `document.json` + images, versions inside) | — | yes | yes | streamed JSON, 50k layers save ~0.09 s / load ~0.16 s (`cargo xtask bench`); old files keep opening (`large_tests.rs`); saves write a unique staging file and rename it into place (#284); optional auto-save of files with a path (`pref.autoSave`, #305); Save and auto-save refuse to write over a file another app (figcraft-cli, say) changed since it was opened or saved here, judged by its size and modification time: Revert to saved loads those changes, Save as keeps both, `file.save {overwrite: true}` replaces them (#1330); `kind: "board"` marks a board (left out for design files, so files from before boards are design files; the home screen reads it for the file's mark); board objects keep their `board` metadata on the layer; Dev Mode measurements are kept on the layer they start from (`measurements: [{to} | {side}]`, left out when there are none, so older files open with none) | — |
| Local library files | team libraries in the cloud | yes (enable a `.figcraft` as a library) | yes (publish) | per-asset versions, updates with overrides kept | see [collaboration-parity](collaboration-parity.md) |
@@ -181,6 +181,7 @@ each.
| Date | Change | Summary |
|---|---|---|
| 2026-10-26 | minor | FigJam generated sticky notes and shapes with text (#1341): backgrounds, text with its typography and paints, saved bounds and sticky author lines import as editable frame children; synthetic regressions and a local check of the report sample; native board metadata and direct `.jam` opening remain outside this fix. Numbers unchanged. |
| 2026-10-26 | minor | Changes made to the open file by another app are no longer lost on save (#1330): the app now remembers the file's size and modification time when it opens, reverts or saves it, and Save and auto-save refuse while the file on disk differs, with a message pointing to Revert to saved or Save as (the tab stays unsaved; closing it stays open). Scripts pass `file.save {overwrite: true}` to replace the file anyway; Save as and a save to an explicit `path` write as before. Not detected: a change of the same size inside one modification-time tick of a coarse file system. No prompt with choices yet, and a change isn't noticed until a save (`save_disk_changes_tests`). Numbers unchanged |
| 2026-10-25 | patch | PNG: the export settings were listed as "contents only" and "include bounding box (the layer's own box)"; the row now names ignore overlapping layers, on by default, and says that the Export section offers include bounding box for text layers (#1307), while `file.export` and `export.update` take it for any layer. Numbers unchanged |
| 2026-10-24 | patch | Fonts: the missing-font row said "warnings only (REST import)"; it now names the Missing fonts window (#752), `text.missingFonts` and the `missing font` lines of `figcraft-cli info`. Replacing a missing font is still missing. Numbers unchanged |
+13 -4
View File
File diff suppressed because one or more lines are too long