figcraft/docs
bflatastic c420721597 M6: experimental .fig export
An experimental, best-effort `.fig` export, so work done in FigCraft can be handed back as a `.fig` file. It is written from the same public format write-ups the importer uses and is the inverse of the importer's mapping. Only round trips through FigCraft's own importer are verified; other apps may not open every file.

- **Encoder** (`crates/format/src/fig/kiwi.rs`): the kiwi encoder that test fixtures used is now shipped code. It never panics and checks every value against the schema: unknown fields or enum names, missing struct fields, wrong types, out-of-range numbers and non-finite floats are errors, and NULs inside strings are dropped. Varints and floats are written exactly the way the decoder reads them. `Schema::parse` reads the compact text schema form, and the importer's tests use it too.
- **Writer** (`crates/format/src/fig/export.rs`): writes the zip (`canvas.fig`, `meta.json`, `thumbnail.png`, `images/<hash>`). `canvas.fig` holds the fig-kiwi header, then a raw-deflate binary schema and a raw-deflate message (flate2's pure-Rust backend, already in the tree; no new dependencies). The schema covers only the fields we write. The canvas, images, blobs, node count and nesting depth are capped, and floats are made finite before they are written.
- **Mapping:** pages; frames, groups, sections, rectangles, ellipses (arcs), polygons, stars, lines and vectors (vector network blobs with per-point radius, mirroring and caps, plus fill outlines); text with styled runs (UTF-16 indexed) and list types; slices; boolean groups; solid, gradient and image paints (image bytes included); strokes; effects; corners; constraints; masks; auto layout, including grids with tracks and cells; child layout; layout grids; export settings; components, component sets and their properties. Instances are written as their main plus the fields their layers change, by id path. This covers nested instances and swaps, and fields the main sets but the instance clears. Prototype interactions (triggers, navigation and overlay actions, transitions, easing), scrolling and flow starts are included. Everything skipped is reported in a warnings list: style links, variables, comments, Dev Mode data, plugin data, guides, slots, brush and width-profile strokes, pattern fills, image adjustments, variable and conditional actions, and more.
- **Import fixes found by the round trips** (`map.rs`): ellipse arcs, boolean operation types and component set descriptions are now read. Durations are read as whole milliseconds, because seconds stored as 32-bit floats used to truncate by 1 ms.
- **File writes:** a failed write no longer leaves its `.tmp-figcraft` file behind. The junk-parameter sweep found this.
- **Commands and UI:**
  - `file.export {format: "fig"}`, or any path ending in `.fig`, writes the whole file and returns `warnings`. Without a path it returns base64 `data`.
  - File > Export... has a new "The whole file" section with a ".fig (experimental)" row. A note under it says other apps may not open every exported file. After export, a toast reports how many kinds of content were left out.
  - `figcraft-cli export --format fig` (or `-o x.fig`) and `convert` to `.fig` print the warnings as `note:` lines.
  - MCP's `export` accepts `format: "fig"` and passes the warnings through.
  - New UI strings have English and Spanish entries.
- **Docs:** file-format-parity.md has a new export section covering what is written, what is skipped, and that only round trips through our own importer are verified. Also updated: mcp.md, cli.md, gaps.md (gap 1), target-app-parity.md and ROADMAP.md. Grading is kept low. Import/export goes to 86%/58% and file formats to 60%. The file-exchange discount stays at x0.85, because nothing shows that another app opens these files.
2026-10-12 07:19:57 +07:00
..
brand M0.1-M0.3: workspace, licences, geom/color/doc crates 2026-10-09 12:01:57 -04:00
architecture.md M8: Windows QA fixes (#131) 2026-10-11 18:20:38 +07:00
auto-layout-parity.md M2: auto layout behaviour suite and fixes (#130) 2026-10-11 17:53:11 +07:00
cli.md M6: experimental .fig export 2026-10-12 07:19:57 +07:00
collab-protocol.md M11: plugin directory on figcraft-server 2026-10-12 05:28:53 +07:00
collaboration-parity.md M8: cursor chat and spotlight in live sessions 2026-10-12 03:47:34 +07:00
components-parity.md M1: layers and assets panels behaviour suite and fixes 2026-10-12 03:47:34 +07:00
contributors.md About: Contributors and Models tabs with full credits; bump version to 0.2.0 (from 0.1.0) for release 2026-10-09 21:10:33 -04:00
control-protocol.md M5: prototyping tail: gamepad triggers, widgets in prototypes, mode lookups 2026-10-12 05:28:53 +07:00
dev-mode-parity.md M7: dev resources links 2026-10-12 02:30:25 +07:00
file-format-parity.md M6: experimental .fig export 2026-10-12 07:19:57 +07:00
gaps.md M6: experimental .fig export 2026-10-12 07:19:57 +07:00
hardware-parity.md M8: Windows QA fixes (#131) 2026-10-11 18:20:38 +07:00
localization-parity.md M9: Simplified Chinese draft catalog 2026-10-12 05:57:48 +07:00
mcp.md M6: experimental .fig export 2026-10-12 07:19:57 +07:00
parity-checklist.md M1: keyboard shortcut parity suite and bindings 2026-10-12 06:49:02 +07:00
plugins.md M11: plugin installs saved at once; directory and library requests off the UI thread 2026-10-12 06:15:00 +07:00
prototyping-parity.md M5: prototyping tail: gamepad triggers, widgets in prototypes, mode lookups 2026-10-12 05:28:53 +07:00
release-playbook.md M0.9: MCP server + figcraft-cli, PDF export, web app, release/CI packaging, vector edit mode, workspace lint cleanup 2026-10-09 13:31:53 -04:00
releasing.md M9: hosting figcraft-server: wss in the desktop app, server releases, deployment guide (#125) 2026-10-11 15:52:27 +07:00
roadmap.md M9: Simplified Chinese draft catalog 2026-10-12 05:57:48 +07:00
server.md M11: plugin installs saved at once; directory and library requests off the UI thread 2026-10-12 06:15:00 +07:00
target-app-parity.md M6: experimental .fig export 2026-10-12 07:19:57 +07:00
translating.md M9: Simplified Chinese draft catalog 2026-10-12 05:57:48 +07:00
ui-parity.md M1: keyboard shortcut parity suite and bindings 2026-10-12 06:49:02 +07:00