main moved figcraft-cli to RFC-0018 (#2645): main.rs is a thin wrapper and the
dispatch lives in lib.rs, so mcp_roots, the --automation-allow-server handling
and its test move there; headless mcp is checked before the fonts are scanned.
The example now passes the frame's `id`; a clean result is described as covering only the area
compared and the layers looked at; `truncated.matchedByBox` is explained. The test of the
differences cap asserts that the list is shorter than the count rather than the cap's value, and
uses a small frame (it took several seconds).
`inspect.compare` with `data` went into the session journal with its whole Base64 capture, which
the journal trims only by entry count, so a long session of comparisons could hold gigabytes. It
is left out like a Base64 import; a comparison only reads, so the log of edits is unchanged.
Comparisons by `path` are journaled as before.
- The design was drawn over its export area, which takes in strokes, effects and layers past an
edge that doesn't clip, then fitted to the frame's grid, so it shifted against the capture. It
is now drawn over the frame's own rectangle (`render_area`), as the capture holds it.
- Every grid is sized from the compared scale itself, never rebuilt from a rounded overlap: a
capture a few pixels across can't make the frame's grid enormous. The scale has no floor, so a
gigantic frame gets a coarser grid instead of a bigger one.
- A layer claimed every pixel of its box, so the see-through corners of an ellipse over a changed
rectangle took the rectangle's difference. A layer with an unclaimed difference now claims only
the pixels it draws on, from its own drawing at the compared scale, up to 300 layers; past that
a layer is matched by its box and the result says how many (`truncated.matchedByBox`).
`inspect.compare` checked only how many targets it had and that the target had a size, so with a
rectangle selected it compared the page against the rectangle, used the rectangle as the viewport,
and returned a result that looked like a real answer. A page is built from a frame, a component or
an instance of one: any other layer, named outright or selected, is now refused before the capture
is read, with what it is and what to pick. The command's and the tool's descriptions and the docs
say so.
An agent building a page can't see whether it matches the design. `inspect.compare` and the MCP
tool `compare_design` take a capture the agent's own browser tools made and compare it with a
frame, on this computer. A browser's text and antialiasing never match pixel for pixel, so the
answer isn't one score: it is the layers that differ, each on the deepest layer it belongs to and
largest first, as a position difference (with its offset), a colour difference (expected and
actual) or a content difference. Text is held to twice the tolerance. A capture at 2x is the same
design: the frame's width sets the density.
Explicit targets are validated, and one frame is compared at a time. Parameters of the wrong type
are refused, and so are a path and data together. The capture is size-checked before it is
decoded, the comparison scale is bounded by the larger of the frame and the capture, the layer walk
is iterative and capped (`truncated` says so), and only the 100 differences listed are searched
for a move.
Image fills were dropped by the native targets, so a photo under a colour overlay vanished (#2271). Each image fill is now written in its paint-order place as the asset file.exportAssets hands over, named by the same content hash, fitted by its scale mode with its opacity. A pattern fill is left out with a comment line.
Figma users reach for Cmd+. to hide the panels, and it did nothing
here. Cmd+\ stays; both keys now toggle the interface. Plain Cmd+. was
free (only Shift+Cmd+. and Alt+Cmd+. are taken, by text size and
weight).
While the Pencil, Marker or Highlighter is the tool, a bar above the
bottom toolbar shows its ink: eight colours (the Pencil also its
automatic black, or white on a dark page or frame), any colour through
the colour picker, and the stroke weight. Each tool keeps its own for
the session; new strokes and the Pencil's preview take it.
tool.ink {tool?, color?, weight?} sets and reads it, and board.ink
takes a weight.