Commit Graph
2090 Commits
Author SHA1 Message Date
Timo Klerx 41ee2d7e92 Merge branch 'main' of https://github.com/storytold/figcraft into codex/fig-import-confirmation
# Conflicts:
#	crates/engine/src/cmd/file/load.rs
#	docs/file-format-parity.md
2026-11-29 13:33:22 +01:00
Timo Klerx 3b0e091f98 Merge branch 'main' into codex/fig-import-confirmation 2026-11-29 12:36:58 +01:00
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
BFlat 33d4cb3cda Merge pull request #2615 from denisg0mes/selection-colors-style-picker
M7: a Selection colors row's Styles button opens the style picker
2026-11-29 15:50:05 +07:00
BFlat 01f2f347f7 Merge pull request #2719 from mikaelweiss/fix/server-kept-no-save
M9: a file joined on a server that keeps it asks for no save
2026-11-29 08:03:05 +07:00
Mikael Weiss 5370cfc602 test: isolate unsynced edit guard in live_kept
Mutate the document directly via ds_mut() instead of execute() so live_edit() does not run, assert pending() == 0, and verify saved_doc stays unchanged across live_poll().
2026-11-28 13:17:21 -07:00
Denis Gomes 4e31dda79c Merge main: the row's style picker keeps library styles and Create style
Main's Selection colors Styles menu (style_items, create_form) is the
menu this branch replaces with the style picker, so the merge keeps the
picker and drops the menu, with main's focus change inside create_form.
What the menu offered stays in the picker opened from a row: this file's
paint styles and each enabled library's published ones under its name,
Create style for the row's paint (selection.createColorStyle, left out
where create_refusal refuses), colour variables, and Detach.

