Merge remote-tracking branch 'origin/main' into HEAD

# Conflicts:
#	ROADMAP.md
This commit is contained in:
bflatastic committed 2026-11-27 15:46:21 +07:00
commit 5a8dcb867e
16 files changed
+432 -19

No files matched your search

+5 -1
View File
@@ -2,7 +2,7 @@
**Stage: alpha** · next: beta, ~26 points and ~162–292 h away (one Opus 5.5 agent; ~33–67 h wall-clock with 5 agents)
> **Last reviewed:** 2026-11-15 · **Last updated:** 2026-11-19 · **Change:** minor (CLI scales reject repeated x suffixes; mind maps from the toolbar and the keyboard: Shapes ▸ Mind map places one with a click, Cmd/Ctrl+Enter adds a child and Shift+Cmd/Ctrl+Enter a sibling, Tab goes to the next sibling (#2226); code blocks, first step: a dark panel of monospace text as tall as its lines, in one of 16 languages (`board.codeBlock`, `board.setLanguage`, #2237); library analytics count insertions and detachments of styles and variables; web builds with craft-fonts embed Noto Sans Arabic by default so Persian and Arabic text draws without extra build flags (#1902); the browser build uses team libraries and plugin directories on a server; CLI post-parse errors escape terminal controls in paths and failure text; M6 `.fig` export writes text on a path (#2323), list spacing, hanging punctuation and lists, vertical trim (#2305), vector region paints (#2302), image adjustments (#2297) and a page's prototype background (#2326); M8 Tidy up keeps a row's or column's order and sizes and evens the gaps, rounds the gap, tidies overlapping rows and grids along their longer axis, and raises a negative gap so no layer reaches the one two before it, as measured in Figma (#2319); a polygon's or star's Count handle and a double-click on a layer's icon (zoom, range anchor) follow Figma; Tab while renaming moves only the rename and wraps from the last layer; Align is unavailable for a layer in an auto layout frame's flow; the Scale tool pivots on the opposite handle and starts its origin at the centre; Paste over selection puts the copies just above the selected layer; Crop from the image fill's menu crops with a drag (#2307); M10 code export writes every colour and gradient fill in paint order for CSS, SwiftUI, Compose and Flutter (#2271), CSS as one layered background; 24 pt icon buttons draw 16 pt glyphs (#2227, #2238); M5 marquee selection follows Figma's measured rules and Select layer lists locked layers with a padlock (#1560); M7 the Design panel shows the page's variable modes with nothing selected (#2215); M12 mind maps in a section or frame without a place centre on the view, stickies take a Small–Huge text-size menu, and M9 `.jam` shapes with text import as native board shapes (#1808); M4 a boolean group's corner radius rounds its result (#2222), Flatten bakes a point's corner radius into its path (#2195) and loops close through a joining segment (#1951); library links survive moving or cloning the project folder (#2132); renaming a variable group to a path with `/` nests it (#2353); SVG import, widget images, batches and grids take bounded work, and a host's server key is never sent over plain `ws://` to another machine (#1923); CI prefetches dependencies for Sonar coverage and runs Harden-Runner on every job; releases FigCraft v0.18.0 and v0.18.1 (Flatpak update fix); readiness estimates unchanged) · **Target:** Figma Design (desktop app 126.10.7)
> **Last reviewed:** 2026-11-15 · **Last updated:** 2026-11-19 · **Change:** minor (CLI scales reject repeated x suffixes; CLI help and docs name the first non-divider page as the default for export and render; invalid browser-page server endpoints are ignored before they replace the sharing default; the browser crate docs no longer repeat an obsolete same-computer-only live-session restriction; document HTTP(S) links without a host are refused before opening; mind maps from the toolbar and the keyboard: Shapes ▸ Mind map places one with a click, Cmd/Ctrl+Enter adds a child and Shift+Cmd/Ctrl+Enter a sibling, Tab goes to the next sibling (#2226); code blocks, first step: a dark panel of monospace text as tall as its lines, in one of 16 languages (`board.codeBlock`, `board.setLanguage`, #2237); library analytics count insertions and detachments of styles and variables; web builds with craft-fonts embed Noto Sans Arabic by default so Persian and Arabic text draws without extra build flags (#1902); the browser build uses team libraries and plugin directories on a server; CLI post-parse errors escape terminal controls in paths and failure text; M6 `.fig` export writes text on a path (#2323), list spacing, hanging punctuation and lists, vertical trim (#2305), vector region paints (#2302), image adjustments (#2297) and a page's prototype background (#2326); M8 Tidy up keeps a row's or column's order and sizes and evens the gaps, rounds the gap, tidies overlapping rows and grids along their longer axis, and raises a negative gap so no layer reaches the one two before it, as measured in Figma (#2319); a polygon's or star's Count handle and a double-click on a layer's icon (zoom, range anchor) follow Figma; Tab while renaming moves only the rename and wraps from the last layer; Align is unavailable for a layer in an auto layout frame's flow; the Scale tool pivots on the opposite handle and starts its origin at the centre; Paste over selection puts the copies just above the selected layer; Crop from the image fill's menu crops with a drag (#2307); M10 code export writes every colour and gradient fill in paint order for CSS, SwiftUI, Compose and Flutter (#2271), CSS as one layered background; 24 pt icon buttons draw 16 pt glyphs (#2227, #2238); M5 marquee selection follows Figma's measured rules and Select layer lists locked layers with a padlock (#1560); M7 the Design panel shows the page's variable modes with nothing selected (#2215); M12 mind maps in a section or frame without a place centre on the view, stickies take a Small–Huge text-size menu, and M9 `.jam` shapes with text import as native board shapes (#1808); M4 a boolean group's corner radius rounds its result (#2222), Flatten bakes a point's corner radius into its path (#2195) and loops close through a joining segment (#1951); library links survive moving or cloning the project folder (#2132); renaming a variable group to a path with `/` nests it (#2353); SVG import, widget images, batches and grids take bounded work, and a host's server key is never sent over plain `ws://` to another machine (#1923); CI prefetches dependencies for Sonar coverage and runs Harden-Runner on every job; releases FigCraft v0.18.0 and v0.18.1 (Flatpak update fix); readiness estimates unchanged) · **Target:** Figma Design (desktop app 126.10.7)
FigCraft is a clean-room, open-source, pure-Rust reimplementation of the Figma design workflow,
native on macOS, Windows, Linux and FreeBSD and in the browser, fully drivable by agents through
@@ -368,6 +368,7 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md).
|---|---|---|
| 2026-11-26 | minor | #1396, craft-contrib#95: `figcraft-cli` follows RFC-0018. The CLI is a library with `run(args, out, err)` (`main` is a thin wrapper), failures are typed errors (exit 1, usage errors exit 2), output goes through the caller's writers, a closed stdout is quiet, `-V` works after subcommands, `FIGCRAFT_NO_SYSTEM_FONTS` and `FIGCRAFT_SERVER_KEY` are declared on `--no-system-fonts` and `plugin publish --key`, the packages install the man pages and Bash, Zsh and Fish completions (Linux and FreeBSD). Changed behaviour: `convert`/`run` refuse an output that is the input unless `--in-place` is given (it needs `--in`/`--out`); `export -o` and `render -o` refuse the file they read; `plugin publish` accepts `--key`; a blank `FIGCRAFT_NO_SYSTEM_FONTS` counts as unset and an unrecognised value is a usage error. Tests in `apps/figcraft-cli/tests/it/rfc18.rs`. Numbers unchanged |
| 2026-11-24 | minor | M7: New York, Apple's serif that macOS installs as the hidden `.New York`, is found and listed under its public name (it was a missing font). Numbers unchanged. |
| 2026-11-15 | patch | Removed the obsolete duplicate live-session bullet from the browser crate docs; the existing server publishing and remote wss guidance remains authoritative. Runtime behavior unchanged. |
| 2026-11-18 | minor | M8: design context for AI agents. `inspect.designContext` and the MCP tool `design_context` read the selection (or `ids`, or a `scope`) in one call: a tree where each layer keeps apart `explicit` values, `derived` ones layout worked out and `unsupported` ones with no direct CSS equivalent, joined with the variables (every mode's stored and resolved value), styles, components, fonts and assets it uses, and what the design leaves `missing`. A connected instance gives its code instead of its layers, and a result that wouldn't fit the client asks for fewer layers. Numbers unchanged |
| 2026-11-19 | minor | M8: Code Connect for agents. A link can name its source file, what variant values are called in code (Primary becomes `primary` in the snippet) and notes, in the Inspect tab, `codeConnect.set` and `figcraft.connect.json`. `codeConnect.list` and the MCP tool `component_mappings` say which code component each design component is, and whether its source file exists; `sync_mappings` imports and exports a repository's file. `codeConnect.export {path}` keeps the file's other keys and the links of components the design doesn't have, so several designs can share one file. Numbers unchanged |
| 2026-11-18 | minor | M3, gap 10: library analytics count insertions and detachments of styles and variables. Applying one, 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 per style and variable over the chosen period. Modes aren't counted. Numbers unchanged. Tests: `library_asset_counts_tests`, `library_assets_tests`. |
@@ -377,6 +378,9 @@ Ranked; detail and milestones in [`docs/roadmap.md`](docs/roadmap.md).
| 2026-11-10 | minor | M12, #2226 (step 2 of 4): mind maps in the UI. The Shapes flyout ends in a mind map tool (`tool.mindMap`): a click places a map with the first node's text starting there and types in it. Cmd/Ctrl+Enter adds a child of the selected or edited node (`board.mindMapAdd`), Shift+Cmd/Ctrl+Enter its next sibling (`board.nextSticky` on a node), both typing on; Tab and Shift+Tab walk a node's siblings in the map's order (`select.next`, `select.previous`). The bar over the selection colours a node's text (`board.setColor`) and shows a branch the connector's controls without the line types. Tests: `board_mindmap_tests` (four more), `board_ui_tests` (five more). Breadth ~47% → ~48%, ready ~29% → ~30%. |
| 2026-11-15 | patch | CLI usage and operation failures escape terminal controls in paths and error text, using the same printable-text rule as info and script diagnostics; exit codes and ordinary quotes and paths stay unchanged. |
| 2026-11-10 | minor | Experimental `.fig` export preserves set-variable, set-variable-mode and conditional prototype actions (#2210). |
| 2026-11-15 | patch | Document HTTP(S) links without a host are refused before opening; regressions retain valid query, fragment, IPv6 and mail links. |
| 2026-11-15 | patch | The browser ignores a page server meta tag with an invalid host, port or path, using the same endpoint parser as sharing; valid local, IPv6 and reverse-proxy addresses keep their spelling. |
| 2026-11-15 | patch | CLI export and render help and docs name the existing first non-divider page default, including the all-divider fallback and explicit page selection. Behavior unchanged. |
| 2026-11-15 | patch | CLI export and render reject repeated scale suffixes such as `2xx` as usage errors (exit 2); numeric values and one optional `x` suffix retain the existing limits. |
| 2026-11-10 | minor | M4, #2222: a boolean group takes a corner radius that rounds every sharp corner of its result. Numbers unchanged |
| 2026-11-10 | minor | M12, #2226 (step 1 of 4): mind maps in the document and engine. `board.mindMap` places a first node with three children on curved branches and `board.mindMapAdd` adds a child or a sibling; the normalize pass lays a touched map out again from its first node (88 between columns, 48 between siblings, stacks centred on their parents). No toolbar entry yet; numbers unchanged. |
+2 -2
View File
@@ -102,7 +102,7 @@ pub struct ExportArgs {
pub format: Option<String>,
#[command(flatten)]
pub scale: ScaleArg,
/// The page to export (default the first)
/// The page to export (default the first non-divider page)
#[arg(long, value_name = "NAME")]
pub page: Option<String>,
/// The layer to export, by id (12 or 0:12) or name
@@ -171,7 +171,7 @@ pub struct RenderArgs {
pub out: String,
#[command(flatten)]
pub scale: ScaleArg,
/// The page to render (default the first)
/// The page to render (default the first non-divider page)
#[arg(long, value_name = "NAME")]
pub page: Option<String>,
#[command(flatten)]
-2
View File
@@ -22,8 +22,6 @@
//! - host mode: `?host=parent` (a same-origin page embedding FigCraft in an `<iframe>`) or
//! `data-host="page"` on the canvas (the page's own document) hands the page the app's files
//! instead of downloading them and reports unsaved changes (`host`);
//! - live sessions: it joins sessions a desktop app hosts (File ▸ Join live session…) but can't
//! host one. A page served over `https://` can only reach sessions on the same computer
//!
//! URL query flags: `?webgl` forces the WebGL2 backend instead of WebGPU; `?control` installs
//! `window.figcraft`, the page's control channel (`api.rs`), which is off without it; `?host=parent`
+8 -1
View File
@@ -22,7 +22,14 @@ pub fn join_link(fragment: &str) -> Option<&str> {
pub fn page_server(content: &str) -> Option<String> {
let c = content.trim();
let scheme = c.starts_with("wss://") || c.starts_with("ws://");
(scheme && c.len() <= 512 && !c.contains(|ch: char| ch.is_whitespace() || ch.is_control() || ch == '?' || ch == '#')).then(|| c.to_string())
// Invalid metadata must not replace a usable default with an endpoint sharing cannot reach.
(scheme
&& c.len() <= 512
&& !c.contains(|ch: char| ch.is_whitespace() || ch.is_control() || ch == '?' || ch == '#')
// Endpoint parsing strips pasted-link delimiters; metadata must retain its spelling.
&& !c.ends_with(['<', '>', '"', '\''])
&& figcraft_collab_net::Endpoint::parse(c).is_ok())
.then(|| c.to_string())
}
/// Whether `search` (`location.search`, with or without its `?`) has a `control` entry (`?control`,
+33
View File
@@ -49,3 +49,36 @@ fn a_page_names_its_own_server_without_a_key() {
assert_eq!(page_server(bad), None, "{bad:?} is ignored");
}
}
#[test]
fn a_page_ignores_invalid_server_endpoints() {
for bad in [
"ws://",
"wss://",
"wss:///figcraft/",
"wss://:443/",
"wss://figcraft.example:0/",
"wss://figcraft.example:65536/",
"wss://figcraft.example:port/",
"wss://[::1/",
"wss://figcraft.example/a@b/",
] {
assert_eq!(page_server(bad), None, "{bad:?} must not replace the default server");
}
}
#[test]
fn a_page_preserves_valid_server_endpoint_spelling() {
for server in ["ws://localhost:47900/", "wss://figcraft.example/figcraft/", "wss://[::1]:47900/figcraft/"] {
assert_eq!(page_server(server).as_deref(), Some(server), "{server}");
}
}
#[test]
fn a_page_rejects_server_delimiters_that_endpoint_parsing_would_strip() {
for suffix in ["'", "\"", "<", ">", "\"'>"] {
let server = format!("wss://figcraft.example/{suffix}");
assert!(figcraft_collab_net::Endpoint::parse(&server).is_ok(), "the parser cleans {server:?}");
assert_eq!(page_server(&server), None, "{server:?} must not replace the default server");
}
}
+36 -1
View File
@@ -23,6 +23,11 @@ pub struct Swapped {
pub styles: usize,
pub variables: usize,
pub unmatched: Vec<String>,
/// The old library's copies the swap removed because nothing in the document used them before
/// it (an imported component no instance shows, a variable nothing binds), named as in
/// `unmatched`. Copies that went because what used them moved to the other library aren't
/// listed.
pub dropped: Vec<String>,
/// Nothing of the old library is used any more: it was removed from the document.
pub removed: bool,
}
@@ -70,15 +75,45 @@ fn match_components(doc: &Document, records: &[ImportedComponent], m: &LibraryMa
pairs
}
/// `from`'s copies in `doc`, each by its local id with its name as [`Swapped::dropped`] gives it.
fn copies_of(doc: &Document, from: &str) -> Vec<(String, String)> {
let libs = &doc.libraries;
let coll_name = |id: &str| doc.variables.collection_by_id(id).map(|c| c.name.clone()).unwrap_or_default();
let components = libs
.components
.iter()
.filter(|r| r.library == from)
.map(|r| (format!("node {}", r.root.0), format!("component {}", doc.node(r.root).map(|n| n.name.as_str()).unwrap_or_default())));
let styles = libs
.styles
.iter()
.filter(|r| r.library == from)
.map(|r| (format!("style {}", r.local), format!("style {}", doc.style(&r.local).map(|st| st.name.as_str()).unwrap_or_default())));
let variables = libs.variables.iter().filter(|r| r.library == from).map(|r| {
let name = doc.variables.get_by_id(&r.local).map(|v| format!("{}/{}", coll_name(&v.collection), v.name)).unwrap_or_default();
(format!("variable {}", r.local), format!("variable {name}"))
});
let collections = libs
.collections
.iter()
.filter(|r| r.library == from)
.map(|r| (format!("collection {}", r.local), format!("collection {}", coll_name(&r.local))));
components.chain(styles).chain(variables).chain(collections).collect()
}
/// Swap the copies of library `from` in `doc` to library `to` by names (see the module docs).
pub fn swap_library(doc: &mut Document, from: &str, to: &PublishedLibrary) -> Result<Swapped> {
let m = &to.manifest;
if m.id == from {
return Err(EngineError::Other("that is the same library".into()));
}
// Only what the document uses counts (copies nothing uses any more go first).
// Only what the document uses counts: copies nothing uses any more go first, and are listed
// (#2569). Those the final prune takes were in use, by what moved to B.
let before = copies_of(doc, from);
prune(doc, from)?;
let mut out = Swapped::default();
let kept: BTreeSet<String> = copies_of(doc, from).into_iter().map(|(id, _)| id).collect();
out.dropped = before.into_iter().filter(|(id, _)| !kept.contains(id)).map(|(_, name)| name).collect();
let store = doc.library_store();
let outside = |d: &Document, id: NodeId| store.is_none_or(|s| d.page_of(id) != Some(s));
@@ -180,3 +180,38 @@ fn swap_repoints_colour_calculations() {
let reads: Vec<&VariableId> = ["veil", "wash"].iter().flat_map(|n| vars.get(n).unwrap().values.values()).flat_map(|v| v.references()).collect();
assert!(reads.iter().all(|r| doc.libraries.variable_import(r).is_some_and(|i| i.library == b)), "{reads:?}");
}
/// Copies of A nothing uses (a component imported but not placed, a variable imported but not
/// bound) go with the swap, as they did; the result now names them (#2569). A copy the swap moves
/// to B isn't among them.
#[test]
fn swap_lists_the_unused_copies_it_removes() {
let (_dir, mut s, a, b) = two_libraries("unused", &["Only in A"]);
let placed = idv(&ex(&mut s, "library.place", json!({"library": a, "component": "Button", "x": 0, "y": 0})));
let only = id_of(&ex(&mut s, "library.import", json!({"library": a, "component": "Only in A"}))["component"]).unwrap();
ex(&mut s, "library.importVariable", json!({"library": a, "variable": "accent"}));
let r = ex(&mut s, "library.swap", json!({"from": a, "to": b}));
assert_eq!(r["dropped"], json!(["component Only in A", "variable Theme/accent", "collection Theme"]), "{r}");
assert_eq!((r["components"].as_u64(), r["variables"].as_u64(), &r["unmatched"]), (Some(1), Some(0), &json!([])), "{r}");
assert_eq!(r["removed"], true, "{r}");
let doc = s.doc().unwrap();
assert!(!doc.contains(only), "the dropped copy is gone");
assert_eq!(library_of(doc, main_of(&s, placed)), Some(b.as_str()), "the placed Button moved, so it isn't listed");
assert!(doc.variables.variables.is_empty() && doc.variables.collections.is_empty(), "{:?}", doc.variables);
// One undo step brings them back.
s.undo().unwrap();
let doc = s.doc().unwrap();
assert!(doc.contains(only) && library_of(doc, only) == Some(a.as_str()));
assert_eq!(doc.variables.variables.len(), 1);
// A deleted instance leaves its copy unused, so it is listed too; a placed copy B has no match
// for stays and is listed as unmatched.
ex(&mut s, "edit.delete", json!({"ids": [placed]}));
let kept = idv(&ex(&mut s, "library.place", json!({"library": a, "component": "Only in A", "x": 0, "y": 0})));
let r = ex(&mut s, "library.swap", json!({"from": a, "to": b}));
assert_eq!(r["dropped"], json!(["component Button", "variable Theme/accent", "collection Theme"]), "{r}");
assert_eq!((&r["unmatched"], &r["removed"]), (&json!(["component Only in A"]), &json!(false)), "{r}");
assert_eq!(library_of(s.doc().unwrap(), main_of(&s, kept)), Some(a.as_str()));
}
+5 -1
View File
@@ -55,5 +55,9 @@ pub fn openable(url: &str) -> bool {
// The authority is made of host characters only (an opener that can't parse the address may
// fall back to treating it as a file path).
let authority = after.split(['/', '?', '#']).next().unwrap_or_default();
authority.chars().all(|c| !c.is_ascii() || c.is_ascii_alphanumeric() || "-._~:@[]%!$&'()*+,;=".contains(c))
// A query, fragment, userinfo or port alone does not supply a host.
let host = authority.rsplit('@').next().unwrap_or_default();
!host.is_empty()
&& !host.starts_with(':')
&& authority.chars().all(|c| !c.is_ascii() || c.is_ascii_alphanumeric() || "-._~:@[]%!$&'()*+,;=".contains(c))
}
+4 -2
View File
@@ -67,7 +67,7 @@ pub fn specs() -> Vec<CommandSpec> {
spec!(
"library.swap",
"Swap library",
"{from (an enabled library: id, name or path), to (another enabled library)} re-points every component instance, style and variable copied from `from` to the published one of the same name in `to` (instances keep their overrides) → {components, styles, variables, unmatched: [names still from `from`], removed (nothing of `from` is used any more: it was removed)}",
"{from (an enabled library: id, name or path), to (another enabled library)} re-points every component instance, style and variable copied from `from` to the published one of the same name in `to` (instances keep their overrides) → {components, styles, variables, unmatched: [names still from `from`], dropped: [names of `from`'s copies nothing used (a component imported but not placed, a variable imported but not bound): removed, not moved], removed (nothing of `from` is used any more: it was removed)}",
true,
swap_cmd
),
@@ -599,7 +599,9 @@ fn swap_cmd(s: &mut Session, p: &Value) -> Result<Value> {
return Err(bad(cmd, "`from` and `to` are the same library"));
}
let r = crate::library_swap::swap_library(s.doc_mut()?, &from, &lib)?;
Ok(json!({"components": r.components, "styles": r.styles, "variables": r.variables, "unmatched": r.unmatched, "removed": r.removed}))
Ok(
json!({"components": r.components, "styles": r.styles, "variables": r.variables, "unmatched": r.unmatched, "dropped": r.dropped, "removed": r.removed}),
)
}
fn assets_json(lib: &PublishedLibrary) -> Value {
+10
View File
@@ -9,17 +9,27 @@ fn web_links_are_opened() {
"http://example.com",
"https://example.com",
"https://example.com/a/b?c=d#e",
"https://example.com?c=d",
"https://example.com#e",
"HTTPS://EXAMPLE.COM",
"HtTp://example.com",
"mailto:a@b.c",
"mailto:a@b.c?subject=hi",
" https://example.com ",
"https://user:pw@example.com:8443/p",
"https://user:pw@[::1]:8443/p",
] {
assert!(openable(url), "{url:?} should open");
}
}
#[test]
fn web_links_without_a_host_are_refused() {
for url in ["https://?c=d", "http://#e", "https://user@", "https://user@:443/p", "https://:443/p", "https://user:pw@?c=d", "https://@#e"] {
assert!(!openable(url), "{url:?} must be refused");
}
}
#[test]
fn script_and_handler_schemes_are_refused() {
for url in [
+138 -2
View File
@@ -373,6 +373,11 @@ fn changed_areas(doc: &Document, page: NodeId, id: NodeId, out: &mut Vec<Rect>)
}
out.push(draw::paint_bounds(doc, parent)?);
}
ancestor_areas(doc, id, out)
}
/// The areas of the ancestors of `id` that a change to it affects, beyond its own.
fn ancestor_areas(doc: &Document, id: NodeId, out: &mut Vec<Rect>) -> Option<()> {
// Ancestors that paint from their children's pixels (booleans, effects, masks): all of them.
for a in doc.ancestors(id) {
let Some(an) = doc.node(a) else { break };
@@ -386,6 +391,138 @@ fn changed_areas(doc: &Document, page: NodeId, id: NodeId, out: &mut Vec<Rect>)
Some(())
}
/// Page areas in which `id` looks different in `after` than in `before` (where it was and where
/// it is now, and what of its ancestors follows); `None` when only a full render will do.
fn edited_areas(before: &Document, after: &Document, page: NodeId, id: NodeId, out: &mut Vec<Rect>) -> Option<()> {
// A vector whose points moved looks different only around them.
if let Some(area) = moved_points_area(before, after, page, id) {
out.push(area);
ancestor_areas(before, id, out)?;
return ancestor_areas(after, id, out);
}
changed_areas(before, page, id, out)?;
changed_areas(after, page, id, out)
}
/// Vectors with more points than this are drawn again whole when they change.
const MAX_MOVED_POINTS: usize = 4096;
/// Whether every visible paint of `paints` is one colour: it looks the same wherever the layer's
/// box lies (a gradient or an image is laid out in the box).
fn plain(paints: &[figcraft_color::Paint]) -> bool {
paints.iter().filter(|p| p.visible).all(|p| matches!(p.kind, figcraft_color::PaintKind::Solid { .. }))
}
/// The page area in which vector `id` looks different in `after` than in `before`, when all that
/// changed is where its points and handles are (a point dragged in the vector editor): around the
/// segments that moved and their neighbours (whose joins and rounded corners follow them), as far
/// out as the stroke reaches. The rest of a large shape keeps its pixels, however much of the
/// view it fills. `None` when anything else changed or the look depends on the whole outline
/// (dashes, a width profile, a brush, gradients and images laid out in the box, effects, a mask):
/// the layer is then drawn again whole.
fn moved_points_area(before: &Document, after: &Document, page: NodeId, id: NodeId) -> Option<Rect> {
let (a, b) = (before.node(id)?, after.node(id)?);
let (NodeKind::Vector { network: na }, NodeKind::Vector { network: nb }) = (&a.kind, &b.kind) else { return None };
if after.page_of(id) != Some(page) || before.page_of(id) != Some(page) {
return None;
}
let simple = |n: &figcraft_doc::Node, net: &figcraft_doc::VectorNetwork| {
!n.is_mask
&& n.visible
&& !n.effects.iter().any(|e| e.visible)
&& n.stroke.dashes.is_empty()
&& n.stroke.width_profile.is_none()
&& n.stroke.brush.is_none()
&& plain(&n.fills)
&& plain(&n.strokes)
&& net.regions.iter().all(|r| r.fills.as_deref().is_none_or(plain))
};
let same_shape = na.vertices.len() == nb.vertices.len()
&& na.vertices.len() <= MAX_MOVED_POINTS
&& na.segments.len() == nb.segments.len()
&& na.segments.iter().zip(&nb.segments).all(|(x, y)| (x.a, x.b) == (y.a, y.b))
&& na.regions.len() == nb.regions.len()
&& na.regions.iter().zip(&nb.regions).all(|(x, y)| x.loops == y.loops && x.winding == y.winding && x.fills == y.fills);
if !(simple(a, na) && simple(b, nb) && same_shape) {
return None;
}
// A fill closes an open path with a line between its ends that is no segment: it moves
// with either end, across the whole shape.
let mut ends = vec![0u8; na.vertices.len()];
for s in &na.segments {
for i in [s.a, s.b] {
let n = ends.get_mut(i)?;
*n = n.saturating_add(1);
}
}
let filled = a.fills.iter().any(|f| f.visible) || !na.regions.is_empty();
if filled && ends.contains(&1) {
return None;
}
// Nothing but the geometry differs: the box follows the points, and with it the transform.
let mut as_after = a.clone();
as_after.kind = b.kind.clone();
(as_after.transform, as_after.width, as_after.height) = (b.transform, b.width, b.height);
if as_after != *b {
return None;
}
let (wa, wb) = (before.world_transform(id), after.world_transform(id));
// The box following the points moves the layer; anything else a transform does (a scale, a
// turn) changes every stroke's width or direction on the page, whether its path moved or not.
let (ca, cb) = (wa.as_coeffs(), wb.as_coeffs());
if ca.iter().zip(&cb).take(4).any(|(x, y)| (x - y).abs() > 1e-12 * x.abs().max(1.0)) {
return None;
}
// A segment on the page: its ends and handles.
let hull = |w: figcraft_geom::Affine, net: &figcraft_doc::VectorNetwork, s: &figcraft_doc::Segment| {
let (pa, pb) = (net.vertices.get(s.a)?.point(), net.vertices.get(s.b)?.point());
let pts = [pa, pa + figcraft_geom::Vec2::new(s.ta.0, s.ta.1), pb + figcraft_geom::Vec2::new(s.tb.0, s.tb.1), pb].map(|p| w * p);
pts.iter().all(|p| p.x.is_finite() && p.y.is_finite()).then_some(pts)
};
let mut moved = vec![false; na.vertices.len()];
let mut hulls = Vec::with_capacity(na.segments.len());
for (sa, sb) in na.segments.iter().zip(&nb.segments) {
let (ha, hb) = (hull(wa, na, sa)?, hull(wb, nb, sb)?);
// Apart by more than float noise. When the box follows a moved point every local
// coordinate shifts and the transform shifts back: a point that stayed put comes out a
// few ulps from where it was. 64 of them is far above that and far under a pixel at any
// zoom, wherever on the page the vector lies (a tenth of a millionth of a unit at
// coordinates of ten million).
let near = |x: f64, y: f64| (x - y).abs() <= 64.0 * f64::EPSILON * x.abs().max(y.abs()).max(1.0);
let apart = ha.iter().zip(&hb).any(|(p, q)| !(near(p.x, q.x) && near(p.y, q.y)));
let styled =
|i: usize| na.vertices.get(i).zip(nb.vertices.get(i)).is_none_or(|(x, y)| (x.radius, x.cap, x.join) != (y.radius, y.cap, y.join));
if apart || styled(sa.a) || styled(sa.b) {
for i in [sa.a, sa.b] {
*moved.get_mut(i)? = true;
}
}
hulls.push((ha, hb));
}
// Every segment at a point of a segment that moved: its join or rounded corner there follows.
let mut area: Option<Rect> = None;
for (s, (ha, hb)) in na.segments.iter().zip(&hulls) {
if moved.get(s.a).copied().unwrap_or(true) || moved.get(s.b).copied().unwrap_or(true) {
for p in ha.iter().chain(hb) {
let r = Rect::from_points(*p, *p);
area = Some(area.map_or(r, |a| a.union(r)));
}
}
}
let area = area?;
// As far as the stroke reaches from the path, on the page.
// The most the transform stretches a length in any direction (its largest singular value):
// under a skew that is more than either axis is stretched.
let stretch = |w: figcraft_geom::Affine| {
let c = w.as_coeffs();
let sum = c[0] * c[0] + c[1] * c[1] + c[2] * c[2] + c[3] * c[3];
let det = c[0] * c[3] - c[1] * c[2];
((sum + (sum * sum - 4.0 * det * det).max(0.0).sqrt()) / 2.0).sqrt()
};
let reach = (a.outline_reach() * stretch(wa)).max(b.outline_reach() * stretch(wb));
reach.is_finite().then(|| area.inflate(reach, reach))
}
/// The previous frame brought up to date for `doc` at `px`, rendering only what changed; `None`
/// when a full render is the better (or only correct) choice. Also returns the pixels rendered.
fn patch(last: Frame, doc: &Arc<Document>, page: NodeId, view: &View, px: (i64, i64), opts: &Options, s: &Sensitive) -> Option<(Pixmap, u64)> {
@@ -434,8 +571,7 @@ fn patch(last: Frame, doc: &Arc<Document>, page: NodeId, view: &View, px: (i64,
if in_pattern_source(doc, s, id) || in_pattern_source(&last.doc, &last.sensitive, id) {
return None;
}
changed_areas(&last.doc, page, id, &mut areas)?;
changed_areas(doc, page, id, &mut areas)?;
edited_areas(&last.doc, doc, page, id, &mut areas)?;
}
for r in areas {
if let Some(p) = to_px(r, view.scale, px) {
+133
View File
@@ -65,3 +65,136 @@ fn a_clip_edge_on_a_pixel_boundary_clips_the_same_in_every_render() {
assert_same(&pix, &render_view(&smaller, page, &shown, &opts).unwrap(), &format!("lod {lod}"));
}
}
/// A closed zigzag of `2 * teeth + 2` points, 240 × 120 units at (20, 20): a ridge.
fn ridge(d: &mut Document, page: NodeId, teeth: usize) -> NodeId {
let mut pts = vec![figcraft_geom::Point::new(0.0, 120.0)];
for i in 0..=teeth * 2 {
pts.push(figcraft_geom::Point::new(240.0 * i as f64 / (teeth * 2) as f64, if i % 2 == 0 { 60.0 } else { 10.0 }));
}
pts.push(figcraft_geom::Point::new(240.0, 120.0));
let network = figcraft_doc::VectorNetwork::from_points(&pts, true);
let id = d.create(page, NodeKind::Vector { network }, "Ridge", 20.0, 20.0, 240.0, 120.0).unwrap();
d.get_mut(id).unwrap().fills = vec![Paint::solid(Color::from_hex("7FAE9C").unwrap())];
id
}
fn move_point(d: &mut Document, id: NodeId, point: usize, by: (f64, f64)) {
if let NodeKind::Vector { network } = &mut d.get_mut(id).unwrap().kind {
network.vertices[point].x += by.0;
network.vertices[point].y += by.1;
}
}
/// A point of a vector dragged while the vector fills the view (zoomed to it, as the vector
/// editor does): the shape looks different only around the point's segments, and only that is
/// drawn again. (Its whole box was, and past 60 % of the view that made every frame of the
/// drag a full render.)
#[test]
fn a_moved_point_redraws_the_vector_around_it_only() {
type Style = fn(&mut figcraft_doc::Node);
let styles: [(&str, Style); 4] = [
("filled", |_| {}),
("stroked, mitred", |n| {
n.strokes = vec![Paint::solid(Color::from_hex("203040").unwrap())];
n.stroke.weight = 6.0;
n.stroke.miter_limit = 4.0;
}),
("rounded points", |n| {
if let NodeKind::Vector { network } = &mut n.kind {
network.vertices.iter_mut().for_each(|v| v.radius = 9.0);
}
}),
("stroked only", |n| {
n.fills.clear();
n.strokes = vec![Paint::solid(Color::from_hex("203040").unwrap())];
n.stroke.weight = 3.0;
}),
];
for (what, style) in styles {
let mut d = Document::new("ridge");
let page = d.first_page().unwrap();
let id = ridge(&mut d, page, 6);
style(d.get_mut(id).unwrap());
let doc = Arc::new(d);
// The ridge is 720 × 360 of the view's 780 × 420 pixels.
let v = View { origin: (10.0, 10.0), scale: 3.0, width: 780, height: 420 };
let mut r = Retained::default();
check(&mut r, &doc, page, &v, what);
let mut d2 = (*doc).clone();
move_point(&mut d2, id, 6, (4.0, -7.0));
let d2 = Arc::new(d2);
let (_, _, work) = r.render(&d2, page, &v, &Options::default()).unwrap();
let Work::Partial { pixels } = work else { panic!("{what}: a full render ({work:?})") };
// A tooth of six each way from the point, and what the stroke adds (36 pixels each way
// for the mitred one); the ridge's box is 259,200 pixels.
assert!(pixels < 780 * 420 * 2 / 5, "{what}: {pixels} pixels drawn again");
check(&mut r, &d2, page, &v, what);
// And back: the same again.
let (_, _, work) = r.render(&doc, page, &v, &Options::default()).unwrap();
assert!(matches!(work, Work::Partial { .. }), "{what}: {work:?}");
check(&mut r, &doc, page, &v, what);
}
}
/// What depends on the whole outline is drawn again whole: a gradient laid out in the vector's
/// box, dashes that run on from the moved point, an open path's closing line.
#[test]
fn a_moved_point_redraws_a_vector_whole_when_its_look_depends_on_all_of_it() {
type Style = fn(&mut figcraft_doc::Node);
let styles: [(&str, Style); 3] = [
("dashed", |n| {
n.strokes = vec![Paint::solid(Color::from_hex("203040").unwrap())];
n.stroke.weight = 3.0;
n.stroke.dashes = vec![8.0, 5.0];
}),
("a shadow", |n| n.effects.push(Effect::inner_shadow())),
("an open path", |n| {
if let NodeKind::Vector { network } = &mut n.kind {
network.segments.pop();
}
}),
];
for (what, style) in styles {
let mut d = Document::new("ridge");
let page = d.first_page().unwrap();
let id = ridge(&mut d, page, 6);
style(d.get_mut(id).unwrap());
let doc = Arc::new(d);
let v = View { origin: (10.0, 10.0), scale: 3.0, width: 780, height: 420 };
let mut r = Retained::default();
check(&mut r, &doc, page, &v, what);
let mut d2 = (*doc).clone();
move_point(&mut d2, id, 6, (4.0, -7.0));
let d2 = Arc::new(d2);
assert_eq!(r.render(&d2, page, &v, &Options::default()).unwrap().2, Work::Full, "{what}");
check(&mut r, &d2, page, &v, what);
}
}
/// A vector's strokes are as wide on the page as its transform makes them. Scaled up with its
/// points scaled down to match, its paths stay where they were and every stroke doubles: with a
/// point moved too, all of it is drawn again, not the area around that point.
#[test]
fn a_moved_point_with_a_scaled_vector_redraws_all_of_it() {
let mut d = Document::new("ridge");
let page = d.first_page().unwrap();
let id = ridge(&mut d, page, 6);
let n = d.get_mut(id).unwrap();
n.strokes = vec![Paint::solid(Color::from_hex("203040").unwrap())];
n.stroke.weight = 3.0;
let doc = Arc::new(d);
let v = View { origin: (10.0, 10.0), scale: 3.0, width: 780, height: 420 };
let mut r = Retained::default();
check(&mut r, &doc, page, &v, "first");
let mut d2 = (*doc).clone();
let n = d2.get_mut(id).unwrap();
n.transform *= Affine::scale(2.0);
(n.width, n.height) = (n.width / 2.0, n.height / 2.0);
if let NodeKind::Vector { network } = &mut n.kind {
for p in &mut network.vertices {
(p.x, p.y) = (p.x / 2.0, p.y / 2.0);
}
}
move_point(&mut d2, id, 6, (2.0, -3.5));
check(&mut r, &Arc::new(d2), page, &v, "scaled, a point moved");
}
+6 -3
View File
@@ -126,7 +126,7 @@ page 1 "Screens": 380 nodes, 4 top-level
### `export <file> -o <out> [--format png|jpg|svg|webp|pdf|xml|fig|penpot] [--scale N] [--page NAME] [--node ID|NAME] [--bleed LENGTH] [--crop-marks] [--bleed-marks] [--cmyk] [--vd-compat bestEffort|exact|ignore]`
- `<out>` is a directory: one file per top-level frame of the page (default the first page), named
- `<out>` is a directory: one file per top-level frame of the selected page, named
after the frame (`Home.png`, `Settings.png`…); with no frames, one file per top-level layer.
The name is kept as it is, except for the characters file systems refuse (`/ \ : * ? " < > |`
and control characters), which become `_`, and leading or trailing spaces and dots, which are
@@ -135,6 +135,9 @@ page 1 "Screens": 380 nodes, 4 top-level
characters (there a `/` makes a folder). Two layers with the same name get `Name 2`, `Name 3`…
With `--node`, the CLI writes one file named after the selected layer, including a nested layer.
- `<out>` has an image extension: one file with the given `--node`, or the whole page composited.
- `--page` defaults to the first non-divider page: empty pages whose names start with `-` are
skipped. If all pages are dividers, the first is used. `--page NAME` can select one explicitly.
The `.fig` and `.penpot` formats export the whole document and ignore `--page`.
- `--node` takes a layer id (`12` or `0:12`) or a layer name.
- `--format fig` (or an `<out>` ending in `.fig`) writes the whole file as `.fig`, experimental:
written from public format notes, including variables with their modes and bindings and shared
@@ -198,8 +201,8 @@ When converting from a `.penpot` file, import warnings are printed to stderr as
### `render <file> -o <out.png> [--scale N] [--page NAME]`
The whole page (default the first) with its background, as png, jpg or webp. Large pages are scaled
down to fit 16384 px.
The whole page with its background, as png, jpg or webp. `--page` defaults to the first non-divider
page, as for `export`. Large pages are scaled down to fit 16384 px.
### `run <script.json|script.jsonl> [--in <file>] [--out <file>]`
+3 -2
View File
@@ -1,6 +1,6 @@
# Components, variants, styles and variables parity
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-23 · **Change:** minor (with several instances selected, the Design panel shows the properties they share, Mixed where their values differ, and sets a value on all of them; an enabled library's styles are offered in the style pickers without opening the Assets tab first, and the picker filters its list by source (All libraries, This file, one library); with a variable group shown in the Local variables window, Create variable makes the variable in that group, and renaming a variable in its row changes the part shown and keeps its group; a layer inside an instance bound to a variable its main layer doesn't bind keeps that binding as an override when instances are relinked after an import, a detach or a restore, and when its value is set back to the main's, so a library copy or an edit of the main no longer drops it; switching variants keeps the text typed into an instance when the other variant nests that text layer in other frames, matched by its name; a main component copied from a library file and pasted into another file is an instance of it from that library, instead of a new main; copied variants pasted with their own set, or a layer in it, selected join the set as new variants; the Scale tool keeps variable-bound lengths scaled: a scaled instance keeps its bindings and draws them at the variable's value times its scale factor, other scaled layers keep the scaled value and drop the binding (#2090); a style of one library that reaches a file through another library's component is, in a file linking both, the first library's own bound copy, so its modes colour it (#2414); with a variant selected, its property dropdowns show its own values and choosing one renames only that variant, instead of setting the set's default and moving the variants (#2349); library analytics count insertions and detachments of styles and variables; combining components gives every variant the properties any of them had; renaming a variable group to a path with `/` nests it under a parent group instead of turning the slash into a hyphen (#2353); a group's context menu in the Local variables window has Duplicate group, a copy named after it plus " 2" holding a copy of every variable, in one undo step (#2084); pages take a variable mode: with nothing selected the Design panel's Page section shows a Variable modes section, Auto or a mode of each collection that has more than one, as the help center says ("Apply variable mode" in the Page section of the right sidebar) (#2215); a text style binds a number variable to its weight (#2174); an instance lists only the properties its variant's layers use and long property names are cut to one line (#2022); with several layers selected the Design panel header's component button offers Create multiple components (#2088); the Local variables window selects several variables (click, Shift+click for a range, Cmd/Ctrl+click to toggle, Escape to clear) and delete, move to a group and scope act on the selected local variables in one undo step (#2002); text styles carry paragraph spacing and indent, the list style and the OpenType features, as the Supported in text styles table of Create and apply text styles says (#1829); a layer's effect binding takes only a field its effect has; Go to main component on an instance of a library component opens the library file in a tab and selects the main there; glass effects take variables; Delete on a layer inside an instance hides it as an override instead of being refused, as the help center says: "Figma will only toggle the layer's visibility instead of removing it"; library analytics list how many layers and files use each style and variable; SwiftUI and Compose code names a bound variable by its iOS or Android code syntax; library analytics count insertions and show insertions and detachments over the past 30 days, 90 days or year; a collection of this file can be extended (Extend collection on its row, `variable.extendCollection`), its extension following its edits at once, and extended collections extend again in the file; a typed or stored variable, collection or mode id names only the object with that id (#1613); colour variables can be calculated from other colours per mode — `{alpha}` replaces a colour's alpha, `{mix}` blends two — and follow them (#1280); stored variable and collection references keep their identity when another object is named like their id (follow-up to #1542); a component set's property rows fit the 240 px right panel: variant values wrap two to a line there and every + and − stays in view; opening a file contacts no team library server it names until you check it (#1097); an explicit variables file path (`variable.import`, the `variables` of `file.open` and `file.import`) is refused past 256 MiB or when it isn't a regular file, as the sibling `variables.json` already was (part of #1114); component properties keep the order they were made in when one is renamedLine truncated
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-23 · **Change:** minor (`library.swap` lists the unused copies of the old library it removes in `dropped` (#2569); with several instances selected, the Design panel shows the properties they share, Mixed where their values differ, and sets a value on all of them; an enabled library's styles are offered in the style pickers without opening the Assets tab first, and the picker filters its list by source (All libraries, This file, one library); with a variable group shown in the Local variables window, Create variable makes the variable in that group, and renaming a variable in its row changes the part shown and keeps its group; a layer inside an instance bound to a variable its main layer doesn't bind keeps that binding as an override when instances are relinked after an import, a detach or a restore, and when its value is set back to the main's, so a library copy or an edit of the main no longer drops it; switching variants keeps the text typed into an instance when the other variant nests that text layer in other frames, matched by its name; a main component copied from a library file and pasted into another file is an instance of it from that library, instead of a new main; copied variants pasted with their own set, or a layer in it, selected join the set as new variants; the Scale tool keeps variable-bound lengths scaled: a scaled instance keeps its bindings and draws them at the variable's value times its scale factor, other scaled layers keep the scaled value and drop the binding (#2090); a style of one library that reaches a file through another library's component is, in a file linking both, the first library's own bound copy, so its modes colour it (#2414); with a variant selected, its property dropdowns show its own values and choosing one renames only that variant, instead of setting the set's default and moving the variants (#2349); library analytics count insertions and detachments of styles and variables; combining components gives every variant the properties any of them had; renaming a variable group to a path with `/` nests it under a parent group instead of turning the slash into a hyphen (#2353); a group's context menu in the Local variables window has Duplicate group, a copy named after it plus " 2" holding a copy of every variable, in one undo step (#2084); pages take a variable mode: with nothing selected the Design panel's Page section shows a Variable modes section, Auto or a mode of each collection that has more than one, as the help center says ("Apply variable mode" in the Page section of the right sidebar) (#2215); a text style binds a number variable to its weight (#2174); an instance lists only the properties its variant's layers use and long property names are cut to one line (#2022); with several layers selected the Design panel header's component button offers Create multiple components (#2088); the Local variables window selects several variables (click, Shift+click for a range, Cmd/Ctrl+click to toggle, Escape to clear) and delete, move to a group and scope act on the selected local variables in one undo step (#2002); text styles carry paragraph spacing and indent, the list style and the OpenType features, as the Supported in text styles table of Create and apply text styles says (#1829); a layer's effect binding takes only a field its effect has; Go to main component on an instance of a library component opens the library file in a tab and selects the main there; glass effects take variables; Delete on a layer inside an instance hides it as an override instead of being refused, as the help center says: "Figma will only toggle the layer's visibility instead of removing it"; library analytics list how many layers and files use each style and variable; SwiftUI and Compose code names a bound variable by its iOS or Android code syntax; library analytics count insertions and show insertions and detachments over the past 30 days, 90 days or year; a collection of this file can be extended (Extend collection on its row, `variable.extendCollection`), its extension following its edits at once, and extended collections extend again in the file; a typed or stored variable, collection or mode id names only the object with that id (#1613); colour variables can be calculated from other colours per mode — `{alpha}` replaces a colour's alpha, `{mix}` blends two — and follow them (#1280); stored variable and collection references keep their identity when another object is named like their id (follow-up to #1542); a component set's property rows fit the 240 px right panel: variant values wrap two to a line there and every + and − stays in view; opening a file contacts no team library server it names until you check it (#1097); an explicit variables file path (`variable.import`, the `variables` of `file.open` and `file.import`) is refused past 256 MiB or when it isn't a regular file, as the sibling `variables.json` already wasLine truncated
Design systems are why teams adopt Figma. **Components: breadth ~96%, ready ~72%. Styles and
variables: breadth ~95%, ready ~76% (estimated).** QA'd with a synthetic design system of ~300
@@ -56,7 +56,7 @@ updates with overrides kept: `library_tests.rs`, `components_scale_tests.rs`.
| Library updates available; overrides kept | done | a library file saved again within two seconds of being read, at the same length, is read again (its time stamp can't prove it unchanged; #652) |
| Team libraries: publish to a `figcraft-server` under the file, enable by a share link (a view link reads it), background update checks | done | [server.md](server.md#team-libraries); no team-wide library list or accounts ([gaps](gaps.md) #10) |
| Library analytics | partial | instances per component and the files using them, and the instances each file detached (per component and per file), as apps report them; insertions and detachments week by week for a year (Show usage: the past 30 days, 90 days or year), for components; the layers and files using each style and variable, with their insertions and detachments over the same periods, no modes; no chart |
| Swap library (instances, styles and variables to another library's of the same names, overrides kept) | done | what has no match stays and is listed; one undo step |
| Swap library (instances, styles and variables to another library's of the same names, overrides kept) | done | what has no match stays and is listed; one undo step; copies nothing used before the swap (imported, never placed or bound) are removed and listed in `dropped` (#2569) |
## Styles and variables
@@ -87,6 +87,7 @@ updates with overrides kept: `library_tests.rs`, `components_scale_tests.rs`.
| 2026-11-19 | patch | M3: overrides found by comparing a layer with its main (`rebase_instance`: linking instances after a Figma or REST import, detaching an outer instance, restoring a main) counted values only, so a layer bound to a variable the main layer doesn't bind, resolving to the main's colour, wasn't an override; the next copy or edit of the main (a library update reaching another file) reset it to the main's unbound paint. Icons inside buttons of a design system imported from Figma lost their colour variable this way in the files using it. A binding that differs from the main's is now an override there, and an edit that sets the value back to the main's (hiding and showing the fill) no longer clears an override the binding still makes; `fill` and `fills/0/color` count as one binding. Tests: `nested_binding_tests` |
| 2026-11-19 | patch | M3: with a group selected in the Local variables window, + Create variable named the new variable without the group, so it went to the collection's top level and the table, showing the group, didn't show it; only All variables did. It's now made in the group shown (`space/Number`), as in Figma, where duplicating already kept the group. Renaming a variable in its row edited its whole name while the row shows the last part, so typing a name over a new grouped variable moved it out of the group; the field now edits the part shown and keeps the group (the Edit variable window still edits the whole name), and ignores a name of slashes alone. Creating a collection clears the group shown. Tests: `variables_group_create_tests` |
| 2026-11-18 | patch | M3: enabled libraries were read only while the Assets panel showed, so after a file was opened the Design panel's style pickers offered none of their styles (a library's text styles read "No text styles yet") until the Assets tab had been opened. They are refreshed from the app's background tick now, a local library not read yet at once. The style picker has a source menu under its search field, as in Figma: All libraries (the default), This file, or one enabled library. Test: `style_picker::tests::a_reopened_files_text_styles_picker_lists_its_librarys_styles_without_the_assets_tab` |
| 2026-11-23 | patch | M3, #2569: `library.swap {from, to}` removes `from`'s copies that nothing in the file uses before it starts (a component imported with `library.import` but not placed, a variable imported but not bound), as `library.remove` does, but its result didn't say so: `{"components": 0, "unmatched": [], "removed": true}` after an imported component had been deleted. The result now names them in `dropped` (`component auth-button`, `variable Theme/accent`, `collection Theme`), apart from copies that went because what used them moved to `to`. Test: `library_swap/tests.rs` (`swap_lists_the_unused_copies_it_removes`) |
| 2026-11-19 | patch | M3, #2414: a kit's style used by a component of a second library reached a file linking both as a second, unbound copy (`<auth>:<kit>:S:1`) frozen in the kit's default mode, so a mode set on the kit's collection didn't colour it (from two hops on, every such style). Publishing now keeps the variables the published styles bind and where the file's copies of other libraries' styles, variables and collections came from; importing files such a copy under that library when the file links it, so it is the file's own bound copy. Test: `library_style_hops_tests::a_kit_style_through_another_library_is_the_kits_bound_copy`; the issue's four-file chain renders Brand and Alt everywhere. Grade unchanged. |
| 2026-11-19 | patch | M3, #2349: with one variant of a set selected, the Design panel's variant property dropdowns showed the set's default values, and choosing a value set the default, so the variants swapped places. They now show the selected variant's own values (hover: "This variant's value"), and choosing one renames that variant only; with the set selected they still set its default. Test: `variant_own_value_tests::a_selected_variants_dropdown_shows_and_sets_its_own_value`. Grade unchanged. |
| 2026-11-18 | minor | M3, gap 10: library analytics count insertions and detachments of styles and variables. Applying one, 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 per style and variable over the chosen period. Modes aren't counted. Numbers unchanged. Tests: `library_asset_counts_tests`, `library_assets_tests`. |
+11 -1
View File
@@ -1,6 +1,6 @@
# Where FigCraft falls short of Figma
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-19 · **Change:** minor (gap 24: mind maps from the toolbar and the keyboard (#2226); gap 24: code blocks, first step (`board.codeBlock`, `board.setLanguage`, #2237); gap 10: library analytics count insertions and detachments of styles and variables; gap 6: the browser build uses team libraries and plugin directories on a server; gap 7: a pan past the canvas image shows a coarse image of the area around the view on the desktop, not the bare page colour; gap 7: the strips a pan uncovers render in parallel bands; gap 7: the desktop refines a zoom's preview once the zoom has paused; gap 1: the `.fig` export writes vector region paints (#2302); gap 13: a boolean group's corner radius (#2222); gap 24: mind maps, first step: a first node with three children on curved branches, laid out again after every edit (`board.mindMap`, `board.mindMapAdd`, #2226); gap 10: library analytics list how many layers and files use each style and variable; the Controller menu names each button as PlayStation and Switch controllers do; gap 6: widgets draw lines and SVG pictures (plugin API 6); gap 7: text reads only the fallback fonts it draws with; a board connector's path can be reshaped by dragging its path handles (#1710); gap 10: library analytics count insertions and show insertions and detachments over time; gap 6: a widget opens its plugin's panel (plugin API 5), whose callbacks redraw it; the keyboard's Menu key opens the context menu, as Shift+F10 does; gap 14: a collection of this file extends, following its edits at once; colour picker review fixes for text undo, fitted sidebars, moving controls and gradient variables; gap 6: plugin widgets have hover styles; gap 7: the browser draws a zoom's full render a band at a time; `.fig` import keeps the file's saved line breaks while the text and its box are unedited (#1236); FigJam outer shape outlines and sticky body fallback beside author text (#1341, #1397); Arabic draft catalog; gap 7: the browser refines a zoom's preview once the zoom has paused; gap 17: branches in live sessions, branch history entries, the list-merge rows brought up to date; gap 6: plugin widgets take text input and a property menu (plugin API 4); gap 24: board templates and tables; gap 24: a shared timer and voting sessions; gap 24: the board dot grid, connector ends dragged to re-attach, curved connectors; egui/eframe 0.37 verified for gap 18; known gaps from the #1311 review in gaps 4, 14, 15 and 16; gap 16: measurements kept on the canvas, a read-only layers panel in Dev Mode; gap 24: boards and their tail; Dev Mode tail: import lines in layer trees, compare with versions, an inspect-only canvas; gap 5: reviewed Turkish, Czech and Indonesian drafts, the Japanese draft completed; reviewed Russian catalog and integer plurals; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; experimental .fig export; keyboard shortcut parity suite and bindings; Simplified Chinese draft catalog; Latin American Spanish overlay; prototyping tail: gamepad triggers, widgets in prototypes, mode lookups; plugin directory on figcraft-server; Japanese and Korean draft catalogs and CJK UI fonts; plugin widgets and the plugin panel tail; French, German and Brazilian Portuguese draft catalogs; cursor chat and spotlight in live sessions; layers and assets panels behaviour suite and fixes; vector multi-edit and edit tail; dev resources links; extended collections tail; branch version history and finer list merges; comments and version history behaviour suite and fixes; canvas navigation, guides and grids behaviour suite and fixes; `.fig` import: editable vector networks, more layer kinds, variable prototype actions; `.fig` import, best effort: gap 1 down to its tail; Windows QA pass: everyday workflows on Windows 11, eight fixes incl. unsaved work kept after a crash or a forced quit; Display P3: gamut warning and soft-proof (true P3 blocked upstream); several windows; localization layer with a draft Spanish catalog; hosting figcraft-server: wss in the desktop app, server releases, deployment guide; plugin panels and settings; canvas fixes: boolean hit testing on the result, group drags, frame outlines and slices; code connect; stretch and scatter brushes, pen pressure; text on a path and pattern fills; team libraries on the server and swap library; branches: create, update from main, review and merge; animated GIF fills and TIFF images; Open recent, outlines for the selection and mask outlines: menu breadth 100%; extended collections, variables import/export, gradient stop and variant bindings: gap 14 down to its tail; the 2026-10-17 landings: `.fig` import fidelity, budgets for large files, the import report, a `.fig` copy from Save as and pasteLine truncated
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-24 · **Change:** minor (gap 7: a moved point redraws its vector around it only; gap 24: mind maps from the toolbar and the keyboard (#2226); gap 24: code blocks, first step (`board.codeBlock`, `board.setLanguage`, #2237); gap 10: library analytics count insertions and detachments of styles and variables; gap 6: the browser build uses team libraries and plugin directories on a server; gap 7: a pan past the canvas image shows a coarse image of the area around the view on the desktop, not the bare page colour; gap 7: the strips a pan uncovers render in parallel bands; gap 7: the desktop refines a zoom's preview once the zoom has paused; gap 1: the `.fig` export writes vector region paints (#2302); gap 13: a boolean group's corner radius (#2222); gap 24: mind maps, first step: a first node with three children on curved branches, laid out again after every edit (`board.mindMap`, `board.mindMapAdd`, #2226); gap 10: library analytics list how many layers and files use each style and variable; the Controller menu names each button as PlayStation and Switch controllers do; gap 6: widgets draw lines and SVG pictures (plugin API 6); gap 7: text reads only the fallback fonts it draws with; a board connector's path can be reshaped by dragging its path handles (#1710); gap 10: library analytics count insertions and show insertions and detachments over time; gap 6: a widget opens its plugin's panel (plugin API 5), whose callbacks redraw it; the keyboard's Menu key opens the context menu, as Shift+F10 does; gap 14: a collection of this file extends, following its edits at once; colour picker review fixes for text undo, fitted sidebars, moving controls and gradient variables; gap 6: plugin widgets have hover styles; gap 7: the browser draws a zoom's full render a band at a time; `.fig` import keeps the file's saved line breaks while the text and its box are unedited (#1236); FigJam outer shape outlines and sticky body fallback beside author text (#1341, #1397); Arabic draft catalog; gap 7: the browser refines a zoom's preview once the zoom has paused; gap 17: branches in live sessions, branch history entries, the list-merge rows brought up to date; gap 6: plugin widgets take text input and a property menu (plugin API 4); gap 24: board templates and tables; gap 24: a shared timer and voting sessions; gap 24: the board dot grid, connector ends dragged to re-attach, curved connectors; egui/eframe 0.37 verified for gap 18; known gaps from the #1311 review in gaps 4, 14, 15 and 16; gap 16: measurements kept on the canvas, a read-only layers panel in Dev Mode; gap 24: boards and their tail; Dev Mode tail: import lines in layer trees, compare with versions, an inspect-only canvas; gap 5: reviewed Turkish, Czech and Indonesian drafts, the Japanese draft completed; reviewed Russian catalog and integer plurals; `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; sharing with a join code; text box sizes measured against documents re-saved by other software; live sessions per document; .fig export checked by opening written files in other software; experimental .fig export; keyboard shortcut parity suite and bindings; Simplified Chinese draft catalog; Latin American Spanish overlay; prototyping tail: gamepad triggers, widgets in prototypes, mode lookups; plugin directory on figcraft-server; Japanese and Korean draft catalogs and CJK UI fonts; plugin widgets and the plugin panel tail; French, German and Brazilian Portuguese draft catalogs; cursor chat and spotlight in live sessions; layers and assets panels behaviour suite and fixes; vector multi-edit and edit tail; dev resources links; extended collections tail; branch version history and finer list merges; comments and version history behaviour suite and fixes; canvas navigation, guides and grids behaviour suite and fixes; `.fig` import: editable vector networks, more layer kinds, variable prototype actions; `.fig` import, best effort: gap 1 down to its tail; Windows QA pass: everyday workflows on Windows 11, eight fixes incl. unsaved work kept after a crash or a forced quit; Display P3: gamut warning and soft-proof (true P3 blocked upstream); several windows; localization layer with a draft Spanish catalog; hosting figcraft-server: wss in the desktop app, server releases, deployment guide; plugin panels and settings; canvas fixes: boolean hit testing on the result, group drags, frame outlines and slices; code connect; stretch and scatter brushes, pen pressure; text on a path and pattern fills; team libraries on the server and swap library; branches: create, update from main, review and merge; animated GIF fills and TIFF images; Open recent, outlines for the selection and mask outlines: menu breadth 100%; extended collections, variables import/export, gradient stop and variant bindings: gap 14 down to its tail; the 2026-10-17 landings: `.fig` import fidelity, budgets for large files,Line truncated
Every known shortfall against Figma, one entry each, ranked by how much it stops a Figma user from
doing real work in FigCraft. Agents: pick work from the top unless the owner says otherwise. The
@@ -287,6 +287,15 @@ No alpha blockers: the alpha gate in [`roadmap.md`](roadmap.md#alpha-gate) passe
sixteenth of the pixels first, then refined. With no measure to go by (the first render, another
page, a zoom after quick renders), a watchdog thread previews any such render still running
after 12 ms (desktop only; the browser renders inline).
- **Landed (2026-11-24):** a moved point redraws its vector around it only. A point dragged in the
vector editor changed the vector, so its whole box was drawn again; zoomed to the vector, as the
editor does, that is most of the view, past the share a patch may cover (60%), and every frame of
the drag was a full render. A vector that differs only in where its points and handles are now
redraws the segments that moved and their neighbours (whose joins and rounded corners follow
them), as far out as its stroke reaches: 41,866 of a view's 328,801 pixels for a point of a
filled twelve-tooth zigzag that fills the view (`a_moved_point_redraws_the_vector_around_it_only`).
Dashes, width profiles, brushes, gradients and images, effects, masks and open filled paths
depend on the whole outline: those vectors are drawn again whole.
- **Landed (2026-10-29):** the browser draws a zoom's full render a band at a time (`Retained::begin`,
`Steps`; at least a band a frame and at most eight bands, so a frame draws a part of the render
where it drew the whole of it: 0.7–1.4 s where the render took 3.7–4.0 s in the measurement of
@@ -615,6 +624,7 @@ No alpha blockers: the alpha gate in [`roadmap.md`](roadmap.md#alpha-gate) passe
| Date | Change | Summary |
|---|---|---|
| 2026-11-24 | minor | Gap 7: a point moved in the vector editor redraws the segments that moved and their neighbours, not the vector's whole box (a full render of the view when the vector fills it). Numbers unchanged |
| 2026-11-19 | minor | Gap 24: code blocks, first step (`board.codeBlock`, `board.setLanguage`; a block is as tall as its lines and keeps its text plain code, #2237); the toolbar entry, language menu, highlighting, line numbers and `.jam` import are missing. |
| 2026-11-18 | minor | Gap 10: library analytics count insertions and detachments of styles and variables; modes stay on the missing list. |
| 2026-11-18 | minor | Gap 6: the plugin directory works in the browser build, so that item leaves the missing list; what's installed there lasts as long as the page. Team libraries on a server work there too. |
+3 -1
View File
@@ -1124,7 +1124,9 @@ most when it can't be reached).
by name in their set, styles by name and type, variables by collection, name and type, modes by
name), keeping overrides; one undo step → `{components, styles, variables, unmatched: [names
still from `from`, including this file's collections that extend one of its collections],
removed (nothing of `from` was left, so it was removed)}`.
dropped: [`from`'s copies nothing used before the swap, which it removed rather than moved: a
component imported but not placed, or whose instances were deleted; a variable imported but not
bound], removed (nothing of `from` was left, so it was removed)}`.
### Overrides and variants