Figma's help says they "always snap to the pixel grid, even if Snap to
pixel grid is disabled". In FigCraft they followed the setting like any
layer, and since #2031 a snap to a layer off the grid wins over the
grid, so a frame dragged next to a neighbour at 100.4 landed at 100.4
and the whole numbers inside it sat between pixels.
A move, resize or draw of frames, sections, components, component sets
and instances now rounds to whole pixels before and after object
snapping, whatever Snap to pixel grid says. A moved one also lands on
whole pixels of its parent (`snap::settle_on_pixels`), so a frame
already off the grid comes back onto it. Other layers keep #2031's
order: the pixel grid first, then the snap to a layer wins.
The move rounds the drag itself rather than each layer afterwards, so
the preview keeps its shifted-layers fast path for frames already on
the grid.
The desktop app started in a new, empty file on every launch, and with a
control port open (FIGCRAFT_CONTROL_PORT set for an attached agent) even
the Start on the Home screen preference was overridden, so the files you
worked in had to be found and opened again each time.
Quitting now keeps the paths of the open tabs' files, in tab order, and the
one in front (Prefs::open_files, Prefs::front_file); the next start opens
them again and brings that one forward, as Figma's desktop app reopens its
tabs. Files without a path (new, imported, joined live) and branch tabs are
left out. A file named on the command line stays in front, a recovered
copy keeps its one tab (file.open switches to an open path), a file gone
since is skipped, and one that won't open is reported like a file named on
the command line.
With nothing to reopen the window starts on the Home screen; only with a
control port open does it still start in a new file (#874: control callers
expect a document). Start on the Home screen now means Home instead of the
reopened files.
The list is written at quit only, with the other preferences. Keeping it on
every tab change would cover a crash too, but a crash already brings back
the unsaved files through recovery copies, and the list from the last quit
is a fair fallback for the rest.
Copying a main component in a library file and pasting it into another
file made a copy of the main there: a new component of that file, not
linked to the library. Copy then Paste of a main in its own file already
makes an instance, and pasting an instance from the library file already
uses the main from the library. Now a main the source file publishes is
an instance of it from that library too, which gets enabled the same way,
as Figma does with a published component. A variant is an instance of that
variant.
A main the library doesn't offer (hidden from publishing, added since the
last publish) and a main from a file that publishes no library still paste
as a copy. Making those an instance as well was rejected: their main would
stay in the other file, so the instance would show a missing main.
The part of adopt_pasted that brings published components in is now
from_published, shared with the new published_main.
Switching an instance to another variant matched its old layers to the
new variant's by source and then by name path. When the two variants nest
the same text layer differently (text > Label in one, div > text > Label
in the other), the path differs, the typed layer matched nothing, and the
new variant's own text came back.
A text layer of the new variant that nothing else matched now takes the
old text layer of the same name, when exactly one layer on each side has
that name. Two of one name stay unmatched, since either could be the one
typed into. Layers inside nested instances are left to their own mains'
rebuild, so a text layer never moves between instances.
Matching every layer kind by name alone was left out: a fill or size kept
from another place in the tree would land on a layer that only shares a
name, while text is what was typed and the layer most likely to be the
same one.
The swap removes the old library's copies that nothing uses before it
starts (a component imported but not placed, a variable imported but not
bound), and its result said nothing about them. It now lists them in
`dropped`, apart from copies that went because what used them moved.
- `inspect.designContext` returns the target's responsive context under `responsive`, and names
the missing breakpoints only when nothing was stated.
- `responsive.set` marks frames and sections only, as the Inspect section shows; a component or
instance is refused. `group: null` goes back to the frame's name, and emptying the field in the
Inspect tab sends it.
- A stored viewport that isn't mobile, tablet or desktop is ignored, and an empty or over-long
group reads as none (`node.set {pluginData}` can write anything there).
- The walk for rules counts each layer once and stops at its cap without collecting a whole
subtree first, so overlapping targets don't use it up; `near` is searched by binary search.
- `responsive.rule` refuses a page before making the category, as `annotation.add` does.
- Developer Mode makes responsive edits, like its annotations (`dev_mode_allows`).
- The Inspect tab keeps a rule's draft per document and keeps it when the rule is refused.
- Status line, row and revision row in docs/dev-mode-parity.md.
A design file has no breakpoints, so an agent implementing a frame can only guess how it should
respond. The designer can now say it outright: `responsive.set` marks frames as the mobile, tablet
or desktop version of a design (layer data, so the file format is unchanged), and
`responsive.rule` adds a note to the Responsive annotation category, made if the file lacks it.
`responsive.list` returns what was stated about the given layers, the layers above them and those
inside them, and never infers anything from names or sizes. The Inspect tab gets a Screen sizes
section for frames.
Explicit targets are checked rather than falling back to the selection, a rule keeps to the
limits `annotation.add` has (note length, annotations per layer, number of categories), and the
result says `truncated` when there were too many layers to read every rule.
- Export refuses to write over a connect file it can't read (not JSON, not an object, or over
4 MB) instead of replacing it with this design's links alone.
- Import skips an entry whose `values` is malformed, with a warning, instead of replacing the
component's link with one that maps nothing.
- `{Property ? "a" : "b"}` reads the design's value, so mapping Off to `inactive` doesn't make the
condition true.
- A `values` key that is only a parameter name (`state` for State) is reported as unknown, since
the mapping is read by property name and it would do nothing.
`inspect.designContext` wrote a component's links through `camel`, which renames keys at every
depth, so a mapped design value such as `extra_large` came out as `extraLarge`. Its components and
the code it gives each connected layer now use Code Connect's own link JSON: value names stay as
written, and the code carries the link's `source` and `notes`. Export also sorts its links once,
after merging the file's other links.
A link can say where the code component lives (`source`, a path inside the
repository), what a property's design values are called in code (`values`:
{"State": {"Hover": "hovered"}} renders `hovered`; a value without an entry
keeps its design name) and `notes`, through codeConnect.set, the connect file
and Inspect ▸ Connect to code (a Source file field and a row per variant
value). The fields are skipped when empty, so existing files and exports don't
change.
codeConnect.list and the MCP tool component_mappings say which code
component each design component is: import line, name, ready snippet,
properties and variants, and with a repository root whether each source file
is there. sync_mappings imports or exports a repository's connect file.
codeConnect.export {path} keeps the file's other top-level keys and the links
of components this design doesn't have, so several designs can share one file.
file.exportAssets and the MCP tool export_assets write a design's images and
vectors into a folder: images as the bytes the file holds, never re-encoded,
vectors through the SVG export, and layers with export settings by those
settings. Each file says whether it is original, vector or rendered. Files are
named by the first 16 hex digits of their SHA-256, so one asset has one file
used by every layer listed and exporting again writes nothing. What a layer
does to an image that isn't in its bytes (filters, crop, rotation, opacity) is
listed, as is why an asset couldn't be handed over. Writes go through
file_access, so automation roots confine them.
#2468 moved SVG import onto craft_svg::tree::parse, which runs the size,
entity, attribute and nesting checks itself, but left FigCraft's own
scanners (too_wide, too_deep, nesting) and import/budget.rs unused and
import.rs unformatted: main failed cargo fmt, clippy -D warnings and the
svg tests, which still passed budget::Limits to import_within.
The dead code goes; budget_tests use craft-svg's tree::Limits (bytes,
embedded_bytes, embedded_depth) and its error texts, and hostile_tests
check attribute width with craft_svg::guard::too_wide at the default
limits and the nesting refusal at craft-svg's 256 levels.
From review: the asset list follows the layers placed in the tree, so a
smaller tree (maxNodes, or the MCP tool's retry for maxBytes) means a smaller
list, and `truncated.assetsLeftOut` counts the rest; following aliases reports
`truncated.variables` when it stops at its budget with variables still to
read; and a font is checked with figcraft_text::has_family by its trimmed name,
as the missing-fonts list does, so a family stored with outer spaces isn't
taken for installed. A regression test for each fails without its fix.
From review: the variables a style binds and those an alias or colour
calculation reads are joined too, followed to any depth; fonts come from the
text layers placed in the tree, so a second target's font isn't lost to a
separate walk's budget; and a malformed `id` or `ids` entry is an error
instead of reading the selection or dropping the entry. A regression test for
each fails without its fix.
inspect.designContext and the MCP tool design_context read the selection (or
ids, or a scope) in one call. Each layer keeps apart the values the designer
set (explicit), those layout or the file worked out (derived) and those with no
direct CSS equivalent (unsupported, with the reason). The variables (every
mode's stored and resolved value), styles, components, fonts and assets the
tree uses are joined once, and `missing` says what the design doesn't specify.
A connected instance gives its code snippet instead of its layers. Large trees
are capped and say so, and the MCP tool asks for fewer layers until the result
fits the client.
Applying a style or variable, or copying or duplicating content that uses it,
inserts it; the Detach button detaches it; an instance counts as its component
alone. Show usage and library.usage give them over the chosen period.
In a hugging parent, Fill on the other axis follows the line the way
Figma does, instead of forcing the parent Fixed. This also covers item 2
of #2090 on both axes: a hugging main that becomes Fixed is followed by
its instances' roots.
Fixes#2091 item 3. Fixes#2034. Fixes item 2 of #2090.
Automation roots: same_file doesn't open a path on another computer, native NT link targets and names Windows trims are refused, and the docs say network paths are refused
* M9: page.setOpening sets the page a shared file opens on, for everyone who joins (#1817)
A file on a figcraft-server opened on the page current at publish time, with no way to change it:
`DocProp::CurrentPage` was synced but nothing wrote it (`page.select` is each viewer's own page,
only a local save stamps the document). `page.setOpening {id?}` writes `doc.current_page` as a
document edit: one undo step, a synced change in a live session, so every later join opens on it;
the current page when none is named; a divider or a layer refused; nobody's own page moves. The
pages list's context menu gets "Set as opening page". Docs: mcp.md, collaboration-parity.md.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* M9: the pages menu's new string is in the English catalog (#1817)
The gate's i18n test wants every tr() key in locales/en.toml.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* Opening page: the parity doc states the default when no opening page is set (#1972 issue)
With none set, a file opens on its saved current page, not the first page, and a link cannot name a page, so the row is partial.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* Opening page: one sharing row, and the spotlight exception on the opening-page row (#1972 issue)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* Opening page: the parity row states where the joiner's page comes from (#1972 issue)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* Opening page: a no-op set adds no step, deleting the opening page falls back, and the tests cover junk ids, refusals, undo and the menu item (#1817)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* M5: the chosen opening page is saved with the file and opens it for everyone (#1817)
The opening-page flag now lives on the page node (NodeKind::Page opening), so it syncs
through the existing node kind. Saving writes the flagged page as current_page instead of
the page the saver was viewing. A duplicated page does not copy the flag, and deleting the
page removes it.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Model-Effort: Opus 5.5 drove; Opus 5.5 briefed; Sonnet 5.5 wrote at medium
---------
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
The last merge of main kept both versions of the Select bullet. Main's
bullet (locked layers listed, the locked flag) stays, and takes this
PR's note that Tab and Shift+Tab on a mind map node go to its next or
previous sibling.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflicts resolved by keeping both sides: the new tests from main (#2327 and
the sticky size menu) and this PR's mind map UI tests, and the board_bar
imports (ToolId plus STICKY_SIZES).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Model-Effort: Opus 5.5 drove; Opus 5.5 briefed; Sonnet 5.5 wrote at medium