#2673 draws an image shown at half its size or less from a filtered,
halved copy. The per-pixel area average from this branch now applies to
that copy below half size and to the image itself above it; the export
test of the average across fractional positions moves to 0.625 of the
image's size, where no copy is made (it still fails without the
average). Test fixtures build text through Shared<TextData> (#1819).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012eBDgsvRwsSRpWeWrzabVY
Main's Selection colors Styles menu (style_items, create_form) is the
menu this branch replaces with the style picker, so the merge keeps the
picker and drops the menu, with main's focus change inside create_form.
What the menu offered stays in the picker opened from a row: this file's
paint styles and each enabled library's published ones under its name,
Create style for the row's paint (selection.createColorStyle, left out
where create_refusal refuses), colour variables, and Detach.
The picker test now also checks that a library's unpublished style is not
offered, as the menu's test did. "No color styles" goes from he.toml too,
which main added with the key.
Import tail (docs/gaps.md Gap 1), as FigCraft-side passes over the mapped
REST JSON in crates/format/src/fig/map.rs (the craft-fig mapper is pinned
and unchanged):
- A connector label without a saved snapshot gets a white, fully rounded
stand-in pill centred under it, padded by the font size, within the layer
budget (labels past it stay bare under the mapper's original note).
- TABLE cells are put back on the table's grid from their own geometry:
offsets within 2 px share a track, a sizeless or misaligned cell takes its
row and column, and no two cells overlap. Fills, strokes and text are kept.
Rotated, non-finite, colliding or oversized tables keep their saved bounds
with a warning. No row or column fields of the file are read.
- The new import notes are counted like the mapper's (`note (×n)`) and
have English keys in crates/ui-egui/locales/en.toml.
- Vector-region style and variable links were already resolved with a
fall-back to the region's own paint; no change.
Fidelity harness (Gap 3), no new dependencies:
- fig::fidelity: compare_documents (layer counts, box L-infinity error,
text/fill/stroke/opacity match rates, warnings) and compare_rgba (SSD,
RMSE, PSNR, luminance SSIM, channels past a tolerance), with JSON and
Markdown scorecards.
- fidelity_tests: metric properties, a built-in corpus that round-trips
through .fig with every layer matched and no new warnings, and an ignored
FIGCRAFT_FIG_CORPUS runner for local real files.
- render: a multi-layer scene drawn before and after a .fig round trip is
compared with compare_rgba (SSIM > 0.99; measured identical).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An app hosting a live session for other machines sent the session token
in the clear over plain ws://. Such a host now serves TLS with an
ephemeral self-signed Ed25519 certificate (DER written by hand with ring,
no new crates), and its invite links pin the certificate's SHA-256
(`cert=`, URL-safe base64): figcraft://join?server=wss://…&cert=… and
wss://…/?cert=…
- tls: the shared session is a rustls::Connection (client or server),
keeping the split reader/writer locking; `accept` answers a server
handshake by the hello deadline; `handshake_pinned` uses a verifier
that compares the end-entity certificate's SHA-256 in constant time
and still checks the TLS 1.2/1.3 handshake signature, refusing any
other certificate before the Hello with a clear reason.
- invite: Endpoint::cert (None for Endpoint::plain), Endpoint::pinned;
a malformed pin, one on ws://, or two that disagree is an error that
never echoes the link. The pin stays out of the WebSocket request URL.
An automation allowlist entry allows only its own pin.
- host/hub: HostConfig::tls, Host::cert_sha256, Host::endpoint; the hub
carries the server config to each connection. Hosting::serve (the
server) is unchanged.
- link: NetLink::host serves TLS for non-loopback binds without a join
code. Join-code (short) shares stay plain ws://: a 20-symbol code has
no room for the pin, and its joiners share the token with the link.
- web: the browser refuses a pinned link with a clear reason.
Tests: pinned join and edit sync both ways, a plain client against a
TLS host, a host presenting another certificate (refused, not admitted),
the request carrying neither token nor pin, link round trips and
malformed cert= values.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
During a version or text preview, ds.doc is the temporary preview while document_itself() holds the underlying synced document, so mark_saved() recorded the wrong baseline and version.exitPreview re-normalised the restored document off saved_doc. Recording synced directly, skipping re-normalisation on version.exitPreview, and rechecking live_kept in live_sync_in after deferred batches or holds clear keeps confirmed server-kept tabs clean.
A tab in a live session counted every edit, everyone's, as unsaved, so closing a tab joined on figcraft-server or quitting asked to save a copy on this computer. The server already keeps the file: once it confirmed every edit (no batch pending or deferred, the tab's document the synced one), the tab is marked saved.
`export`, `convert` and `run --out` take `--strict`. When the .fig,
.penpot or Android Vector Drawable writer reports anything left out or
changed, nothing is written or replaced and the command exits 1 with the
reasons on the error line. A folder of drawables is written only once
none of its files leaves anything out. `--strict` with an output whose
writer reports nothing (png, svg, pdf, ...) or with `--vd-compat ignore`
is a usage error (exit 2), so it never passes without checking anything.
A .figcraft output is accepted for convert and run: it keeps everything.
.fig export writes a vector whose filled areas use both winding rules as
one fillGeometry path per rule, so other readers fill each area as the
network does. The warning that the outline used the first area's rule is
gone.
Image adjustments, list spacing, hanging punctuation and lists, and
vertical trim were already written on main. OpenType features,
variables' publishing, code syntax and inheritance settings, prototype
device settings and text styles on part of a text keep their warnings:
the .fig import (craft_fig's mapping at the pinned craft-libs rev) does
not read them back, so they cannot round-trip yet.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The device-scale detail drawn over a tall frame's capped texture waited
out only a fling, a drag and the wheel. A zoom, a window resize, a move
to a display of another scale or any other change of the view rendered a
new detail, up to 16.8 million pixels on the UI thread, on every frame it
changed. Any change of the page area in view or of its pixel scale from
one frame to the next now counts as motion: the capped texture shows
alone meanwhile, and a frame is asked for so the detail for the still
view is rendered next.
The desktop app and figcraft-cli trusted only the compiled-in public
roots and FIGCRAFT_CA_FILE, so a server behind a proxy with a private
authority needed that variable on every computer. They now also add the
authorities in the operating system's certificate store, unless
FIGCRAFT_NO_SYSTEM_ROOTS is set. Certificates are still always
verified.
With all 8 connection slots taken, a new client now takes the slot of
the connection that has waited longest for its client; a connection
whose request the app is running keeps its slot. Request lines are
counted as they arrive against 64 MiB shared by all connections until
they are answered, so eight clients can no longer make the app hold
eight 32 MiB lines and their parsed trees.
A whiteboard file's connectors came in as loose vectors, so moving a
shape left them behind. On a whiteboard the mapper's adapter now writes
a board connector on each connector drawn as one line on the page: its
ends name the layers it joins (a named magnet is that side, an automatic
one the side facing the other end, an end without a magnet keeps its
point on the layer) or a free page point, with its routing. The REST
importer makes the vector a native board connector once every layer is
in, so the board routes it again when what it joins moves. The import
report counts only the connectors that stayed vectors. Labelled
connectors, connectors inside frames and connectors in design files are
unchanged.
variable.export {format: "dtcg", mode?} writes a group per collection and
a token per variable, nested by the parts of its name: colours as
colorSpace/components objects, numbers as px dimensions or plain numbers
where they are used unitless, aliases as {group.token}, colour
calculations as the colour they show. Strings, booleans, every mode's
value and scopes go under $extensions, so the file reads back whole;
`mode` picks the mode written as $value. Variables > Export offers it,
saved as .tokens.json.
variable.import reads a file holding a $value as tokens: top-level groups
are collections, types are handed down from groups, and color, dimension
(px, rem at 16 px), number, fontWeight, duration, fontFamily, strings,
booleans and aliases become variables, merged as the variables JSON is.
A plain file fills the default mode of the same-named collection.
Composite tokens are skipped and counted in the warnings.
node.create (and the MCP create_node tool) takes children: node.create
params made inside the new layer, each with its own children, in one
command and one undo step. The result mirrors the tree, so a batch step
names any layer in it with a field path (children/1/id). A refused
child names its place (children[1].children[0]: ...) and nothing is
made.
Text in a family that isn't installed drew in the default face (Inter,
Helvetica... in Regular) whatever the family and style, so code set in
Menlo came out proportional and SF Pro Bold came out regular. A small
table now picks an installed stand-in of similar design and width for
the common UI and code families, in the style asked. The family stays
reported as missing.
An edit that turned another layer Fixed (a child set to Fill turning its
hugging parent Fixed, a frame set to Hug turning the children that filled
it Fixed) only showed the canvas notice, so a script got no hint why a
frame stopped growing. node.set now lists each such layer in `warnings`
with its id, name, key and old sizing.
A variant grown or moved past a component set that clips and has no auto
layout keeps being cut off (the set is sized only when variants are
combined or added). node.set now names such a variant in `warnings` and
points at layout.add on the set.
Changing a stroke weight, corner radius or any other value by scrubbing
its field left the selection's frame and handles over the layer, so the
result couldn't be judged without deselecting. While a field is scrubbed
(the shared widgets::scrub gesture, used by every number field and the
typography icons) the canvas now hides the selection's frame, handles
and size label, as it already did while the colour picker is used, and
draws them again once the drag is let go. A press without a drag leaves
them.