The picker test now also checks that a library's unpublished style is not
offered, as the menu's test did. "No color styles" goes from he.toml too,
which main added with the key.
2026-11-28 15:03:47 -05:00
Aathish bd68da55cc M8, #2329: use page-aligned selection box and single rotation centre for multi-selection 2026-11-28 23:16:24 +05:30
Mikael Weiss 7ddc533dd1 fix: keep server-kept tabs clean across previews
During a version or text preview, ds.doc is the temporary preview while document_itself() holds the underlying synced document, so mark_saved() recorded the wrong baseline and version.exitPreview re-normalised the restored document off saved_doc. Recording synced directly, skipping re-normalisation on version.exitPreview, and rechecking live_kept in live_sync_in after deferred batches or holds clear keeps confirmed server-kept tabs clean.
2026-11-28 10:00:03 -07: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
Timo Klerx 957d255641 fix(import): offer a bounded retry for large .fig files 2026-11-28 17:29:35 +01:00
bflatastic ba151a7087 Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	ROADMAP.md
2026-11-28 21:16:34 +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
bflatastic 9ae491f9ea Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	ROADMAP.md
#	docs/components-parity.md
2026-11-28 20:28:39 +07:00
BFlat f316a32c59 Merge pull request #2704 from brytoncooper/feat/web-host-confirmed-saves-2366
figcraft-web: opt-in confirmed saves for host mode (#2366)
2026-11-28 19:47:36 +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
BFlat 5135b3c4b9 Merge pull request #2177 from victorazesc/codex/native-corner-styles
M4: editable chamfered and concave corners
2026-11-28 18:25:31 +07:00
BFlat 97bc1da390 Merge pull request #2693 from storytold/fix/2178-sizing-side-effect-warnings
M2: node.set reports the sizing it changes on other layers and variants their set clips (#2178, #2182)
2026-11-28 18:22:52 +07:00
BFlat a276652996 Merge pull request #2690 from storytold/fix/2524-paste-dangling-bindings
M6: Pasted layers drop bindings to variables the file doesn't have and keep their values (#2524)
2026-11-28 18:22:37 +07:00
BFlat aaed433ddd Merge pull request #2587 from storytold/formats/penpot-craft-zip-9-8-2
Read Penpot archives through craft-zip
2026-11-28 18:09:43 +07:00
bflatastic 225d6810bb M7: variables export and import as DTCG design tokens (#1687)
variable.export {format: "dtcg", mode?} writes a group per collection and
a token per variable, nested by the parts of its name: colours as
colorSpace/components objects, numbers as px dimensions or plain numbers
where they are used unitless, aliases as {group.token}, colour
calculations as the colour they show. Strings, booleans, every mode's
value and scopes go under $extensions, so the file reads back whole;
`mode` picks the mode written as $value. Variables > Export offers it,
saved as .tokens.json.

variable.import reads a file holding a $value as tokens: top-level groups
are collections, types are handed down from groups, and color, dimension
(px, rem at 16 px), number, fontWeight, duration, fontFamily, strings,
booleans and aliases become variables, merged as the variables JSON is.
A plain file fills the default mode of the same-named collection.
Composite tokens are skipped and counted in the warnings.
2026-11-28 18:08:53 +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
BFlat 905850504a Merge pull request #2689 from brytoncooper/fix/web-join-perf-2041
M9: avoid full-snapshot copy and WASM page-by-page memory.grow storm on join (#2041)
2026-11-28 17:49:00 +07:00
bflatastic d5033c9f10 Pasting into another file keeps the copied corner style
Unlinking the copied styles for a paste into another file cleared
cornerStyle too, which then failed as a bad value: it is a value
(round, chamfer, concave), not a link. Both paths now share one check.
2026-11-28 17:37:50 +07:00
bflatastic 22fe0ceda1 M2: node.set reports the sizing it changes on other layers and variants its set clips (#2178, #2182)
An edit that turned another layer Fixed (a child set to Fill turning its
hugging parent Fixed, a frame set to Hug turning the children that filled
it Fixed) only showed the canvas notice, so a script got no hint why a
frame stopped growing. node.set now lists each such layer in `warnings`
with its id, name, key and old sizing.

A variant grown or moved past a component set that clips and has no auto
layout keeps being cut off (the set is sized only when variants are
combined or added). node.set now names such a variant in `warnings` and
points at layout.add on the set.
2026-11-28 17:33:14 +07:00
bflatastic 2cd906ddd8 Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	crates/format/Cargo.toml
2026-11-28 17:32:22 +07:00
bflatastic 2d7370017c Merge remote-tracking branch 'origin/main' into HEAD 2026-11-28 17:26:19 +07:00
bflatastic e57f9a385d M6: pasted layers drop bindings to variables the file doesn't have and keep their values (#2524, part 3) 2026-11-28 17:16:40 +07:00
bflatastic 086594604c M8: a wobbly Bend click on a point or segment is a click, not a drag (#2166) 2026-11-28 17:02:57 +07:00
Bryton Cooper 46ff7d9595 fix(engine): wrap TextData with Shared::from in join_bench_tests after #2679 2026-11-28 02:57:36 -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
Bryton CooperandClaude Opus 5.5 b33b75275c M9: open a full snapshot without copying it first (#2041)
Replica::from_snapshot borrowed the changes and cloned the whole
Vec<Change> before applying it, because the review-settings clamp
rewrites some of them in place. Every caller already owns the snapshot
(Client::join, the rejoin path, Server::restore), so it now takes the
Vec by value: a large file's snapshot is no longer copied and then
dropped twice on the way in. The server's publish path still borrows
and copies explicitly.

In a wasm32 build joining a 120k-layer file through the full-snapshot
catch-up (what an older server sends), this cut peak memory from 722 MiB
to 455 MiB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-28 02:54:44 -07:00
BFlat aaf900a6b3 Merge pull request #2679 from brytoncooper/perf/doc-cow-sharing
perf(doc): share TextData and VectorNetwork copy-on-write via Shared<T> (#1819)
2026-11-28 16:14:51 +07:00
BFlat 3d88d9475f Merge pull request #2676 from storytold/fix/2495-stop-keyed
M9: Stop sharing works for a file shared with the server key typed under Advanced (#2495)
2026-11-28 15:53:17 +07:00
bflatastic 406e71f182 Copied properties keep a corner style: it isn't a link to a shared style 2026-11-28 15:45:43 +07:00
bflatastic 86092cddda Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	contributors/people.toml
2026-11-28 15:45:40 +07:00
Bryton Cooper d9deec7b12 perf(doc): share TextData and VectorNetwork copy-on-write via Shared<T> (#1819) 2026-11-28 01:27:27 -07:00
bflatastic 87fee2835c M9: Stop sharing works for a file shared with the server key typed under Advanced (#2495) 2026-11-28 15:07:48 +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
bflatastic 2161144dad Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	ROADMAP.md
2026-11-28 15:06:05 +07:00
BFlat f9bfabad36 Merge pull request #2573 from imanderson/feat/automation-allow-server-join
MCP: allow confined sessions to join an approved server
2026-11-28 15:01:23 +07:00
BFlat f673320c42 Merge pull request #2137 from TrevorBrown-dev/feat/shift-a-defaults
Auto layout: Shift+A picks Figma's sizing, gap and padding defaults
2026-11-28 15:00:59 +07:00
bflatastic d82670ce4e Merge remote-tracking branch 'origin/main' into HEAD 2026-11-28 14:56:36 +07:00
FredApps bc9c97c7d2 Merge branch 'main' into uno/U1-01-layer-code 2026-11-28 08:11:36 +01:00
FredApps 1f73395b90 Merge branch 'main' into feat/automation-allow-server-join 2026-11-28 08:11:36 +01:00
FredApps a8c90689b0 Merge branch 'main' into feat/variables-json-text-styles-2173 2026-11-28 08:11:36 +01:00
FredApps a7486a5dce Merge branch 'main' into feat/shift-a-defaults 2026-11-28 08:11:35 +01:00
FredApps 921cdd058c Merge branch 'main' into codex/native-corner-styles 2026-11-28 08:11:35 +01:00
FredApps a992fdeb74 Merge branch 'main' into formats/penpot-craft-zip-9-8-2 2026-11-28 08:11:34 +01:00
FredApps 025133e4b0 Merge branch 'main' into feat/open-camera-raw 2026-11-28 08:11:34 +01:00