diff --git a/.github/workflows/actions.lock b/.github/workflows/actions.lock index 591d1bbad..65da56dd2 100644 --- a/.github/workflows/actions.lock +++ b/.github/workflows/actions.lock @@ -18,6 +18,7 @@ workflows: '.github/workflows/nightly-sign.yml': [] '.github/workflows/nightly.yml': [] '.github/workflows/nix.yml': [] + '.github/workflows/notify-services.yml': [] '.github/workflows/packaging-lint.yml': - 'actions/checkout@v7.0.1' - 'step-security/harden-runner@v2.22.4' diff --git a/.github/workflows/notify-services.yml b/.github/workflows/notify-services.yml new file mode 100644 index 000000000..3dc8eaf4a --- /dev/null +++ b/.github/workflows/notify-services.yml @@ -0,0 +1,20 @@ +name: Notify Services on Release Change + +on: + release: + types: + - published + - unpublished + - created + - edited + - deleted + - prereleased + - released + +permissions: {} + +jobs: + notify: + uses: storytold/craft-common-actions/.github/workflows/notify-services.yml@main + secrets: + ARTCRAFT_SERVICES_DISPATCH_TOKEN: ${{ secrets.ARTCRAFT_SERVICES_DISPATCH_TOKEN }} diff --git a/Cargo.toml b/Cargo.toml index 9d08e4090..74bdafcca 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -185,6 +185,15 @@ debug = false strip = true panic = "abort" +# The rasteriser's loops run for every pixel of the canvas on the page's one thread: built for +# speed. (The rest stays "z": the whole build at speed is megabytes over the gate.) +[profile.web-release.package.tiny-skia] +opt-level = 3 +[profile.web-release.package.tiny-skia-path] +opt-level = 3 +[profile.web-release.package.figcraft-render] +opt-level = 3 + # Keep the complete egui family and native event bridge on reviewed fork commits. [patch.crates-io] ecolor = { git = "https://github.com/storytold/egui.git", rev = "b9770908e0f304896f9658d239a7b29cf8af1564" } diff --git a/ROADMAP.md b/ROADMAP.md index 237b2d17a..3b0a51706 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -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 (M5: prototype arrow-key aliases and explicit document-scoped player controls, including batch rollback; numbers unchanged; 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 (M5: prototype arrow-key aliases and explicit document-scoped player controls, including batch rollback; numbers unchanged; M9: clients accept complete legacy welcomes without a reconnect secret and re-authenticate on reconnect (#2365); a boolean group takes a corner radius (and smoothing) that rounds every sharp corner of its result (#2222); a text style binds a number variable to its weight (#2174); mind maps, first step: a first node with three children on curved branches, laid out again after every edit (`board.mindMap`, `board.mindMapAdd`, #2226); the handoff mode reads Developer Mode in the interface, its ids and saved fields unchanged; the left rail's and tab strip's icons are larger, 20 pt (#553); Suggest auto layout adds nested auto layout frames by rows and columns and keeps the placement of the design, as the help center describes (#1823); 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); the desktop UI takes a system face for Ethiopic, Devanagari, Gurmukhi, Gujarati, Tamil, Telugu, Kannada and Malayalam, Sinhala, Lao, Myanmar, Khmer, Armenian and Georgian as it did for Hebrew and Arabic, so a String variable's Amharic value draws in the panels instead of boxes (#2014); a layer's effect binding takes only a field its effect has; ; the boolean operation menu leads each entry with an original icon (#2003); glass takes one sample instead of its dispersion window where the colours split under 1/256 px; glass bends towards its core, and rounded rectangles work it out in closed form; glass's light is a line on its bevel and splay turns the bend towards the centre; glass bends with a thick-lens profile and splits its colours over 8 steps; glass effects take variables and keep their frost within 0–100; web host bridge: `?host=parent` or `data-host="page"` hands a page the app's files, documented in the hosting guide; a connector end moved with Cmd/Ctrl held goes on any part of an object, and stays there as the object moves or resizes; a tap on a plugin panel's button keeps what was typed in its fields; a Dash cap setting (none, round or square) on Dash and Custom strokes, drawn on both ends of every dash; 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; widgets draw lines and SVG pictures (plugin API 6); a connector end dropped along a side of a shape attaches to that side (#1708); regression tests pin a rounded shape's one-sided stroke and SVG ids and font families without XML-forbidden characters (#1351, #1124); a damaged image is refused with a reason instead of showing as an empty box (#1474); an image copied in another app pastes again on the desktop, and in the browser for the first time (#492); SwiftUI and Compose code names a bound variable by its iOS or Android code syntax; the colour picker's Image tab shows a placeholder and Upload from computer, an asset preview, and a file dropped on it replaces the image, keeping the fill mode, crop and position (#1682); the Frame tool's Phone presets have the iPhone 17 family (#1691); Show in folder works in the Flatpak build and selects the file on Linux (#1701); a dashed line starts and ends with a half-length dash, on the canvas and in exports; the Pages, Layers and Assets search fields keep their text in the middle of the field (#1703); a board connector's path can be reshaped by dragging its path handles (#1710); boards have 16 more shapes (arrows, polygons, star, plus and flowchart symbols), in pickers that lay them out in a grid; library analytics count insertions and show insertions and detachments over the past 30 days, 90 days or year; a stroke's Custom style takes a dash pattern of any length as a comma-separated list (#1681); a control request can set its own timeout, up to 10 minutes (`timeoutMs`; `figcraft-cli mcp --attach PORT --timeout SECONDS`) (#1696); 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; an Open link action can open in place of the prototype, with "Open in new tab" off (gap 15); 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; the eyedropper with Cmd/Ctrl+Shift makes a colour style or variable of what it picks; a live session's welcome sends the document compressed to clients that read it, about seven times smaller (#1665); a control request that times out says truthfully whether it was dropped or is still running and will take effect, and only screenshots and input blame the window (#1673); a board keeps earlier votes' results, listed newest first in Results and deleted one at a time; the object a stamp will stick to is outlined while the stamp tool is over it or a stamp is dragged over it, and board objects take no drops (gap 24); a server can list the files shared from it now for everyone who reaches it, Home ▸ Online shows them and their links carry no secret (`team_files`, part of #742); team library analytics count detached instances per component and file (gap 10); skipping the Open link notice by command is saved with the preferences at once (gap 15); a selected connector's bar on a board sets its start and end points, solid or dashed, its weight and any colour (#1596); cells copied from a spreadsheet paste onto a board as a table; a long layer name stays on one line in the Export button and the Dev Mode header, ending with an ellipsis, and no longer covers the Design panel (#1650); with hundreds of layers selected, the Design panel and the selection overlays stop going over the whole selection on every frame, so dragging 648 layers averages about 1.1 ms of UI per frame (#1571); plugin panels show pictures: an `image` control, base64 within 256 KB and 4,096 px a side, named by its label (gap 6); `.fig` connector labels without a saved snapshot are kept, centred on their line (gap 1); a drag moving many layers re-runs only what sits around them, not each layer's bindings, sizing, text and instance checks, on every move (#1571); damaged font tracking table offsets are checked instead of wrapping on 32-bit targets, and font indexing makes its existing offset bounds explicit (#1125); Bosnian (`bs`) draft catalog; text style dedupe is O(spans) via a last-two cache and fingerprint buckets (#1102); pasted layers whose image the clipboard lacks are named and show a placeholder that reads as missing (#1646); paint-style colours on layers pasted from another design app keep their style instead of turning black (#1638); progress docs cleaned of what merges left twice: rows merged into one, repeated status items removed, and `cargo xtask docs` (in `ci`) fails on a repeated table row or status item; a name typed for a variable or collection finds the one with that exact id before one named like it, and stored mode ids, font family variables and the panels' labels read exact ids (#1613); plugin widgets have hover styles: a layer's `hover` fill, stroke, opacity or text colour shows while the pointer is over it (gap 6); `.fig` elbowed and curved connectors without a saved path are routed like board connectors instead of drawn straight (gap 1); every file a command reads whole by path is a regular file within a cap that fits it: documents 16 GiB, placed images 256 MiB, CLI scripts 1 GiB; `figcraft-cli connect publish` publishes a code repository's code connect mappings to a design file (gap 16); while a drag only moves a large selection, its outlines, box, slots, spacing and Design panel values are worked out once and shifted, not rebuilt on every move (#1571); Shift+Cmd/Ctrl+Enter on a selected board shape adds the next shape already joined to it, and goes on typing (#1597); an imported or pasted file finds an installed family under the other names its fonts give it, and with other case and spacing, instead of reporting it missing (#1292); a development example generates figcraft-cli's shell completions and man pages from its clap definitions (part of #1396); `.fig` ZIP image reads share a total byte budget and count skipped images in the import warnings (#1076); German terminology corrections (M10): gradient stops, OpenType stylistic sets and the Home-screen preference; 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; the server key is checked by comparing SHA-256 hashes of the presented and the kept key, as the deployment guide says (#1130); opening a file contacts no team library server it names until you check it (#1097); a hostile server can no longer grow a client's memory with made-up people, and a session remembers a bounded number of deleted layer ids (#1121); `doc.list` gives AI agents and plugins the open files' names, not their paths (#1117); with a large selection, frames where nothing changed reuse the selection's outlines, box and slots and the Design panel's instance and position values instead of working them out again (#1571); team libraries and plugins larger than the 16 MiB download burst can be downloaded again, more slowly (#1089); a batch keeps one undo snapshot, not one per step (#1099); files nested 256 levels deep import on the browser's 1 MB stack (#1101); SVG and PDF exports count pattern sources and the renders they embed from the layer's depth, so one cap bounds a whole export (#1082); 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); joining and leaving a file nobody is editing reads and writes nothing on the server: it stays loaded a minute after everyone leaves (#1074); opening a `.figcraft` file unpacks at most 6 GiB in all (2 GiB in the browser), every area together (#1079); hovering the canvas hit-tests once per pointer move, not on every frame, and moving an auto layout frame no longer lays out its contents again on every move (#1571); `.fig` instance expansion no longer walks variable nodes for every instance or copies every outer override row into each nested instance (#1077); `comment.people` lists names that were only @mentioned, and `comment.next` and `comment.prompt` carry the mentions too (#1415); grid auto-placement looks for free cells a 64-bit word at a time and skips what blocks it, with the same placements (#1083); with the pen out, Enter or a double-click ends the path and edits the vector with the Move tool instead of drawing on (#1430); a recovery copy made while a version is previewed holds the file, not the version shown; a FigJam `.jam` file opens as a board (#1342); the Actions palette offers only commands that run from it, and no second row reading like a menu item: Place image opens the file dialog (#1574); share links can comment: a third access level beside edit and view, whose holder sees the file live and adds, replies to, reacts to and resolves comments but can't change the design; Preferences ▸ Scroll wheel zoom: a mouse wheel zooms the canvas about the pointer and Cmd/Ctrl+wheel scrolls (#1390); `comment.list {mentions}` lists only the threads that @mention a name (#1415); in the browser an internal error that stops the page keeps its unsaved files, which open again on reload (#1123); boolean operations refuse input past their caps, and a boolean group past them draws without its result (#1104); figcraft-cli parses its arguments with clap, following RFC-0012 (#1396); the selection and hover outlines of rounded rectangles and frames follow their corners (#1506); component properties keep the order they were made in when one is renamed, and Make slot asks for the slot's name first (#1536, #1537); the browser build publishes files to a server, so Share ▸ Online and Publish to server work there (#917); the browser build uses the fonts installed on the computer once asked, each read when text uses it (#1051); SVG import reads `color()` and `color-mix()` colours, with a note and a grey for those it can't (#1550); the portable Windows zip keeps its settings, recovery copies and plugins in `config\` beside the executable, starting with an installed copy's preferences; the window starts on other graphics when its first ones fail before the first frame: Direct3D 12 compiles with FXC and no device compiles wgpu's indirect-validation shaders, then Vulkan, OpenGL and lower requirements on the power-saving GPU (#965, #1438); Thai, Lao, Khmer and Burmese lines break between words (#1219); an AI agent attached over MCP shows where it works (#1416); a manual overlay's position can be dragged on the canvas (#405); one name for live sessions and comments: Preferences ▸ Your name, in the Join dialog too, kept in the browser, and a rename shows at once in the sessions you are in (#1380); requests that change a server's files have a budget per address, the server key's too, and join codes are found by their hash (#1075); the Join dialog shows a join from the click until its file is ready, with Cancel, and a failed join with Try again (#1381); SVG import draws each pattern tile once per scale, within the layer budget (#1080); Vietnamese letters typed with combining marks (decomposed) take one font that has every mark, instead of missing-glyph boxes beside the letter (#1478); comment.list reports each message's @mentions (#1415); mask groups draw only over the area they can paint, and nested isolated layers share one memory budget (#1061); components can't contain their own instances, directly or through other components; `edit.duplicate` returns an id map with `map: true` (#995); the batches kept for reconnecting apps are bounded in bytes by default, and `figcraft-server` takes `max_log_mb` (#1069); MCP and control calls name their document (#998); sibling placement in live sessions searches instead of counting (#1065); an AI agent attached over MCP comments under its own name, with an Agent label (#1414); the instance-swap menus have a search field (#1338); a refused batch's fixes take time linear in the batch (#1063); the connector tool shows the connector it will make while dragging, ends snapping to attach points (#1387); large images on the canvas draw from a smaller copy, so two 16k images no longer lag (#1483); a file's JPEG thumbnail can't crash the home screen (#1491's progressive JPEG check, now shared); `.fig` import: library text styles linked by asset key, and override rows restating a nested level (#1234); `.fig` import keeps the file's saved line breaks while the text and its box are unedited (#1236); Download a missing free font from the Missing fonts window (`font.download`, #754); the web build's wasm back under its 24 MiB gate (#1472); shadows of images with transparent pixels follow their alpha (#1289); Crop image: Object ▸ Crop image, the right-click menu and the image fill row enter crop mode (`image.crop`, #1464); offline Penpot 2.x import/export (#1143); optional batch continue-on-error with per-step outcomes (#1386); the Design panel's sections on one grid (#858); FigJam outer shape outlines and sticky body fallback beside author text (#1341, #1397); images placed at their own size, 2x screenshots in points (#1360); the toolbar on one 32 pt grid, without its Resources button (#1210); M4: zero-length round-capped dashes draw dots; dash expansion uses the existing safety budget; extracted from #1143; Arabic draft catalog; scaled instances keep their scale when their main is rebuilt (#922); .fig embedded images are copied once per blob, not once per hash (#1059); page ruler guides survive save and reopen (#1476); colour picker LCH and OKLCH models; non-ASCII layer names transliterate in code export (#1235); branches in live sessions and branch history entries, gap 17; plugin widgets take text input and a property menu (plugin API 4); boards: templates and tables; boards: a shared timer and voting sessions; boards: the dot grid, connector ends dragged to re-attach, curved connectors; Installed weights of an embedded font family (#1246); `.sketch` import, best effort (Sketch 48 and newer); CJK line breaking: JIS X 4051's line-start and line-end sets completed with the halfwidth small kana, the halfwidth and spacing (semi-)voiced sound marks, the iteration marks 〱–〵 and the halfwidth parentheses, with behaviour cases for each; Adobe Fonts found on macOS (#298); egui 0.37 hidden-capture deadline contract; Dev Mode measurements kept on the canvas and a read-only layers panel; boards: a board area row and progress entry; community fixes in #507, #510, #529 and #530: auto-save, a text box by dragging, batch step references, removing someone from a live session, Russian and Turkish catalogs reviewed, Czech and Indonesian drafts, the Japanese draft completed, zoom previews, the web clipboard, Alt-drag snapping and Cmd+D repeat, recovery copies, crash and rollback fixes, colour emoji, `.fig` import fixes; earlier changes are in the revision history below; 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,8 @@ 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-19 | minor | M8: screen sizes for agents. A frame can be marked as the mobile, tablet or desktop version of a design, and given rules for other sizes as notes in the Responsive annotation category, in the Inspect tab's Screen sizes section, `responsive.set` and `responsive.rule`. `responsive.list` returns only what the designer stated: nothing is inferred from names or sizes. Marks are layer data and rules are annotations, so the file format doesn't change. Numbers unchanged. Tests: `responsive_tests`. | | 2026-11-15 | patch | M5: prototype arrow aliases match platform key names; explicit document selection survives addressed calls and nested batches; failed commands and groups discard their queued UI effects. Readiness numbers 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 | @@ -378,6 +380,11 @@ 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-16 | patch | M9, #2365: native and browser clients accept the complete legacy `Welcome` layout without its later reconnect secret, preserving explicit access and rejecting incomplete or trailing data. A host that supplies no secret is rejoined with the share link instead of an unauthenticated `Resume`. Numbers unchanged. | | 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. | | 2026-11-07 | patch | M10, #1902: web builds with craft-fonts embed Noto Sans Arabic Regular by default, so Persian and Arabic text has a fallback without `FIGCRAFT_EMBED_SCRIPTS=Arab`; required web builds reject catalogs without that face. Web faces are compressed losslessly at build time and restored once at runtime to keep the default catalog within the WASM size budget. A decode failure logs the unavailable face once; a compiler regression checks generated catalog initialization. Additional scripts remain opt-in. Exact Iran Sans appearance still needs the installed font through supported browsers' local font access. Numbers unchanged. | diff --git a/apps/figcraft-cli/src/args.rs b/apps/figcraft-cli/src/args.rs index b1a878574..601800ae3 100644 --- a/apps/figcraft-cli/src/args.rs +++ b/apps/figcraft-cli/src/args.rs @@ -102,7 +102,7 @@ pub struct ExportArgs { pub format: Option, #[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, /// 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, #[command(flatten)] @@ -306,7 +306,7 @@ enum ValueError { } fn scale(s: &str) -> Result { - s.trim_end_matches('x').parse::().ok().filter(|v| v.is_finite() && *v > 0.0 && *v <= 64.0).ok_or(ValueError::Scale) + s.strip_suffix('x').unwrap_or(s).parse::().ok().filter(|v| v.is_finite() && *v > 0.0 && *v <= 64.0).ok_or(ValueError::Scale) } /// `FIGCRAFT_NO_SYSTEM_FONTS`: the usual boolean spellings; an empty value is unset (RFC-0018 rule 1.7). @@ -525,6 +525,13 @@ mod tests { assert!(try_parse(&["commands"]).is_ok_and(|cli| !cli.no_system_fonts)); } + #[test] + fn scale_accepts_numbers_and_one_optional_suffix() { + for (value, want) in [("0.5", 0.5), ("0.5x", 0.5), ("2", 2.0), ("2x", 2.0), ("64", 64.0), ("64x", 64.0)] { + assert_eq!(super::scale(value).ok(), Some(want), "{value}"); + } + } + #[test] fn bad_arguments_are_usage_errors() { use ErrorKind::{ @@ -543,6 +550,8 @@ mod tests { (&["export", "a", "-o", "b", "--scale", "0"], ValueValidation), (&["export", "a", "-o", "b", "--scale", "-3"], ValueValidation), (&["export", "a", "-o", "b", "--scale", "65"], ValueValidation), + (&["export", "a", "-o", "b", "--scale", "2xx"], ValueValidation), + (&["render", "a", "-o", "b", "--scale", "2xxx"], ValueValidation), (&["export", "a", "-o", "b", "--bleed", "lots"], ValueValidation), (&["export", "a", "-o", "b", "--bleed", "3in"], ValueValidation), (&["export", "a", "-o", "b", "--vd-compat", "sloppy"], ValueValidation), diff --git a/apps/figcraft-server/src/disk.rs b/apps/figcraft-server/src/disk.rs index 19cbfc8d3..78be9e1e8 100644 --- a/apps/figcraft-server/src/disk.rs +++ b/apps/figcraft-server/src/disk.rs @@ -153,6 +153,20 @@ fn u64_at(b: &[u8], at: usize) -> Option { b.get(at..at + 8).and_then(|s| s.try_into().ok()).map(u64::from_le_bytes) } +/// Snapshot state before shared branches (fallback decoder for existing snapshots on disk). +#[derive(serde::Deserialize)] +struct SessionStateV1 { + session: u64, + snapshot: Vec, + seq: u64, + next_client: u32, + issued: std::collections::BTreeMap, + deleted: std::collections::BTreeSet, + #[serde(default)] + removed: std::collections::BTreeSet, + log: Vec, +} + /// A snapshot file's bytes. pub fn encode_snapshot(generation: u64, state: &SessionState) -> Result, String> { let mut out = Vec::with_capacity(SNAP_HEADER); @@ -191,7 +205,23 @@ pub fn check_snapshot(bytes: &[u8]) -> Result { /// A snapshot's generation and session state. pub fn decode_snapshot(bytes: &[u8]) -> Result<(u64, SessionState), String> { let (generation, body) = snapshot_body(bytes)?; - let state = message::decode::(body, body.len()).map_err(|e| format!("the snapshot can't be read: {e}"))?; + let state = match message::decode::(body, body.len()) { + Ok(state) => state, + Err(err) => match message::decode::(body, body.len()) { + Ok(v1) => SessionState { + session: v1.session, + snapshot: v1.snapshot, + seq: v1.seq, + next_client: v1.next_client, + issued: v1.issued, + deleted: v1.deleted, + removed: v1.removed, + log: v1.log, + branches: Vec::new(), + }, + Err(_) => return Err(format!("the snapshot can't be read: {err}")), + }, + }; Ok((generation, state)) } @@ -262,3 +292,52 @@ pub fn read_log(bytes: &[u8]) -> Result { } Ok(LogRead { generation, entries, damaged }) } + +#[cfg(test)] +mod tests { + use std::collections::{BTreeMap, BTreeSet}; + + use figcraft_collab::message; + + use super::*; + + #[derive(serde::Serialize)] + struct LegacySessionStateV1 { + session: u64, + snapshot: Vec, + seq: u64, + next_client: u32, + issued: BTreeMap, + deleted: BTreeSet, + removed: BTreeSet, + log: Vec, + } + + #[test] + fn decode_snapshot_reads_pre_branch_v1_snapshots() { + let v1 = LegacySessionStateV1 { + session: 42, + snapshot: Vec::new(), + seq: 7, + next_client: 3, + issued: BTreeMap::new(), + deleted: BTreeSet::new(), + removed: BTreeSet::new(), + log: Vec::new(), + }; + let mut out = Vec::with_capacity(SNAP_HEADER); + out.extend_from_slice(SNAP_MAGIC); + out.push(FORMAT); + out.extend_from_slice(&9u64.to_le_bytes()); + out.extend_from_slice(&0u32.to_le_bytes()); + let mut out = message::encode_into(&v1, out).unwrap(); + let sum = crc(&out[SNAP_HEADER..]); + out[SNAP_HEADER - 4..SNAP_HEADER].copy_from_slice(&sum.to_le_bytes()); + let (generation, state) = decode_snapshot(&out).unwrap(); + assert_eq!(generation, 9); + assert_eq!(state.session, 42); + assert_eq!(state.seq, 7); + assert_eq!(state.next_client, 3); + assert!(state.branches.is_empty()); + } +} diff --git a/apps/figcraft-server/src/server_tests.rs b/apps/figcraft-server/src/server_tests.rs index f3d084499..caff12966 100644 --- a/apps/figcraft-server/src/server_tests.rs +++ b/apps/figcraft-server/src/server_tests.rs @@ -271,3 +271,53 @@ fn fuzzed_frames_dont_hurt_the_server() { assert!(same(a.doc().unwrap(), b.doc().unwrap())); server.stop(); } + +#[test] +fn shared_branches_sync_and_survive_a_server_restart() { + let dir = TempDir::new("branches"); + let mut cfg = config(dir.path()); + let mut server = crate::start(&cfg).unwrap(); + let addr = server.addr(); + let mut a = session("Ada"); + let base_rect = id_of(&a.execute("shape.rectangle", &json!({"x": 0, "y": 0, "width": 80, "height": 80})).unwrap()); + let p = publish(&mut a, dir.path(), addr); + let mut b = join(&p.edit, "Bo"); + pump(&mut [&mut a, &mut b], "both live with shared branches", |s| { + live(s[0]) && live(s[1]) && s[0].live().shared_branches && s[1].live().shared_branches + }); + let b_main = b.active; + // Bo creates a branch, adds a new shape and renames the existing one. + let branch_id = b.execute("branch.create", &json!({"name": "New Card"})).unwrap()["id"].as_str().unwrap().to_string(); + let card = id_of(&b.execute("shape.rectangle", &json!({"x": 120, "y": 20, "width": 100, "height": 60})).unwrap()); + b.execute("node.set", &json!({"ids": [base_rect.0], "props": {"name": "Base From Branch"}})).unwrap(); + pump(&mut [&mut a, &mut b], "Ada receives Bo's branch and edits", |s| { + s[0].docs[0] + .branches + .iter() + .any(|br| br.id == branch_id && br.head.contains(card) && br.head.node(base_rect).is_some_and(|n| n.name == "Base From Branch")) + }); + assert!(!a.doc().unwrap().contains(card), "main stays clean until merged"); + // Switch Bo back to main before checking reconnect status on main. + b.execute("doc.switch", &json!({"index": b_main})).unwrap(); + // Restart the server: the branch and its edits must survive on disk. + server.stop(); + pump(&mut [&mut a, &mut b], "reconnecting", |s| s.iter().all(|x| matches!(x.live().status, Status::Reconnecting { .. }))); + cfg.listen = addr.to_string(); + let mut server = start_again(&cfg); + pump(&mut [&mut a, &mut b], "back after restart", |s| s.iter().all(|x| live(x) && x.live().shared_branches)); + // A brand-new participant Cy joins after the restart and gets the branch too. + let mut c = join(&p.edit, "Cy"); + pump(&mut [&mut a, &mut b, &mut c], "Cy receives branch after restart", |s| { + live(s[2]) && s[2].ds().is_ok_and(|d| d.branches.iter().any(|br| br.id == branch_id && br.head.contains(card))) + }); + // Ada reviews and merges Bo's branch into main. + assert_eq!(a.execute("branch.merge", &json!({"id": branch_id})).unwrap()["merged"], true); + pump(&mut [&mut a, &mut b, &mut c], "everyone converges after merge", |s| { + s.iter().all(|x| x.doc().unwrap().contains(card)) + && s[1].ds().is_ok_and(|d| d.branches.iter().any(|br| br.id == branch_id && br.state == figcraft_engine::branches::BranchState::Merged)) + && s[2].ds().is_ok_and(|d| d.branches.iter().any(|br| br.id == branch_id && br.state == figcraft_engine::branches::BranchState::Merged)) + }); + assert_eq!(c.doc().unwrap().node(base_rect).unwrap().name, "Base From Branch"); + assert!(same(a.doc().unwrap(), b.doc().unwrap()) && same(a.doc().unwrap(), c.doc().unwrap())); + server.stop(); +} diff --git a/apps/figcraft-server/src/store.rs b/apps/figcraft-server/src/store.rs index d75a24f1b..903ecea71 100644 --- a/apps/figcraft-server/src/store.rs +++ b/apps/figcraft-server/src/store.rs @@ -258,6 +258,18 @@ struct Log { bytes: u64, /// Changed since the last compaction. dirty: bool, + /// Shared branch state changed since the last compaction. + branch_dirty: bool, +} + +fn is_branch_journal(j: &figcraft_collab::Journal) -> bool { + matches!( + j, + figcraft_collab::Journal::BranchCreate(_) + | figcraft_collab::Journal::BranchEdit { .. } + | figcraft_collab::Journal::BranchUpdateFromMain { .. } + | figcraft_collab::Journal::BranchState { .. } + ) } struct Entry { diff --git a/apps/figcraft-server/src/store/backend.rs b/apps/figcraft-server/src/store/backend.rs index 42900e6b8..2a485c441 100644 --- a/apps/figcraft-server/src/store/backend.rs +++ b/apps/figcraft-server/src/store/backend.rs @@ -71,6 +71,9 @@ impl Backend for Store { // A refusal changes nothing in the document: it counts toward the log's size (bytes), but // not toward the entries that make a snapshot rewrite worthwhile. log.entries += journal.iter().filter(|j| !matches!(j, figcraft_collab::Journal::Refused { .. })).count(); + if journal.iter().any(super::is_branch_journal) { + log.branch_dirty = true; + } log.dirty = true; e.meta.updated = now(); if log.entries >= after || log.bytes + log.pending.len() as u64 >= max_bytes { @@ -92,10 +95,10 @@ impl Backend for Store { let compact = self.files.get_mut(file).is_some_and(|entry| { let snapshot_seq = entry.meta.seq; entry.log.as_mut().is_some_and(|log| { - // Issued client ids and refusals are durable in the log; only edits need a - // new image-bearing snapshot. Still try a snapshot if syncing the log failed. + // Issued client ids and refusals are durable in the log; edits (on main or + // shared branches) need a new snapshot. Still try a snapshot if syncing failed. synced = flush_log(file, log).is_ok(); - !synced || (log.dirty && server.seq() > snapshot_seq) + !synced || (log.dirty && (server.seq() > snapshot_seq || log.branch_dirty)) }) }); if compact { diff --git a/apps/figcraft-server/src/store/journal.rs b/apps/figcraft-server/src/store/journal.rs index efab8ec7b..f856a3491 100644 --- a/apps/figcraft-server/src/store/journal.rs +++ b/apps/figcraft-server/src/store/journal.rs @@ -57,6 +57,7 @@ impl Store { let mut issues = Vec::new(); let mut fresh_log = true; let mut kept = 0; + let mut branch_dirty = false; let log_path = dir.join(LOG); // A log that's there but can't be read (an IO error, or over a lowered cap) may hold // confirmed edits: the file isn't opened, and the log is left as it is for another try. @@ -78,12 +79,14 @@ impl Store { Ok(log) if log.generation == generation => { fresh_log = false; for entry in log.entries { + let is_branch = super::is_branch_journal(&entry); if let Err(e) = server.replay(entry) { issues.push(format!("file {file}: its log stops making sense after {kept} entries ({e}); the rest was dropped")); fresh_log = true; break; } kept += 1; + branch_dirty |= is_branch; } if let Some(why) = log.damaged { issues.push(format!("file {file}: its log ended with {why}; that part was dropped")); @@ -128,7 +131,7 @@ impl Store { (false, Ok(f)) => { let bytes = f.metadata().map_or(LOG_HEADER as u64, |m| m.len()); // Replayed entries make it worth compacting once everyone has left. - Log { generation, file: f, pending: Vec::new(), entries: kept, bytes, dirty: kept > 0 } + Log { generation, file: f, pending: Vec::new(), entries: kept, bytes, dirty: kept > 0, branch_dirty } } // A new snapshot and log of the next generation, so appends start clean. _ => { @@ -173,7 +176,7 @@ impl Store { log::warn!("file {file}: couldn't update {META}: {err}"); } } - Ok(Log { generation, file: f, pending: Vec::new(), entries: 0, bytes: LOG_HEADER as u64, dirty: false }) + Ok(Log { generation, file: f, pending: Vec::new(), entries: 0, bytes: LOG_HEADER as u64, dirty: false, branch_dirty: false }) } /// Compactions so far. diff --git a/apps/figcraft-web/src/main.rs b/apps/figcraft-web/src/main.rs index b65a82772..36d37ed39 100644 --- a/apps/figcraft-web/src/main.rs +++ b/apps/figcraft-web/src/main.rs @@ -22,8 +22,6 @@ //! - host mode: `?host=parent` (a same-origin page embedding FigCraft in an `