Commit Graph
533 Commits
Author SHA1 Message Date
Jindřich ŠaršonandClaude Opus 5.5 071fe03776 Merge main: image averaging after #2673
#2673 draws an image shown at half its size or less from a filtered,
halved copy. The per-pixel area average from this branch now applies to
that copy below half size and to the image itself above it; the export
test of the average across fractional positions moves to 0.625 of the
image's size, where no copy is made (it still fails without the
average). Test fixtures build text through Shared<TextData> (#1819).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012eBDgsvRwsSRpWeWrzabVY
2026-11-29 10:44:55 +01:00
PuFGGs efb8e3d666 M9: a file joined on a server that keeps it asks for no save
A tab in a live session counted every edit, everyone's, as unsaved, so closing a tab joined on figcraft-server or quitting asked to save a copy on this computer. The server already keeps the file: once it confirmed every edit (no batch pending or deferred, the tab's document the synced one), the tab is marked saved.
2026-11-28 09:51:11 -07:00
bflatastic fa8cb7a382 Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	ROADMAP.md
#	crates/mcp/src/tools.rs
#	docs/mcp.md
2026-11-28 20:32:18 +07:00
Bryton CooperandClaude Opus 5.5 927408fe16 figcraft-web: confirmed saves for hosts that opt in (#2366)
A host page that opts in with `?save=managed` (or `data-save="managed"`
on the canvas) now gets each Save and Save As of the document with an
`id` (`save-1`, `save-2`, ...), and the document keeps its unsaved
changes until the host answers `figcraft:saved` with that `id`. Hosts
that don't opt in see no change: a file still counts as saved once it is
posted.

- `host_saves.rs`: the bookkeeping, apart from the browser so it is
  tested natively. One save waits at a time; a newer one replaces it;
  answers for any other `id` are ignored; a file the host opens forgets
  the waiting save; a save unanswered after 30 s counts as not stored
  (the clock is passed in). A Save As becomes the document's file only
  once confirmed, so a retry after a failure is still `saveAs: true`.
- `host.rs`: the listener only queues what the host sent; the shell
  handles it in order each frame. Exports and copies carry no `id` and
  `saveAs: false`. A timeout tells the user and posts `figcraft:failed`
  with the `id`, and the app wakes itself for it.
- ui-egui: `Services::deliver_document` hands the document's own file
  over (its default is `download`, so desktop and plain browser saves
  are unchanged). `Delivery::Pending` skips `file.markSaved`;
  `FigApp::document_stored` and `document_not_stored` finish the save.
- engine: `FileSnapshot::delivered` marks the snapshot's tab saved as of
  the snapshot, so edits made while the save was in flight stay unsaved,
  and a tab closed or saved since is left alone. It shares its tail with
  `FileSnapshot::save`.

`craft-web-host` at the pinned rev has no host-to-app refusal message
and no `host {confirmsSaves}` handshake (storytold/craft-libs#1338), so
a host's refusal shows as the timeout until the crate adds them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-28 04:59:42 -07:00
bflatastic fdf0224808 M1: node.create makes a layer with its children in one command (#2185)
node.create (and the MCP create_node tool) takes children: node.create
params made inside the new layer, each with its own children, in one
command and one undo step. The result mirrors the tree, so a batch step
names any layer in it with a field path (children/1/id). A refused
child names its place (children[1].children[0]: ...) and nothing is
made.
2026-11-28 17:52:17 +07:00
Bryton CooperandClaude Opus 5.5 6c638908c9 M9: time joining a large shared file (#2041)
An ignored release test that builds a 120k-layer file over 15 pages and
times the server's welcome, Client::join and the engine opening it
through live_poll, for the delta catch-up and the full snapshot:
cargo test --release -p figcraft-engine --lib join_timings -- --ignored --nocapture

It runs natively, where the web heap's page-by-page growth doesn't
happen, so it times decode and apply work only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-28 02:55:09 -07:00
BFlat dbe9eeb1bd Merge pull request #2607 from Utakata/feat/open-camera-raw
format: open camera raw files as their developed picture
2026-11-28 15:06:51 +07:00
FredApps bc9c97c7d2 Merge branch 'main' into uno/U1-01-layer-code 2026-11-28 08:11:36 +01:00
FredApps 025133e4b0 Merge branch 'main' into feat/open-camera-raw 2026-11-28 08:11:34 +01:00
FredApps 4561b31166 Merge branch 'main' into feat/open-camera-raw
main's craft-libs pin (8fa4db64) already contains 249a41bd, so the pins stay at
main's and the camera raw crates are added at that same rev.
2026-11-28 07:46:25 +01:00
FredApps 9562640d75 Merge branch 'main' into uno/U1-01-layer-code 2026-11-28 07:40:32 +01:00
bflatastic 38ee5533a9 Merge remote-tracking branch 'origin/main' into HEAD 2026-11-28 02:47:01 +07:00
Jindřich ŠaršonandClaude Opus 5.5 086e709170 Merge main: export rules through world_render_bounds_with
#2616 measures each exported layer's drawn outlines through
Document::world_render_bounds_with. The export framing from this branch
(drop shadows to their blur radius, layers that draw nothing left out)
now goes through the same callback instead of a separate walk: the
callback returns None for a layer that doesn't count and takes a second
function for what a group's effects add round its children.

#2631's outline shadow path now groups blended drop shadows as the
pixel path does, so two linear-burn shadows darken where they overlap,
not the backdrop.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012eBDgsvRwsSRpWeWrzabVY
2026-11-27 14:23:24 +01:00
B-uchi d53d02b7cd M8: an agent can compare a capture of the page it built with the frame
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.
2026-11-27 12:10:51 +01:00
bflatastic 3d5f799b9a M7: a page's background can follow a colour variable in the page's mode (#2343) 2026-11-27 18:05:29 +07:00
bflatastic 4b99b1930e Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	ROADMAP.md
#	contributors/people.toml
2026-11-27 16:25:37 +07:00
bflatastic 0ddaf822fa Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	ROADMAP.md
#	docs/prototyping-parity.md
2026-11-27 15:33:29 +07:00
bflatastic d61e0d6978 Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	ROADMAP.md
#	crates/engine/src/lib.rs
2026-11-27 15:27:12 +07:00
bflatastic 920dab2fc6 Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	docs/ui-parity.md
2026-11-27 15:19:28 +07:00
bflatastic d4654d039d Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	docs/ui-parity.md
2026-11-27 15:18:50 +07:00
bflatastic 6e3685f301 Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	docs/ui-parity.md
2026-11-27 14:49:42 +07:00
bflatastic f1baeb7c8c Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	docs/components-parity.md
#	docs/ui-parity.md
2026-11-27 14:41:13 +07:00
bflatastic d6642a01b5 Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	docs/ui-parity.md
2026-11-27 14:40:39 +07:00
bflatastic 1c5f6f60d0 Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	docs/ui-parity.md
2026-11-27 14:40:03 +07:00
bflatastic 522c55e62f Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	crates/engine/src/design_context_tests.rs
#	crates/ui-egui/src/panels/dev_mode.rs
#	docs/dev-mode-parity.md
2026-11-27 14:39:13 +07:00
BFlat 95ffd55bfc Merge pull request #2620 from denisg0mes/paste-properties-frames
M4: Paste properties keeps a layer's styles and variables
2026-11-27 14:35:57 +07:00
bflatastic 0ce7ddf175 Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	crates/ui-egui/src/canvas.rs
#	docs/ui-parity.md
2026-11-27 14:16:17 +07:00
bflatastic 39c75b7da0 Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	docs/ui-parity.md
2026-11-27 14:11:11 +07:00
bflatastic fe7455050d Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	docs/ui-parity.md
2026-11-27 14:09:24 +07:00
BFlat d543ad2658 Merge pull request #2194 from phonedu/feat/design-review-engine
M13: design review commands (engine, MCP and collab)
2026-11-27 14:08:46 +07:00
bflatastic e02b260129 Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	docs/components-parity.md
#	docs/ui-parity.md
2026-11-27 14:07:06 +07:00
bflatastic e2173a8863 Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	docs/ui-parity.md
2026-11-27 14:06:50 +07:00
bflatastic 3590abc9ff Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	docs/ui-parity.md
2026-11-27 14:06:34 +07:00
bflatastic 50df6a4ecd Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	docs/ui-parity.md
2026-11-27 14:03:54 +07:00
bflatastic 17adfae82d Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	ROADMAP.md
#	crates/engine/src/cmd.rs
2026-11-27 13:57:00 +07:00
BFlat de547a0d0d Merge pull request #2446 from B-uchi/pr/asset-handoff
M8: asset handoff for code projects
2026-11-27 13:46:59 +07:00
BFlat a785aead6f Merge pull request #2486 from denisg0mes/pasted-image-keeps-its-proportions
M2: A locked-ratio child filling one axis of auto layout keeps its proportions
2026-11-27 13:45:36 +07:00
BFlat b52c55e670 Merge pull request #2616 from denisg0mes/export-bounds-tight-strokes
M8: a layer exports at the size of what it draws, strokes as drawn
2026-11-27 13:45:12 +07:00
FredApps 4cfed8dc63 Merge main into fix/kscale-bound-values-2090
Doc conflicts only (docs/components-parity.md, docs/ui-parity.md): kept main's header and changelog rows and added this PR's #2090 Scale tool clause and row next to them.
2026-11-26 19:22:14 +07:00
UtakataandClaude Opus 5.5 90d2d92430 format: open camera raw files as their developed picture
RW2, CR2, CR3, NEF, ARW, RAF, ORF, DNG and the other containers craft-raw
decodes now open, import, place and fill shapes. add_image develops a raw
once with craft-develop's stages (AHD demosaic, highlight rebuild, as-shot
white balance and colour matrices, neutral tone curve, sRGB, orientation)
and the document keeps the picture as a quality 95 JPEG, so every way an
image comes in takes raws. file.open and the Open, Import, Place and image
fill dialogs know the raw extensions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 04:34:49 +09:00
Denis Gomes c8bcd4ae48 M4: Paste properties keeps a layer's styles and variables
Copy properties took the values and left behind where they come from:
a frame filled from a colour variable or a fill style pasted a plain,
unlinked colour, and the pasted layer's own bindings stayed, so a bound
radius kept its variable's value over the pasted one.

It now also carries the fill, stroke, effect, grid and text style
links, the variables bound to what it copies (not sizes, auto layout
spacing, visibility or text content) and a frame's layout grids. The
pasted layer's bindings on those give way. A style or variable the
target file lacks (a copy from another tab) is left out and its values
pasted, so the paste never fails on a missing link.

Layout grids coming along with a frame is not measured in Figma.
2026-11-24 14:31:53 -05:00
Denis Gomes 6247922621 M5: a file opens again where it was left
A file always opened on the page saved in it, fitted to its content, so
coming back to a file meant finding the place again. Figma opens a file
where you were.

Closing a file's tab or quitting now keeps the page it showed and each
page's view (centre and zoom) in the preferences, by path, for the last
100 files left. Opening the file shows that page at its view, and the
canvas keeps the view instead of fitting the page when it first gets its
size (DocState::fit_when_sized). A page the file no longer has, a divider
or a view the canvas can't show is left out.

Keeping the view in the file was rejected: it would come back only after a
save, and looking around would make the file unsaved. The preferences are
per machine, so another computer opens the file fitted.
2026-11-24 03:01:16 -05:00
Denis Gomes f9964e14ae Desktop: reopen the files open at quit instead of starting in a new file
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.
2026-11-24 03:00:57 -05:00
Denis Gomes 80c68ee7a9 M1: Paste over selection with several layers selected pastes after the last of them
With several layers selected, Shift+Cmd/Ctrl+V took the first one selected,
so the copies landed among the others. It now pastes after the last selected
layer as seen: the last in one auto layout frame's flow, else below the lowest
at the selection's own gap, or right of the rightmost for a row. One selected
layer is unchanged.
2026-11-24 02:58:00 -05:00
Denis Gomes 782b2ea369 M4: Tab while editing a text layer goes on to the next text layer
Tab while editing a text layer typed a tab character, and Shift+Tab did
too, so filling in a form built from instances took a double-click into
every label. Tab now ends editing the text and edits the next text layer
with all of its text selected; Shift+Tab goes to the previous one.

The order is reading order: rows top to bottom, each left to right; two
layers share a row when they overlap vertically by at least half the
shorter one's height. The candidates are the text layers of the same
top-level frame or group, at any depth and inside instances, that are
visible and unlocked along with every layer around them; a text on the
page or in a section goes to the texts beside it. At the last text Tab
does nothing, and Shift+Tab at the first.

Tab keeps nesting a list item, typing two spaces in a code block and
typing a tab in a board object's text or a widget's field. The view
doesn't follow a text that is off screen: nothing in the app scrolls a
layer into view yet.

Two rows of text_tail_tests::list_keys_at_list_items asserted that Tab
outside a list types a tab; they now assert the text stays as it was.
2026-11-24 02:57:36 -05:00
Denis Gomes 81eb01e821 M8: a layer exports at the size of what it draws, strokes as drawn
SVG, PNG, PDF and Vector Drawable exports took their size from the
renderer's bounds, and Node::outline_reach grows a line's, vector's or
polygon's box by the weight times the miter limit (up to 4) to leave room
for a mitre at any corner. An icon frame whose outlined strokes stay
inside it exported at 26 x 26 to 30.8 x 24 instead of 24 x 24, its content
moved off the frame's origin.

export_bounds now walks the tree as world_render_bounds does
(Document::world_render_bounds_with) and measures each layer's own paint
on the outlines it draws: its shape and its stroke area from stroke_fill,
in page space, grown by its effects. A dashed stroke counts as a solid one
as well as its dashes, so where the dashes fall doesn't change the size.
Text and drop shadows with a spread keep the renderer's bounds. The
renderer's own bounds, used for drawing and culling, are unchanged.

Shrinking outline_reach itself was rejected: the renderer culls and
caches by it, and an exact stroke there would cost a stroke outline per
layer per bounds query.
2026-11-24 02:32:28 -05:00
phonedu 13cd2f7d6b M13: merge upstream main again 2026-11-22 20:46:38 +08:00
Jindřich ŠaršonandClaude Opus 5.5 d5a0d71690 M6: imported variant properties bound to a mode variable pick their variant
A design kit's Light/Dark components switch variant through a `Mode`
string variable bound to the variant property. Imports dropped that:
dark screens showed the light variants.

- REST import reads boundVariables.componentProperties (variant, text
  and boolean properties) as componentProperties/<name> bindings.
- An opened REST or .fig file settles them: each bound instance shows
  the variant the variable names in its mode, outer instances first,
  keeping its own overrides and the ones the mains around it make.
- A text reads a property its instance sets even when the variant set
  lists it under another id (imported library copies do).

.fig needs craft-libs craft-fig with the RESOLVE_VARIANT mapping (local
commit edcc9d6d3). On a real-world iOS kit file: dark alerts 28%/20% and
the dark keyboard 38% differing pixels -> 2%, 1.4%, 1.7%.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012eBDgsvRwsSRpWeWrzabVY
2026-11-21 00:09:21 +01:00
Jindřich ŠaršonandClaude Opus 5.5 0244230e1a M6: .fig import sets a variable font's optical size to the text size
Figma sets a variable font's optical size to the text size (within the
axis), also for a named style; FigCraft keeps the named instance's (SF
Pro's is 28, its display cut), so imported SF Pro text at text sizes
came out about 14% narrower than in Figma. The .fig, paste and REST
imports now carry the size as the text's opsz value, as the .sketch
import already did (shared pass optical_size_follows_text_size).

Rule from the glyph advances Figma saves in derivedTextData, in a
real-world file and in a synthetic one saved from Figma's web app; Figma's
Inter has no optical size axis and keeps its advances at every size.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012eBDgsvRwsSRpWeWrzabVY
2026-11-21 00:09:15 +01:00
Denis Gomes 0d7eeac29d M2: A locked-ratio child filling one axis of auto layout keeps its proportions
A photo filling the width of a row (Fill container across, a fixed
height, its image cropped to the layer) was squashed when it went into
a row with a different amount of room: pasted next to a 516 pt column
instead of an 804 pt one it became 1092 by 969.15 instead of 804 by
969.15, and the cropped image stretched with it. Locking the aspect
ratio didn't help, because auto layout never read constrain_proportions.

flow_items now records the cross-per-main ratio of a child whose aspect
ratio is locked, which fills exactly one axis and is fixed on the other
(text excluded, and rotated layers too: layout reads a turned layer's
bounding box, whose ratio isn't the layer's own). Wherever the layout
sizes such a child on its filled axis (resize_fill_main_item, the
single-line cross fill before the lines are measured, and the stretch
across a hugging line), the fixed side follows at that ratio, within
its min and max; a filled side of zero leaves the fixed side as it is
rather than shrink the layer to nothing. Without the lock the fixed
side stays fixed, as before. Wrapping lines and grids are unchanged.

Figma never squashes a pasted image, lock or not. So a pasted layer
whose image is cropped to it (the one image mode that stretches with the
layer; Fill and Fit refit the image), landing in an auto layout frame
where it fills one axis and is fixed on the other, gets its aspect
ratio locked, and the layout above keeps its proportions. That includes
the instance a main component copied in its own file pastes as. Other
pasted layers keep their lock as copied.
2026-11-19 16:09:48 -05:00