From 297426c595b7b681d537d92bc39f2e4b593e9853 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Fri, 6 Nov 2026 22:21:51 -0800 Subject: [PATCH 001/101] Export: color profile text states which formats are tagged and that CMYK PDF is DeviceCMYK The export tool and command descriptions, docs/mcp.md and the file-format table said PDF is always sRGB, that sRGB JPG is untagged and that every exported file is tagged with its profile. RGB PDF is sRGB and PDF with cmyk is DeviceCMYK; JPG embeds an ICC profile for sRGB and Display P3; WebP embeds one for Display P3 only. The JPG quality (1 to 100, default 90) now has one row in the format table. --- crates/engine/src/cmd/file.rs | 2 +- crates/mcp/src/tools.rs | 2 +- docs/file-format-parity.md | 7 +++---- docs/mcp.md | 4 ++-- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/crates/engine/src/cmd/file.rs b/crates/engine/src/cmd/file.rs index 0ed12b8d3..e52960d43 100644 --- a/crates/engine/src/cmd/file.rs +++ b/crates/engine/src/cmd/file.rs @@ -120,7 +120,7 @@ pub fn specs() -> Vec { spec!( "file.export", "Export", - "{ids? (default selection, else the page), format? (png|jpg|svg|pdf|webp|xml (an Android Vector Drawable, with `warnings` for what it changed or left out), or fig: the whole file as .fig, experimental, with `warnings` for what was left out; other apps may not open every file; or penpot: the whole file as a Penpot 2.x archive, with warnings for unsupported content), scale? (default 1) | size? (2x|512w|512h or {by: scale|width|height, value}: a scale, or a width or height in pixels), path? (else returns base64 `data`), bleed? (PDF: points, or with a unit: \"3mm\", \"0.125in\", \"9pt\"), cropMarks?, bleedMarks?, cmyk? (PDF print options), contentsOnly? (default true; false also draws the layers that show in their area), includeBoundingBox? (true: only the layers' own boxes, cutting off shadows and outside strokes), svgOutlineText? (default true), svgSimplifyStroke? (default true), svgIdAttribute? (SVG ids, XML android:name), vdCompat? (XML: bestEffort (default: approximate with a warning)|exact (leave out what can't be exact, with a warning)|ignore (no warnings)), colorProfile? (PNG, JPG and WebP: sameAsFile (default: the document's profile)|srgb|displayP3; colors convert, out-of-gamut ones clip; SVG, PDF and XML are always sRGB), quality? (JPG: 1-100, default 90)}", + "{ids? (default selection, else the page), format? (png|jpg|svg|pdf|webp|xml (an Android Vector Drawable, with `warnings` for what it changed or left out), or fig: the whole file as .fig, experimental, with `warnings` for what was left out; other apps may not open every file; or penpot: the whole file as a Penpot 2.x archive, with warnings for unsupported content), scale? (default 1) | size? (2x|512w|512h or {by: scale|width|height, value}: a scale, or a width or height in pixels), path? (else returns base64 `data`), bleed? (PDF: points, or with a unit: \"3mm\", \"0.125in\", \"9pt\"), cropMarks?, bleedMarks?, cmyk? (PDF print options), contentsOnly? (default true; false also draws the layers that show in their area), includeBoundingBox? (true: only the layers' own boxes, cutting off shadows and outside strokes), svgOutlineText? (default true), svgSimplifyStroke? (default true), svgIdAttribute? (SVG ids, XML android:name), vdCompat? (XML: bestEffort (default: approximate with a warning)|exact (leave out what can't be exact, with a warning)|ignore (no warnings)), colorProfile? (PNG, JPG and WebP: sameAsFile (default: the document's profile)|srgb|displayP3; colors convert, out-of-gamut ones clip; SVG, XML and RGB PDF output are always sRGB; PDF with cmyk is DeviceCMYK), quality? (JPG: 1-100, default 90)}", false, export ), diff --git a/crates/mcp/src/tools.rs b/crates/mcp/src/tools.rs index 9e901f5bb..5d4296f01 100644 --- a/crates/mcp/src/tools.rs +++ b/crates/mcp/src/tools.rs @@ -280,7 +280,7 @@ fn tools() -> Vec { "svgIdAttribute": boolean("SVG: layer names as unique `id` attributes (default false)"), "svgSimplifyStroke": boolean("SVG: strokes as `stroke` attributes where exact (default true); false writes outlines"), "vdCompat": {"type": "string", "enum": ["bestEffort", "exact", "ignore"], "description": "XML: what a Vector Drawable can't draw exactly is approximated with a warning (bestEffort, default), left out with a warning (exact), or written as far as it maps without warnings (ignore: overlapping layer opacity dropped, even-odd fills kept as fillType=evenOdd, diamond gradients left out)"}, - "colorProfile": {"type": "string", "enum": ["sameAsFile", "srgb", "displayP3"], "description": "PNG, JPG and WebP: the color profile of the file (default sameAsFile: the document's); colors are converted and out-of-gamut ones clip. SVG, PDF and XML are always sRGB"}, + "colorProfile": {"type": "string", "enum": ["sameAsFile", "srgb", "displayP3"], "description": "PNG, JPG and WebP: the color profile of the file (default sameAsFile: the document's); colors are converted and out-of-gamut ones clip. SVG, XML and RGB PDF output are always sRGB; PDF with cmyk is DeviceCMYK"}, "quality": {"type": "integer", "minimum": 1, "maximum": 100, "description": "JPG: the encoder's quality, 1 (smallest file) to 100; default 90"}, }), &[], diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index bce90b008..335115ad1 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -54,12 +54,11 @@ export limit, not a native document nesting limit. | Format | Figma | FigCraft | Notes | Hours | |---|---|---|---|---| | PNG | yes, scales/suffixes | yes | export settings per layer, presets (`2x`, `512w`, `512h`), preview, "Export N layers"; ignore overlapping layers (on by default; off: every layer showing in the area) and include bounding box (the layer's own box; the Export section offers it for text layers, and `file.export` and `export.update` take it for any layer); slashes in layer names export into folders. The exported area is what the layer paints: shadows towards their offset, outside and centre strokes, unclipped children, a mask group's mask, nothing for hidden layers; slices export everything under them, except that with ignore overlapping layers on a slice inside a frame or group exports only that frame or group; sides round up to whole pixels | — | -| JPG | yes | yes | white where transparent; quality 1 to 100 (`quality` on `file.export`, export settings and MCP `export`; default 90; the Export panel has no control for it yet); the file's colour profile embedded as ICC (APP2), sRGB too | — | +| JPG | yes | yes | white where transparent; quality 1 to 100 (`quality` on `file.export`, export settings and MCP `export`; default 90; the Export panel has no control for it yet); a color profile per setting as for PNG (`colorProfile`), the file tagged with an ICC profile (APP2) for sRGB and for Display P3 | — | | PNG | yes, scales/suffixes | yes | export settings per layer, presets (`2x`, `512w`, `512h`), preview, "Export N layers"; ignore overlapping layers (on by default; off: every layer showing in the area) and include bounding box (the layer's own box; the Export section offers it for text layers, and `file.export` and `export.update` take it for any layer); slashes in layer names export into folders. The exported area is what the layer paints: shadows towards their offset, outside and centre strokes, unclipped children, a mask group's mask, nothing for hidden layers; slices export everything under them, except that with ignore overlapping layers on a slice inside a frame or group exports only that frame or group; sides round up to whole pixels; a color profile per setting (Same as file, the default, sRGB or Display P3: `colorProfile`), the pixels converted and the file tagged (`sRGB` chunk, or ICC and `cICP`) | — | -| JPG | yes | yes | white where transparent; fixed quality (90); a color profile per setting as for PNG (sRGB untagged, Display P3 with its ICC profile) | — | | SVG | yes (outline text option, ids) | yes | alpha/luminance masks kept; noise, texture, progressive and background blur, glass embedded as images; outline text (off: `` with one `` per line, one style per layer), unique id attributes from layer names, explicit depth-limit refusal, nested frames clipped by their parent's clip (#327), simplified strokes (stroke attributes for centred strokes and for inside and outside strokes on boxes and ellipses) | — | | PDF | yes | yes | one page per frame, real selectable text in subset fonts, links, vectors and gradients as vectors, effects as images; bleed, crop/bleed marks, page boxes, naive CMYK; checked by rendering the PDF back against PNG exports; explicit depth-limit refusal; RGB is always sRGB (no color profile setting and no output intent) | CMYK output intent 2–4 | -| WebP | — | yes (ours) | a color profile per setting as for JPG | — | +| WebP | — | yes (ours) | a color profile per setting as for PNG; sRGB files untagged, Display P3 files with the generated ICC profile | — | | Android Vector Drawable (XML) | — | yes (ours) | an `.xml` drawable resource (`file.export {format: "xml"}`, export settings, File ▸ Export…, the CLI and MCP), pretty-printed, sized in dp with the viewport in layer units, for AndroidX (VectorDrawableCompat: gradients and even-odd need API 24 without it). Shapes, booleans and text as path data with transforms baked in; solid fills and linear, radial and sweep gradients (`aapt:attr`, exact for any handles: radial and sweep in a `` that maps the unit circle); centred strokes as stroke attributes where Android draws them the same (uniform scale, one cap, no dashes or variable width), other strokes as filled outlines; clipping frames and masks as `` with ``; `android:name` from layer names with the id attribute option. What the format can't hold goes by the compatibility mode (`vdCompat`): best effort (default) applies layer opacity to each shape, rewrites even-odd fills and clip outlines as non-zero, draws diamond gradients as radial and alpha masks as outline clips, each with a warning; exact leaves out what it can't draw exactly, with a warning; ignore writes what maps without warnings: layer opacity over overlapping shapes is dropped (drawn opaque), even-odd fills keep `fillType="evenOdd"`, even-odd clip outlines clip as non-zero, diamond gradients are left out and alpha masks clip to their outline. Effects, image and pattern fills and blend modes are always left out (warned except in ignore); an export that draws nothing writes one empty path (Android refuses a drawable without a path), with a warning. Checked by parsing the XML, against FigCraft's renderer (gradients pixel by pixel), with `aapt2 compile` and `link`, and by rendering samples (linear, skewed radial and sweep gradients, a sweep with mirrored handles, even-odd booleans, centred and inside strokes, rotated text, a clipping frame, an alpha mask, a translucent group, each compatibility mode) with Android 13's (API 33) VectorDrawable on an emulator, next to FigCraft's PNG export: they match, including where the sweep starts and which way it turns, except what the compatibility mode and its warnings say (best effort: overlapping shapes in a translucent group look denser; exact and ignore leave out or draw opaque what they list). Not checked on API 21–23 (VectorDrawableCompat) | — | | Copy as CSS / SVG / PNG / text / link | yes | yes | Copy as PNG: the whole selection at 2x | — | | Dev Mode code (CSS, iOS SwiftUI, Android Compose) | yes | yes, plus HTML, React, Vue, Leptos, ArkUI and Flutter | see [dev-mode-parity](dev-mode-parity.md) | — | @@ -193,7 +192,7 @@ source paint coordinates. | 2026-11-04 | minor | JPG export: `quality` (1 to 100, default 90) on `file.export`, `export.add` / `export.update` and MCP `export`, kept in the export setting; an sRGB file's JPGs embed the sRGB ICC profile, as Display P3 files' JPGs already embedded theirs, since an untagged JPG is only assumed to be sRGB (#2004). | | 2026-11-04 | minor | `.fig` and `.jam` import, #1910: an elbowed connector saved with its path keeps it. FigJam stores `connectorControlPoints`, one per run between the first and the last, each a point on its run (in the connector's parent's coordinates) with the run's axis; the first run leaves the start's side and the last arrives at the end's. They become the `ConnectorPath::Runs` a board connector reshaped by hand has (`figcraft_doc::route_along`), so a connector drawn around a layer in FigJam stays around it instead of being routed through it. Points that don't make such a path (off both axes, two runs in a row the same way, a first or last run sideways to its side or going back into its object, more runs than a hand could make) leave the connector to the router as before, and only connectors routed here count in the "follow FigCraft's own routing" note. A curved connector's `connectorBezierControlPoints` are still not read. Tests: `tail_tests::an_elbow_connector_saved_with_its_path_keeps_it`, `tail_tests::an_elbow_whose_saved_path_doesnt_fit_its_sides_is_routed_here`. | | 2026-11-01 | patch | `.fig` and `.jam` import: a connector without a saved snapshot (elbowed and curved ones are routed here) took no stroke, so it was invisible (#1807); its line's paint, weight, cap and dashes now come from the file's generated line record, as a saved snapshot's do, and the connector's own values, when it has any, win. Test: `fig::connector_label_tests::a_routed_connector_takes_its_line_style_from_the_generated_record`. Numbers unchanged | -| 2026-10-31 | minor | Export settings: each PNG, JPG and WebP setting has a color profile, Same as file (the default; the document's profile when it exports), sRGB or Display P3, in its advanced settings and as `colorProfile` on `export.add`, `export.update`, `file.export`, `file.exportLayers` and MCP `export`. The pixels convert to the chosen profile (out-of-gamut colors clip) and the file is tagged as before: sRGB PNG with an `sRGB` chunk, Display P3 with the generated ICC profile (and `cICP` in PNG); sRGB JPG and WebP stay untagged. A setting keeps its choice when its format changes; settings saved without one read as Same as file. SVG, PDF and XML show no choice and stay sRGB (PDF has no output intent yet). Numbers unchanged | +| 2026-10-31 | minor | Export settings: each PNG, JPG and WebP setting has a color profile, Same as file (the default; the document's profile when it exports), sRGB or Display P3, in its advanced settings and as `colorProfile` on `export.add`, `export.update`, `file.export`, `file.exportLayers` and MCP `export`. The pixels convert to the chosen profile (out-of-gamut colors clip) and the file is tagged as before: sRGB PNG with an `sRGB` chunk, Display P3 with the generated ICC profile (and `cICP` in PNG); sRGB JPG embeds the sRGB ICC profile (#2004) and sRGB WebP stays untagged. A setting keeps its choice when its format changes; settings saved without one read as Same as file. SVG, PDF and XML show no choice and stay sRGB (PDF has no output intent yet). Numbers unchanged | | 2026-10-31 | patch | M4: Dash and Custom strokes have a Dash cap (None, Round, Square) in the advanced stroke settings and `node.set {dashCap}`, on both ends of every dash on the canvas and in PNG, PDF and SVG. Unset, dashes keep taking the end point caps, so older files look the same; the saved file writes it only when set. Numbers unchanged | | 2026-10-30 | minor | `.fig` import: a connector's label without a saved snapshot was skipped; now the connector imports as a frame holding its line and the label, as a connector with a saved snapshot does, the label centred on the line's middle by length (in a 200-wide box, laid out again with the fonts at hand), in the connector's fill paints or black. Its background isn't known without the snapshot and is left out. Not checked on real files. Test: `fig::tests::tail::a_labelled_connector_without_a_snapshot_keeps_its_label` | | 2026-10-30 | minor | Pasted content row: an image the clipboard doesn't carry keeps its name and shows a placeholder that reads as missing; the paste names those layers in its message and opens the import report with its notes (#1646). Numbers unchanged | diff --git a/docs/mcp.md b/docs/mcp.md index aebcbf46d..11945a76c 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -255,7 +255,7 @@ Or in a project's `.mcp.json`: profile into the file's space: an embedded ICC profile (PNG, JPG, WebP, TIFF; RGB or grey), a PNG's `sRGB` / `gAMA` / `cHRM` chunks, else sRGB (also for CMYK or damaged profiles); `image.place` reports the profile's name as `imageProfile` (`null`: none usable, taken as sRGB). PNG exports are tagged (`sRGB` chunk, or a Display P3 ICC profile plus - `cICP`), Display P3 JPG and WebP embed the ICC profile, and SVG and PDF export Display P3 files + `cICP`), JPG embeds the ICC profile for sRGB and for Display P3, WebP embeds it for Display P3 only (sRGB WebP is untagged), and SVG and PDF export Display P3 files converted to sRGB (out-of-gamut colours clip). The app's canvas shows sRGB (P3 colours outside sRGB clip on screen): `view.proofSrgb {on?}` (View ▸ Soft-proof sRGB) stripes those pixels so `screenshot {window: true}` shows where they are (after the next canvas render), and the colour picker says Outside @@ -380,7 +380,7 @@ a later step can use `{"$step": 0, "field": "ids/0"}` to target the first match. | `inspect_document {depth, allPages, fields?, outline?}` | The document as JSON (its `id`, layer tree, styles, selection, history); `fields` selects layer properties, `outline: true` gives a compact tree (below). The tools that act on a document also take `document` (see Naming the document below). | | `get_node {id, depth, fields?, outline?}` | One layer as JSON; takes the same `fields` and `outline` options; `pluginData` (`{key: value}`, values as strings) when the layer or page has layer data written with `set_properties {props: {pluginData}}`. | | `select {ids}` | Replace the selection (`[]` deselects). | -| `export {ids, format, scale \| size, path?, bleed?, cropMarks?, bleedMarks?, cmyk?, contentsOnly?, includeBoundingBox?, svgOutlineText?, svgIdAttribute?, svgSimplifyStroke?, vdCompat?, colorProfile?, quality?}` | png, jpg, svg, webp, pdf, xml (an Android Vector Drawable: `svgIdAttribute` writes `android:name`, `vdCompat` is `bestEffort` (default: approximated with a warning), `exact` (left out with a warning) or `ignore` (no warnings: overlapping layer opacity dropped, even-odd fills kept as `fillType="evenOdd"`, diamond gradients left out), and the result lists `warnings` for what was changed or left out), or `fig`: the whole file as `.fig`, experimental (see Exporting `.fig` files below); `size` is `2x`, `512w` or `512h`; `quality` is the JPG quality, 1 to 100 (default 90). The image covers what the layers paint (shadows towards their offset, strokes, unclipped children, a mask group's mask; hidden layers take no room; a slice is its area with everything under it, or only the frame or group it sits in while `contentsOnly` is on); `contentsOnly: false` also draws every other layer showing in that area, `includeBoundingBox` exports the layers' own boxes; SVG: `svgOutlineText: false` keeps ``, `svgIdAttribute` writes unique ids from layer names, `svgSimplifyStroke: false` writes every stroke as an outline; png, jpg and webp: `colorProfile` is `sameAsFile` (default: the document's profile), `srgb` or `displayP3`, the pixels converted (out-of-gamut colors clip) and the file tagged for it (SVG, PDF and XML are always sRGB). The same options go in export settings (`export.add` / `export.update`). PDF: frames one page each (sized in points), anything else together on one page; print options: `bleed` (points or a length like `"3mm"`, `"0.125in"`), crop and bleed marks, CMYK colour (see Exports below), also taken by `file.export`, `file.exportLayers`, `file.exportFramesPdf` and stored per export setting by `export.add` / `export.update`; `run_command` `file.exportFramesPdf {page?, path?}` writes every top-level frame of a page. Without `path`, images come back as MCP image content, SVG as text, XML as text followed by `{format, bytes, warnings}`. Layers' own export settings: `run_command` with `export.add` / `export.update {index, size?, suffix?, format?}` / `export.remove` and `file.exportLayers {ids?, dir?, assets?}` (every layer once per setting, named `.`, a slash in a layer name making a folder; `assets: true` exports the Inspect tab's assets instead: icons as SVG, images as PNG). | +| `export {ids, format, scale \| size, path?, bleed?, cropMarks?, bleedMarks?, cmyk?, contentsOnly?, includeBoundingBox?, svgOutlineText?, svgIdAttribute?, svgSimplifyStroke?, vdCompat?, colorProfile?, quality?}` | png, jpg, svg, webp, pdf, xml (an Android Vector Drawable: `svgIdAttribute` writes `android:name`, `vdCompat` is `bestEffort` (default: approximated with a warning), `exact` (left out with a warning) or `ignore` (no warnings: overlapping layer opacity dropped, even-odd fills kept as `fillType="evenOdd"`, diamond gradients left out), and the result lists `warnings` for what was changed or left out), or `fig`: the whole file as `.fig`, experimental (see Exporting `.fig` files below); `size` is `2x`, `512w` or `512h`; `quality` is the JPG quality, 1 to 100 (default 90). The image covers what the layers paint (shadows towards their offset, strokes, unclipped children, a mask group's mask; hidden layers take no room; a slice is its area with everything under it, or only the frame or group it sits in while `contentsOnly` is on); `contentsOnly: false` also draws every other layer showing in that area, `includeBoundingBox` exports the layers' own boxes; SVG: `svgOutlineText: false` keeps ``, `svgIdAttribute` writes unique ids from layer names, `svgSimplifyStroke: false` writes every stroke as an outline; png, jpg and webp: `colorProfile` is `sameAsFile` (default: the document's profile), `srgb` or `displayP3`, the pixels converted (out-of-gamut colors clip) and the file tagged for it (PNG: `sRGB` chunk, or ICC and `cICP` for Display P3; JPG: ICC profile; WebP: ICC profile for Display P3, none for sRGB) (SVG, XML and RGB PDF output are always sRGB; PDF with `cmyk` is DeviceCMYK). The same options go in export settings (`export.add` / `export.update`). PDF: frames one page each (sized in points), anything else together on one page; print options: `bleed` (points or a length like `"3mm"`, `"0.125in"`), crop and bleed marks, CMYK colour (see Exports below), also taken by `file.export`, `file.exportLayers`, `file.exportFramesPdf` and stored per export setting by `export.add` / `export.update`; `run_command` `file.exportFramesPdf {page?, path?}` writes every top-level frame of a page. Without `path`, images come back as MCP image content, SVG as text, XML as text followed by `{format, bytes, warnings}`. Layers' own export settings: `run_command` with `export.add` / `export.update {index, size?, suffix?, format?}` / `export.remove` and `file.exportLayers {ids?, dir?, assets?}` (every layer once per setting, named `.`, a slash in a layer name making a folder; `assets: true` exports the Inspect tab's assets instead: icons as SVG, images as PNG). | | `screenshot {ids?, scale?, maxSize?, window?}` | PNG of the page (with background) or of layers, scaled to fit `maxSize` (default 1600). `window: true` captures the app window in front when attached, a window id (see Windows below) that window. | | `open_file {path, variables?, reload?}` / `save_file {path?}` | Open `.figcraft`, `.json` (FigCraft JSON or REST API file JSON with its variables, see below), `.fig` or FigJam `.jam` (best effort, see below), `.sketch` (Sketch 48 and newer, best effort), `.svg` (see Importing SVG below) or an image; save as `.figcraft`. `open_file` returns `opened` (for a file opened anew, a `summary` of `name`, `pages`, `layers` and `images`, and `warnings` or `repairs`; a file that was already open gives its `index`, with `stale: true` when the file changed on disk since that tab read or saved it; `reload: true` reads it again into the tab, refused while the tab has unsaved changes) and the document's `document` outline. | | `undo` / `redo` | Step through history. | From bc2984a998dcef49844878871640ead076c9ed35 Mon Sep 17 00:00:00 2001 From: Patrik Lermon Date: Sat, 7 Nov 2026 07:55:28 +0100 Subject: [PATCH 002/101] i18n(sv): translate 69 new strings Brings the Swedish catalog up to date with upstream main (3635c230). Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/locales/sv.toml | 69 ++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/crates/ui-egui/locales/sv.toml b/crates/ui-egui/locales/sv.toml index a94feb2a9..c3834d2b6 100644 --- a/crates/ui-egui/locales/sv.toml +++ b/crates/ui-egui/locales/sv.toml @@ -127,6 +127,7 @@ name = "Svenska" "Another server, or one that needs its key. The usual server is set in Preferences." = "En annan server, eller en som kräver sin nyckel. Standardservern anges i Inställningar." "Any status" = "Valfri status" "Anyone on your network with this code can edit the file, while this app stays open." = "Alla i ditt nätverk som har den här koden kan redigera filen så länge appen är öppen." +"Anyone on your network with this code can look at the file, not change it, while this app stays open." = "Alla i ditt nätverk som har den här koden kan titta på filen, men inte ändra den, så länge appen är öppen." "Anyone with the edit link can change the file; the view link only lets people look. The links carry their secrets: share them like passwords. `figcraft-server links` makes more and revokes them." = "Alla med redigeringslänken kan ändra filen; visningslänken låter bara andra titta. Länkarna innehåller sina hemligheter: dela dem som lösenord. `figcraft-server links` skapar fler och återkallar dem." "Anyone with this code can edit the file." = "Alla med den här koden kan redigera filen." "Anyone with this code can look at the file, not change it." = "Alla med den här koden kan titta på filen, men inte ändra den." @@ -387,6 +388,8 @@ name = "Svenska" "Crop marks" = "Skärmärken" "Ctrl+arrows" = "Ctrl+piltangenter" "Ctrl+click" = "Ctrl+klick" +"Ctrl+click a padding field" = "Ctrl+klicka på ett padding-fält" +"⌘ click a padding field" = "⌘ klicka på ett padding-fält" "Ctrl+scroll" = "Ctrl+rullning" "Current name" = "Aktuellt namn" "Current version" = "Aktuell version" @@ -406,6 +409,40 @@ name = "Svenska" "Decoration style" = "Dekorationsstil" "Decoration" = "Dekoration" "Deep select" = "Djupmarkering" +"Scrub a field faster (2x) or slower (1/2, 1/4)" = "Dragjustera ett fält snabbare (2x) eller långsammare (1/2, 1/4)" +"Move up or down while dragging its label" = "Flytta upp eller ned medan du drar dess etikett" +"Scrubbing at 2x" = "Dragjustering med 2x hastighet" +"Scrubbing at 1x" = "Dragjustering med 1x hastighet" +"Scrubbing at 1/2" = "Dragjustering med 1/2 hastighet" +"Scrubbing at 1/4" = "Dragjustering med 1/4 hastighet" +"Delete {n} variables" = { one = "Radera {n} variabel", other = "Radera {n} variabler" } +"Move out of any group" = "Flytta ut ur alla grupper" +"Move to group {group}" = "Flytta till gruppen {group}" +"Scope: all supported properties" = "Omfång: alla egenskaper som stöds" +"Scope: hidden from pickers" = "Omfång: dold i väljare" +"Scope: only {scope}" = "Omfång: endast {scope}" +"Disconnected. Reconnecting…" = "Frånkopplad. Återansluter…" +"Disconnected. Your edits stay here and sync when the connection returns. Reconnecting…" = "Frånkopplad. Dina redigeringar finns kvar här och synkas när anslutningen är tillbaka. Återansluter…" +"Dismiss" = "Stäng" +"Not connected: {reason}. Your work is still in this tab." = "Inte ansluten: {reason}. Ditt arbete finns kvar i den här fliken." +"Retry now" = "Försök igen nu" +"Save a copy…" = "Spara en kopia…" +"Wrap style" = "Radbrytningsstil" +"Text direction" = "Textriktning" +"Auto: by the first letter with a direction" = "Auto: efter den första bokstaven som har en riktning" +"Left to right" = "Vänster till höger" +"Right to left" = "Höger till vänster" +"Balance" = "Balans" +"Pretty" = "Snygg" +"Auto: as many words as fit on each line" = "Auto: så många ord som får plats på varje rad" +"Balance: every line close to the same length" = "Balans: alla rader ungefär lika långa" +"Pretty: full lines, no one word alone on the last" = "Snygg: fulla rader, inget ensamt ord på den sista" +"Set hug contents" = "Ställ in Omslut innehåll" +"Set fill container" = "Ställ in Fyll behållaren" +"Double-click an edge of an auto layout frame" = "Dubbelklicka på en kant av en auto layout-frame" +"{name}, disconnected from its live session" = "{name}, frånkopplad från sin livesession" +"⌥ double-click an edge of an auto layout child" = "⌥ dubbelklicka på en kant av ett underordnat objekt i auto layout" +"Alt+double-click an edge of an auto layout child" = "Alt+dubbelklicka på en kant av ett underordnat objekt i auto layout" "Default" = "Standard" "Default content" = "Standardinnehåll" "Default value (the top-left variant)" = "Standardvärde (varianten längst upp till vänster)" @@ -493,6 +530,7 @@ name = "Svenska" "Edit dev resource" = "Redigera utvecklarresurs" "Edit link" = "Redigeringslänk" "Edit link copied" = "Redigeringslänken har kopierats" +"Edit padding on all sides" = "Redigera padding på alla sidor" "Edit style" = "Redigera stil" "Edit variable" = "Redigera variabel" "Edit with the builder" = "Redigera med byggaren" @@ -530,6 +568,7 @@ name = "Svenska" "Exclusion" = "Uteslutning" "Exit focus view (Esc)" = "Lämna fokusvyn (Esc)" "Expand" = "Expandera" +"Expand the interface" = "Expandera gränssnittet" "Export" = "Exportera" "Export all" = "Exportera alla" "Export frames and layers as PNG, JPG, SVG or PDF" = "Exportera frames och lager som PNG, JPG, SVG eller PDF" @@ -1072,6 +1111,7 @@ name = "Svenska" "Pages: {pages}" = "Sidor: {pages}" "Paint bucket" = "Färghink" "Pan the canvas" = "Panorera arbetsytan" +"Show and move the placement crosshair (its tool chosen, nothing selected)" = "Visa och flytta placeringshårkorset (med dess verktyg valt och inget markerat)" "Pan with nothing selected (Shift: farther)" = "Panorera när inget är markerat (Shift: längre)" "Panels" = "Paneler" "Paper" = "Papper" @@ -1296,6 +1336,7 @@ name = "Svenska" "See all templates" = "Se alla mallar" "Select layers and they space themselves as their content changes" = "Markera lager så fördelar de avståndet själva när innehållet ändras" "SHA-256: {sha}…" = "SHA-256: {sha}…" +"Same as file ({profile})" = "Samma som filen ({profile})" "Same as layer" = "Samma som lagret" "Saturation" = "Mättnad" "Save" = "Spara" @@ -1968,6 +2009,17 @@ name = "Svenska" "⌘ click" = "⌘ klicka" "⌘ scroll" = "⌘ rulla" "⌥ drag" = "⌥ dra" +"Selection box: switch to pick select" = "Markeringsruta: växla till plockmarkering" +"Pick select: next or previous layer" = "Plockmarkering: nästa eller föregående lager" +"Pick select: into a layer, out to its parent" = "Plockmarkering: in i ett lager, ut till dess överordnade" +"Pick select: select the picked layer" = "Plockmarkering: markera det valda lagret" +"⇥ or ⌥ Space again" = "⇥ eller ⌥ Blanksteg igen" +"Tab or Ctrl+Space again" = "Tab eller Ctrl+Blanksteg igen" +"↵ / ⇧↵" = "↵ / ⇧↵" +"Enter / Shift+Enter" = "Enter / Shift+Enter" +"Space" = "Blanksteg" +"Nothing to pick: the page is empty" = "Inget att välja: sidan är tom" +"Pick select: Tab and Shift+Tab move between layers, Enter goes into one, Shift+Enter out, Space selects, Escape cancels" = "Plockmarkering: Tab och Shift+Tab flyttar mellan lager, Enter går in i ett, Shift+Enter ut, Blanksteg markerar, Esc avbryter" [commands] @@ -2004,6 +2056,7 @@ name = "Svenska" "board.label" = "Kopplingsetikett" "board.nextSticky" = "Nästa lapp" "board.reattach" = "Koppla om koppling" +"board.reshape" = "Omforma koppling" "board.setColor" = "Whiteboardfärg" "board.setStyle" = "Whiteboardstil" "board.shape" = "Form med text" @@ -2046,6 +2099,7 @@ name = "Svenska" "collab.openFile" = "Öppna onlinefil" "collab.peers" = "Personer i den här filen" "collab.publish" = "Publicera på server" +"collab.reconnect" = "Återanslut livesessionen" "collab.recoverFile" = "Återställ onlinefil" "collab.registerLinks" = "Öppna inbjudningslänkar i FigCraft" "collab.removePerson" = "Ta bort från session" @@ -2193,6 +2247,7 @@ name = "Svenska" "image.deletePreset" = "Radera förinställning" "image.place" = "Placera bild" "image.presets" = "Bildförinställningar" +"image.replace" = "Ersätt bild" "image.savePreset" = "Spara förinställning" "inspect.assets" = "Resurser" "inspect.code" = "Kod" @@ -2210,6 +2265,7 @@ name = "Svenska" "layers.collapseAll" = "Fäll ihop alla" "layout.add" = "Lägg till auto layout" "layout.remove" = "Ta bort auto layout" +"layout.removeAll" = "Ta bort all auto layout" "layout.setTrack" = "Ange spår" "layout.suggest" = "Föreslå layout" "libraries.open" = "Öppna bibliotek" @@ -2304,6 +2360,9 @@ name = "Svenska" "pref.showDimensions" = "Visa dimensioner på objekt" "pref.startOnHome" = "Börja på Start" "pref.uiScale" = "Gränssnittsstorlek" +"pref.uiScaleDown" = "Mindre gränssnitt" +"pref.uiScaleReset" = "Standardstorlek för gränssnittet" +"pref.uiScaleUp" = "Större gränssnitt" "pref.userName" = "Ditt namn" "proto.action.add" = "Lägg till prototypåtgärd" "proto.action.move" = "Ändra ordning på prototypåtgärd" @@ -2351,6 +2410,7 @@ name = "Svenska" "selection.applyColorStyle" = "Använd färgformatmall på markeringen" "selection.bindColorVariable" = "Använd färgvariabel på markeringen" "selection.colors" = "Markeringsfärger" +"selection.createColorStyle" = "Skapa färgstil från markeringen" "selection.detachColor" = "Koppla bort markeringsfärg" "selection.selectColor" = "Markera lager med den här färgen" "selection.setPaint" = "Ändra markeringens färg" @@ -2397,6 +2457,10 @@ name = "Svenska" "text.caseUpper" = "Versaler" "text.create" = "Text" "text.decoration" = "Dekoration" +"text.direction" = "Textriktning" +"text.directionAuto" = "Textriktning: auto" +"text.directionLtr" = "Textriktning: vänster till höger" +"text.directionRtl" = "Textriktning: höger till vänster" "text.edit.begin" = "Redigera text" "text.edit.caret" = "Placera markören" "text.edit.end" = "Sluta redigera text" @@ -2421,6 +2485,7 @@ name = "Svenska" "text.missingFonts" = "Saknade typsnitt" "text.numberList" = "Numrerad lista" "text.onPath" = "Text på bana" +"text.openLink" = "Öppna länk" "text.paragraphIndent" = "Styckeindrag" "text.paragraphSpacing" = "Styckeavstånd" "text.pathOptions" = "Alternativ för textbana" @@ -2440,9 +2505,11 @@ name = "Svenska" "text.underline" = "Understrykning" "text.weightDown" = "Minska teckenvikten" "text.weightUp" = "Öka teckenvikten" +"text.wrapStyle" = "Radbrytningsstil" "tool.arrow" = "Pil" "tool.comment" = "Kommentar" "tool.connector" = "Koppling" +"tool.crosshair" = "Flytta placeringshårkorset" "tool.ellipse" = "Ellips" "tool.eraser" = "Suddgummi" "tool.frame" = "Frame" @@ -2486,6 +2553,7 @@ name = "Svenska" "variable.deleteCollection" = "Radera samling" "variable.duplicate" = "Duplicera variabel" "variable.export" = "Exportera variabler" +"variable.extendCollection" = "Utöka samlingen" "variable.import" = "Importera variabler" "variable.list" = "Lista variabler" "variable.moveMode" = "Flytta läge" @@ -2559,6 +2627,7 @@ name = "Svenska" "view.layoutGrids" = "Layoutrutnät" "view.leftSidebar" = "Visa/dölj vänster sidofält" "view.maskOutlines" = "Konturlinjer för masker" +"view.minimize" = "Minimera gränssnittet" "view.multiplayerCursors" = "Samarbetsmarkörer" "view.nextFrame" = "Zooma till nästa frame" "view.nextPage" = "Nästa sida" From d252d35f27f8baad062dfc93c058b1c230f00fa7 Mon Sep 17 00:00:00 2001 From: Helen Kwok <107752876+helenkwok@users.noreply.github.com> Date: Sat, 7 Nov 2026 10:28:06 +0800 Subject: [PATCH 003/101] figcraft-web: inspect and openFile go through craft-web-api, so they time out and cancel like the other functions inspect is docInspect under its earlier name, and openFile calls the crate's execute with file.open, so a call the app does not answer within 30 seconds rejects and a request the app has not started is cancelled. --- apps/figcraft-web/src/api.rs | 31 +++++++++++-------------------- 1 file changed, 11 insertions(+), 20 deletions(-) diff --git a/apps/figcraft-web/src/api.rs b/apps/figcraft-web/src/api.rs index 167ea7687..cb82820b7 100644 --- a/apps/figcraft-web/src/api.rs +++ b/apps/figcraft-web/src/api.rs @@ -37,7 +37,7 @@ use figcraft_ui_egui::{ControlReply, ControlRequest, RequestGate}; use serde_json::{Value, json}; use wasm_bindgen::JsCast; use wasm_bindgen::prelude::*; -use wasm_bindgen_futures::{JsFuture, future_to_promise}; +use wasm_bindgen_futures::JsFuture; use crate::saved_files::SavedFiles; @@ -150,15 +150,6 @@ async fn sleep(ms: i32) { let _ = JsFuture::from(promise).await; } -/// A reply as a promise outcome: the `result`, or an `Error` carrying the `error`. -fn outcome(reply: &Value) -> Result { - if reply.get("ok").and_then(Value::as_bool) == Some(true) { - Ok(to_js(reply.get("result").unwrap_or(&Value::Null))) - } else { - Err(js_sys::Error::new(reply.get("error").and_then(Value::as_str).unwrap_or("error")).into()) - } -} - fn set_fn(obj: &js_sys::Object, name: &str, f: JsValue) -> Result<(), JsValue> { js_sys::Reflect::set(obj, &name.into(), &f).map(|_| ()) } @@ -169,20 +160,20 @@ pub fn install() -> Result<(), JsValue> { Rc::new(PageApi::new(APP, Methods::default(), request)).install()?; let window = web_sys::window().ok_or("no window")?; let obj: js_sys::Object = js_sys::Reflect::get(&window, &APP.into())?.unchecked_into(); - set_fn( - &obj, - "inspect", - Closure:: js_sys::Promise>::new(|| future_to_promise(async { outcome(&send("document.inspect", json!({})).await) })) - .into_js_value(), - )?; + // `inspect` is `docInspect` under its earlier name: the crate's function, so it times out too. + let doc_inspect = js_sys::Reflect::get(&obj, &"docInspect".into())?; + js_sys::Reflect::set(&obj, &"inspect".into(), &doc_inspect)?; + // `openFile` runs `file.open` through the crate's `execute`, so a call the app does not answer times out and is cancelled. + let execute: js_sys::Function = js_sys::Reflect::get(&obj, &"execute".into())?.unchecked_into(); + let this = obj.clone(); set_fn( &obj, "openFile", - Closure:: js_sys::Promise>::new(|name: String, bytes: js_sys::Uint8Array| { + Closure:: JsValue>::new(move |name: String, bytes: js_sys::Uint8Array| { let data = base64::engine::general_purpose::STANDARD.encode(bytes.to_vec()); - future_to_promise(async move { - outcome(&send("engine.execute", json!({"command": "file.open", "params": {"name": name, "data": data}})).await) - }) + execute + .call2(&this, &"file.open".into(), &to_js(&json!({"name": name, "data": data}))) + .unwrap_or_else(|e| js_sys::Promise::reject(&e).into()) }) .into_js_value(), )?; From 12ade9c78c62783dfe539bbbfb62c1fbae03d9ab Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Fri, 6 Nov 2026 23:31:02 -0800 Subject: [PATCH 004/101] Docs: the 2026-10-31 export entry keeps the JPG tagging it had on that date --- docs/file-format-parity.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index 335115ad1..0d51910f0 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -192,7 +192,7 @@ source paint coordinates. | 2026-11-04 | minor | JPG export: `quality` (1 to 100, default 90) on `file.export`, `export.add` / `export.update` and MCP `export`, kept in the export setting; an sRGB file's JPGs embed the sRGB ICC profile, as Display P3 files' JPGs already embedded theirs, since an untagged JPG is only assumed to be sRGB (#2004). | | 2026-11-04 | minor | `.fig` and `.jam` import, #1910: an elbowed connector saved with its path keeps it. FigJam stores `connectorControlPoints`, one per run between the first and the last, each a point on its run (in the connector's parent's coordinates) with the run's axis; the first run leaves the start's side and the last arrives at the end's. They become the `ConnectorPath::Runs` a board connector reshaped by hand has (`figcraft_doc::route_along`), so a connector drawn around a layer in FigJam stays around it instead of being routed through it. Points that don't make such a path (off both axes, two runs in a row the same way, a first or last run sideways to its side or going back into its object, more runs than a hand could make) leave the connector to the router as before, and only connectors routed here count in the "follow FigCraft's own routing" note. A curved connector's `connectorBezierControlPoints` are still not read. Tests: `tail_tests::an_elbow_connector_saved_with_its_path_keeps_it`, `tail_tests::an_elbow_whose_saved_path_doesnt_fit_its_sides_is_routed_here`. | | 2026-11-01 | patch | `.fig` and `.jam` import: a connector without a saved snapshot (elbowed and curved ones are routed here) took no stroke, so it was invisible (#1807); its line's paint, weight, cap and dashes now come from the file's generated line record, as a saved snapshot's do, and the connector's own values, when it has any, win. Test: `fig::connector_label_tests::a_routed_connector_takes_its_line_style_from_the_generated_record`. Numbers unchanged | -| 2026-10-31 | minor | Export settings: each PNG, JPG and WebP setting has a color profile, Same as file (the default; the document's profile when it exports), sRGB or Display P3, in its advanced settings and as `colorProfile` on `export.add`, `export.update`, `file.export`, `file.exportLayers` and MCP `export`. The pixels convert to the chosen profile (out-of-gamut colors clip) and the file is tagged as before: sRGB PNG with an `sRGB` chunk, Display P3 with the generated ICC profile (and `cICP` in PNG); sRGB JPG embeds the sRGB ICC profile (#2004) and sRGB WebP stays untagged. A setting keeps its choice when its format changes; settings saved without one read as Same as file. SVG, PDF and XML show no choice and stay sRGB (PDF has no output intent yet). Numbers unchanged | +| 2026-10-31 | minor | Export settings: each PNG, JPG and WebP setting has a color profile, Same as file (the default; the document's profile when it exports), sRGB or Display P3, in its advanced settings and as `colorProfile` on `export.add`, `export.update`, `file.export`, `file.exportLayers` and MCP `export`. The pixels convert to the chosen profile (out-of-gamut colors clip) and the file is tagged as before: sRGB PNG with an `sRGB` chunk, Display P3 with the generated ICC profile (and `cICP` in PNG); sRGB JPG and WebP stay untagged (builds before 2026-11-04; from that date sRGB JPGs embed the sRGB ICC profile, see the 2026-11-04 JPG export entry). A setting keeps its choice when its format changes; settings saved without one read as Same as file. SVG, PDF and XML show no choice and stay sRGB (PDF has no output intent yet). Numbers unchanged | | 2026-10-31 | patch | M4: Dash and Custom strokes have a Dash cap (None, Round, Square) in the advanced stroke settings and `node.set {dashCap}`, on both ends of every dash on the canvas and in PNG, PDF and SVG. Unset, dashes keep taking the end point caps, so older files look the same; the saved file writes it only when set. Numbers unchanged | | 2026-10-30 | minor | `.fig` import: a connector's label without a saved snapshot was skipped; now the connector imports as a frame holding its line and the label, as a connector with a saved snapshot does, the label centred on the line's middle by length (in a 200-wide box, laid out again with the fonts at hand), in the connector's fill paints or black. Its background isn't known without the snapshot and is left out. Not checked on real files. Test: `fig::tests::tail::a_labelled_connector_without_a_snapshot_keeps_its_label` | | 2026-10-30 | minor | Pasted content row: an image the clipboard doesn't carry keeps its name and shows a placeholder that reads as missing; the paste names those layers in its message and opens the import report with its notes (#1646). Numbers unchanged | From fbd313f4e7b9157c60f30f9e010e284df82cc5a2 Mon Sep 17 00:00:00 2001 From: Davit Matchakhelidze Date: Sat, 7 Nov 2026 12:50:18 +0400 Subject: [PATCH 005/101] i18n(ka): Georgian for 126 new strings --- crates/ui-egui/locales/ka.toml | 126 +++++++++++++++++++++++++++++++++ 1 file changed, 126 insertions(+) diff --git a/crates/ui-egui/locales/ka.toml b/crates/ui-egui/locales/ka.toml index 2af58f385..8a4a70475 100644 --- a/crates/ui-egui/locales/ka.toml +++ b/crates/ui-egui/locales/ka.toml @@ -111,6 +111,7 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "Along the top" = "ზედა კიდის გასწვრივ" "Alpha" = "ალფა" "Alphabetical" = "ანბანის მიხედვით" +"Alt+double-click an edge of an auto layout child" = "Alt+ორმაგი დაწკაპუნება ავტოგანლაგების შვილობილი ელემენტის კიდეზე" "Alt+drag" = "Alt+გადათრევა" "An analytics screen on a grid: figures, charts drawn from vectors and a table" = "ანალიტიკა ბადეზე: ციფრები, დიაგრამები და ცხრილი" "An earlier vote" = "ადრინდელი კენჭისყრა" @@ -124,6 +125,7 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "Another server, or one that needs its key. The usual server is set in Preferences." = "სხვა სერვერი ან სერვერი, რომელსაც გასაღები სჭირდება. ჩვეულებრივი სერვერი პარამეტრებში ირჩევა." "Any status" = "ნებისმიერი სტატუსი" "Anyone on your network with this code can edit the file, while this app stays open." = "თქვენს ქსელში ნებისმიერს, ვისაც ეს კოდი აქვს, შეუძლია ფაილის რედაქტირება, სანამ ეს აპი ღიაა." +"Anyone on your network with this code can look at the file, not change it, while this app stays open." = "თქვენს ქსელში ნებისმიერს, ვისაც ეს კოდი აქვს, შეუძლია ფაილის ნახვა, მაგრამ არა შეცვლა, სანამ ეს აპი ღიაა." "Anyone with the edit link can change the file; the view link only lets people look. The links carry their secrets: share them like passwords. `figcraft-server links` makes more and revokes them." = "რედაქტირების ბმულის მქონე ნებისმიერს შეუძლია ფაილის შეცვლა; ნახვის ბმული მხოლოდ დათვალიერების საშუალებას იძლევა. ბმულები საიდუმლო გასაღებებს შეიცავს: გააზიარეთ ისინი პაროლების მსგავსად. `figcraft-server links` ქმნის ახალ ბმულებს და აუქმებს მათ." "Anyone with this code can edit the file." = "ნებისმიერს, ვისაც ეს კოდი აქვს, შეუძლია ფაილის რედაქტირება." "Anyone with this code can look at the file, not change it." = "ნებისმიერს, ვისაც ეს კოდი აქვს, შეუძლია ფაილის ნახვა, მაგრამ არა შეცვლა." @@ -158,6 +160,7 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "Auto layout" = "ავტოგანლაგება" "Auto rows" = "ავტომატური სტრიქონები" "Auto width" = "ავტომატური სიგანე" +"Auto: by the first letter with a direction" = "ავტომატური: მიმართულების მქონე პირველი ასოს მიხედვით" "Back to the FigCraft server" = "FigCraft-ის სერვერზე დაბრუნება" "Back to the font's value" = "შრიფტის მნიშვნელობაზე დაბრუნება" "Back" = "უკან" @@ -330,6 +333,7 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "Copied as PNG" = "დაკოპირდა როგორც PNG" "Copied as SVG" = "დაკოპირდა როგორც SVG" "Copied as text" = "დაკოპირდა როგორც ტექსტი" +"Copied comments for AI" = "კომენტარები დაკოპირდა AI-სთვის" "Copied {value}" = "დაკოპირდა: {value}" "Copy" = "კოპირება" "Copy as" = "კოპირება როგორც" @@ -337,6 +341,7 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "Copy as PNG" = "კოპირება როგორც PNG" "Copy as SVG" = "კოპირება როგორც SVG" "Copy code" = "კოდის კოპირება" +"Copy for AI" = "კოპირება AI-სთვის" "Copy link" = "ბმულის კოპირება" "Copy the {label}" = "კოპირება: {label}" "Copy {value}" = "კოპირება: {value}" @@ -364,8 +369,10 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "Created" = "შექმნილია" "Crop" = "ჩამოჭრა" "Crop marks" = "ჭრის ნიშნები" +"Ctrl+Alt+← ↑ → ↓" = "Ctrl+Alt+← ↑ → ↓" "Ctrl+arrows" = "Ctrl+ისრები" "Ctrl+click" = "Ctrl+დაწკაპუნება" +"Ctrl+click a padding field" = "Ctrl+დაწკაპუნება შიდა დაშორების ველზე" "Ctrl+scroll" = "Ctrl+გადახვევა" "Current name" = "მიმდინარე სახელი" "Current version" = "მიმდინარე ვერსია" @@ -385,6 +392,47 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "Decoration style" = "გაფორმების სტილი" "Decoration" = "გაფორმება" "Deep select" = "ღრმა მონიშვნა" +"Delete {n} variables" = { one = "ცვლადის წაშლა: {n}", other = "ცვლადის წაშლა: {n}" } +"Disconnected. Reconnecting…" = "კავშირი გაწყდა. ხელახლა დაკავშირება…" +"Disconnected. Your edits stay here and sync when the connection returns. Reconnecting…" = "კავშირი გაწყდა. თქვენი ცვლილებები აქ რჩება და სინქრონიზდება, როცა კავშირი აღდგება. ხელახლა დაკავშირება…" +"Dismiss" = "უგულებელყოფა" +"Double-click an edge of an auto layout frame" = "ორმაგი დაწკაპუნება ავტოგანლაგების ჩარჩოს კიდეზე" +"Edit padding on all sides" = "შიდა დაშორების რედაქტირება ყველა მხარეს" +"Enter / Shift+Enter" = "Enter / Shift+Enter" +"Expand the interface" = "ინტერფეისის გაშლა" +"Hide UI" = "ინტერფეისის დამალვა" +"Left to right" = "მარცხნიდან მარჯვნივ" +"Move out of any group" = "ჯგუფიდან გამოტანა" +"Move to group {group}" = "ჯგუფში გადატანა: {group}" +"Move up or down while dragging its label" = "ზემოთ ან ქვემოთ გადაადგილება მისი იარლიყის გადათრევისას" +"Not connected: {reason}. Your work is still in this tab." = "კავშირი არ არის: {reason}. თქვენი ნამუშევარი ისევ ამ ჩანართშია." +"Nothing to pick: the page is empty" = "ასარჩევი არაფერია: გვერდი ცარიელია" +"Pick select: Tab and Shift+Tab move between layers, Enter goes into one, Shift+Enter out, Space selects, Escape cancels" = "შრის არჩევა: Tab და Shift+Tab შრეებს შორის გადაადგილდება, Enter შრეში შედის, Shift+Enter გამოდის, Space მონიშნავს, Escape გააუქმებს" +"Pick select: into a layer, out to its parent" = "შრის არჩევა: შრეში შესვლა, მშობელზე გასვლა" +"Pick select: next or previous layer" = "შრის არჩევა: შემდეგი ან წინა შრე" +"Pick select: select the picked layer" = "შრის არჩევა: არჩეული შრის მონიშვნა" +"Remove all auto layout" = "ყველა ავტოგანლაგების მოხსნა" +"Retry now" = "ახლავე ხელახლა ცდა" +"Right to left" = "მარჯვნიდან მარცხნივ" +"Rotate a degree (Shift: 15)" = "ერთი გრადუსით შემობრუნება (Shift: 15)" +"Same as file ({profile})" = "როგორც ფაილში ({profile})" +"Save a copy…" = "ასლის შენახვა…" +"Scope: all supported properties" = "არე: ყველა მხარდაჭერილი თვისება" +"Scope: hidden from pickers" = "არე: ამომრჩევებში დამალული" +"Scope: only {scope}" = "არე: მხოლოდ {scope}" +"Scrub a field faster (2x) or slower (1/2, 1/4)" = "ველის მნიშვნელობის გადათრევით ცვლა უფრო სწრაფად (2x) ან ნელა (1/2, 1/4)" +"Scrubbing at 1/2" = "გადათრევით ცვლა: 1/2" +"Scrubbing at 1/4" = "გადათრევით ცვლა: 1/4" +"Scrubbing at 1x" = "გადათრევით ცვლა: 1x" +"Scrubbing at 2x" = "გადათრევით ცვლა: 2x" +"Selection box: switch to pick select" = "მონიშვნის ჩარჩო: შრის არჩევაზე გადართვა" +"Set fill container" = "ზომა: კონტეინერის შევსება" +"Set hug contents" = "ზომა: შიგთავსზე მორგება" +"Show and move the placement crosshair (its tool chosen, nothing selected)" = "განთავსების ჯვრის ჩვენება და გადაადგილება (არჩეული ხელსაწყოთი, როცა არაფერია მონიშნული)" +"Space" = "Space" +"Tab or Ctrl+Space again" = "Tab ან ხელახლა Ctrl+Space" +"Text direction" = "ტექსტის მიმართულება" +"The bars are hidden. {shortcut} shows them again" = "ზოლები დამალულია. {shortcut} ისევ აჩვენებს მათ" "Wrap style" = "გადატანის სტილი" "Balance" = "დაბალანსებული" "Pretty" = "მოწესრიგებული" @@ -890,6 +938,7 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "No color styles" = "ფერის სტილები არ არის" "No colour variables fit here." = "აქ არცერთი ფერის ცვლადი არ ერგება." "No colour variables yet. Create them in Local variables." = "ფერის ცვლადები ჯერ არ არის. შექმენით ისინი ლოკალურ ცვლადებში." +"No comments to copy" = "დასაკოპირებელი კომენტარები არ არის" "No comments yet" = "კომენტარები ჯერ არ არის" "No compatibility warnings reported" = "თავსებადობის გაფრთხილებები არ დაფიქსირებულა" "No components yet. Select layers and press {keys}." = "კომპონენტები ჯერ არ არის. მონიშნეთ შრეები და დააჭირეთ {keys}." @@ -1804,6 +1853,7 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "{name} is forgotten on this computer; the file stays on {server}" = "{name} დავიწყებულია ამ კომპიუტერზე; ფაილი {server}-ზე რჩება" "{name} is on the server." = "{name} სერვერზეა." "{name} is spotlighting" = "ყურადღება {name}-ზეა" +"{name}, disconnected from its live session" = "{name}, ცოცხალ სესიასთან კავშირი გაწყვეტილია" "{name}\nClick to apply to the selection" = "{name}\nდაწკაპეთ მონიშნულზე გამოსაყენებლად" "{name}\nDrag onto the canvas, or click to place in the middle of the view.\nHold Alt (Option) while dropping onto an instance to swap it." = "{name}\nგადაათრიეთ ტილოზე ან დაწკაპეთ ხედის შუაში განსათავსებლად.\nინსტანსის ჩასანაცვლებლად მასზე ჩაგდებისას დააჭირეთ Alt-ს (Option)." "{name} (from {library})" = "{name} ({library}-იდან)" @@ -1876,10 +1926,14 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "←" = "←" "→, Space or N" = "→, Space ან N" "↵" = "↵" +"↵ / ⇧↵" = "↵ / ⇧↵" "⇥ / ⇧⇥" = "⇥ / ⇧⇥" +"⇥ or ⌥ Space again" = "⇥ ან ხელახლა ⌥ Space" "⌘ arrows" = "⌘ ისრები" "⌘ click" = "⌘ დაწკაპუნება" +"⌘ click a padding field" = "⌘ დაწკაპუნება შიდა დაშორების ველზე" "⌘ scroll" = "⌘ გადახვევა" +"⌥ double-click an edge of an auto layout child" = "⌥ ორმაგი დაწკაპუნება ავტოგანლაგების შვილობილი ელემენტის კიდეზე" "⌥ drag" = "⌥ გადათრევა" "Android Vector Drawable" = "Android Vector Drawable" "Best effort" = "მაქსიმალური მიახლოება" @@ -1908,6 +1962,67 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "Update check is not supported in the web browser." = "ვებბრაუზერში განახლებების შემოწმება მხარდაჭერილი არ არის." "instance swap properties whose default component was past the layer limit were skipped" = "ინსტანსის ჩანაცვლების თვისებები, რომელთა ნაგულისხმევი კომპონენტი შრეების ზღვარს მიღმა იყო, გამოტოვებულია" "instances whose component was past the layer limit were imported as frames" = "ინსტანსები, რომელთა კომპონენტი შრეების ზღვარს მიღმა იყო, ჩარჩოებად იმპორტირდა" +"1 year" = "1 წელი" +"30 days" = "30 დღე" +"90 days" = "90 დღე" +"Allow and download" = "დაშვება და ჩამოტვირთვა" +"Allow downloading fonts?" = "დაიშვას შრიფტების ჩამოტვირთვა?" +"Board grid" = "დაფის ბადე" +"Changed {date}" = "შეცვლილია: {date}" +"Copy browser link" = "ბრაუზერის ბმულის კოპირება" +"Couldn't reach {server} for its team list." = "{server}-იდან გუნდის სიის მიღება ვერ მოხერხდა." +"Calculated from other variables; it follows them" = "გამოითვლება სხვა ცვლადებიდან და მათ მიჰყვება" +"Crop image" = "გამოსახულების ჩამოჭრა" +"Detach calculation" = "გამოთვლის გამოყოფა" +"Download" = "ჩამოტვირთვა" +"Downloading… {percent}%" = "ჩამოტვირთვა… {percent}%" +"Drop to use this image" = "ჩააგდეთ ამ გამოსახულების გამოსაყენებლად" +"Everyone who reaches this server can open these files while they are shared." = "ამ სერვერთან წვდომის მქონე ყველას შეუძლია ამ ფაილების გახსნა, სანამ ისინი გაზიარებულია." +"FigCraft stopped because of an internal error." = "FigCraft-ის მუშაობა შიდა შეცდომის გამო შეწყდა." +"Free fonts come from Google Fonts and Noto, through jsDelivr and GitHub. Each file is checked against the font index before it is installed into the font folder the Craft apps share. Nothing is downloaded until you allow it." = "უფასო შრიფტები Google Fonts-იდან და Noto-დან მოდის, jsDelivr-ისა და GitHub-ის გავლით. თითოეული ფაილი შრიფტების ინდექსთან მოწმდება, სანამ Craft-აპების საერთო შრიფტების საქაღალდეში დაინსტალირდება. სანამ არ დაუშვებთ, არაფერი ჩამოიტვირთება." +"Graph paper" = "მილიმეტრიანი ქაღალდი" +"Joining live session…" = "ცოცხალ სესიასთან შეერთება…" +"Link copied: it opens the file in FigCraft" = "ბმული დაკოპირდა: ის ფაილს FigCraft-ში ხსნის" +"Link copied: it opens the file in the browser" = "ბმული დაკოპირდა: ის ფაილს ბრაუზერში ხსნის" +"Nobody shares a file there now." = "იქ ახლა არავინ აზიარებს ფაილს." +"Past 30 days" = "ბოლო 30 დღე" +"Past 90 days" = "ბოლო 90 დღე" +"Past year" = "ბოლო წელი" +"Shared by your team on {server}" = "თქვენი გუნდის მიერ {server}-ზე გაზიარებული" +"Not now" = "ახლა არა" +"Nothing counted yet" = "ჯერ არაფერი დათვლილა" +"Reload the page to get back the unsaved files the browser had room for." = "განაახლეთ გვერდი, რომ დაიბრუნოთ ის შეუნახავი ფაილები, რომლებიც ბრაუზერში დაეტია." +"Reload the page to get your unsaved files back." = "განაახლეთ გვერდი, რომ შეუნახავი ფაილები დაიბრუნოთ." +"Reload the page to start again." = "თავიდან დასაწყებად განაახლეთ გვერდი." +"Reset grid" = "ბადის ჩამოყრა" +"This server doesn't count insertions" = "ეს სერვერი ჩასმებს არ ითვლის" +"This server doesn't count styles and variables" = "ეს სერვერი სტილებსა და ცვლადებს არ ითვლის" +"Upload from computer" = "კომპიუტერიდან ატვირთვა" +"Strong line every" = "მუქი ხაზის ბიჯი" +"This link opens your mail app to write a message:" = "ეს ბმული წერილის დასაწერად თქვენს საფოსტო აპს ხსნის:" +"This server doesn't count detached instances" = "ეს სერვერი გამოყოფილ ინსტანსებს არ ითვლის" +"Your unsaved files were too large for the browser to keep." = "თქვენი შეუნახავი ფაილები ბრაუზერისთვის შესანახად ზედმეტად დიდი იყო." +"connector labels without a saved snapshot are centred on the line, without their background" = "შენახული სნეპშოტის გარეშე შემაერთებლის იარლიყები ხაზზე ცენტრდება, ფონის გარეშე" +"elbowed and curved connectors without a saved path follow FigCraft's own routing" = "შენახული ტრაექტორიის გარეშე კუთხოვანი და მრუდი შემაერთებლები FigCraft-ის საკუთარ მარშრუტს მიჰყვება" +"invalid vector region fill paint list; layer fill used" = "ვექტორული არის შევსების საღებავების სია არასწორია; გამოყენებულია შრის შევსება" +"invalid vector region paints were skipped" = "ვექტორული არის არასწორი საღებავები გამოტოვებულია" +"linked vector region fill styles keep resolved appearance; live style links were left out" = "ვექტორული არის მიბმული შევსების სტილები გამოთვლილ იერსახეს ინარჩუნებს; სტილების ცოცხალი კავშირები არ გადმოვიდა" +"note or shape generated child has invalid bounds; child skipped" = "შენიშვნის ან ფიგურის გენერირებულ შვილობილ ელემენტს არასწორი საზღვრები აქვს; ელემენტი გამოტოვებულია" +"note or shape generated child is missing its style or bounds; child skipped" = "შენიშვნის ან ფიგურის გენერირებულ შვილობილ ელემენტს სტილი ან საზღვრები აკლია; ელემენტი გამოტოვებულია" +"note or shape generated children exceed the layer or nesting limit; remaining children skipped" = "შენიშვნის ან ფიგურის გენერირებული შვილობილი ელემენტები შრეების ან ჩადგმის ლიმიტს აჭარბებს; დანარჩენი ელემენტები გამოტოვებულია" +"note or shape generated layout is missing or unsupported; using its outer frame" = "შენიშვნის ან ფიგურის გენერირებული განლაგება აკლია ან მხარდაუჭერელია; გამოიყენება მისი გარე ჩარჩო" +"shape generated outline is missing or damaged; using its rectangle" = "ფიგურის გენერირებული კონტური აკლია ან დაზიანებულია; გამოიყენება მისი მართკუთხედი" +"variable-bound vector region paints keep resolved appearance; live bindings were left out" = "ცვლადებზე მიბმული ვექტორული არის საღებავები გამოთვლილ იერსახეს ინარჩუნებს; ცოცხალი მიბმები არ გადმოვიდა" +"vector region paint data exceeded import limits and was skipped" = "ვექტორული არის საღებავის მონაცემებმა იმპორტის ლიმიტებს გადააჭარბა და გამოტოვებულია" +"vector region references a missing fill style; layer fill used" = "ვექტორული არე მიუთითებს შევსების არარსებულ სტილზე; გამოყენებულია შრის შევსება" +"{count} in it now · Changed {date}" = "ახლა მასშია: {count} · შეცვლილია: {date}" +"{insertions} · {detachments}" = "{insertions} · {detachments}" +"{period}: {counts}" = "{period}: {counts}" +"{used} · {detached}" = "{used} · {detached}" +"{used} · {inserted}" = "{used} · {inserted}" +"{n} detached" = { one = "გამოყოფილი: {n}", other = "გამოყოფილი: {n}" } +"{n} inserted" = { one = "ჩასმული: {n}", other = "ჩასმული: {n}" } +"⌥⌘ ← ↑ → ↓" = "⌥⌘ ← ↑ → ↓" [commands] "align.bottom" = "ქვემოთ სწორება" @@ -2003,6 +2118,7 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "comment.next" = "შემდეგი კომენტარი" "comment.open" = "კომენტარის გახსნა" "comment.people" = "კომენტარებში მონაწილე ადამიანები" +"comment.prompt" = "კომენტარების კოპირება AI-სთვის" "comment.react" = "კომენტარზე რეაგირება" "comment.reply" = "კომენტარზე პასუხი" "comment.resolve" = "კომენტარის გადაწყვეტა" @@ -2081,6 +2197,7 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "file.exportFramesPdf" = "ჩარჩოების PDF-ად ექსპორტირება" "file.exportLayers" = "შრეების ექსპორტირება" "file.exportSvg" = "მონიშნულის SVG-ად ექსპორტირება" +"file.fontReport" = "დოკუმენტის შრიფტების ინსპექტირება" "file.import" = "იმპორტი" "file.moveTab" = "ჩანართის გადატანა" "file.new" = "ახალი დიზაინის ფაილი" @@ -2533,6 +2650,15 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "file.markSaved" = "შენახულად მარკირება" "text.fit" = "ტექსტის ჩატევა თავის საზღვრებში" "data.fill" = "ასლების მონაცემებით შევსება" +"board.grid" = "დაფის ბადე" +"font.download" = "შრიფტის ჩამოტვირთვა" +"font.downloads" = "შრიფტების ჩამოტვირთვები" +"image.crop" = "გამოსახულების ჩამოჭრა" +"library.check" = "გუნდის ბიბლიოთეკების განახლებების შემოწმება" +"board.reshape" = "შემაერთებლის ფორმის შეცვლა" +"image.replace" = "გამოსახულების ჩანაცვლება" +"variable.extendCollection" = "კოლექციის გაფართოება" +"widget.hover" = "ვიჯეტზე მაჩვენებლის მიტანა" [menu] "bool.exclude" = "გამორიცხვა" From 386c6c1d3eb923459111e9df0fb75c231a5c3722 Mon Sep 17 00:00:00 2001 From: NetterSilver <133535268+Silvertree2010@users.noreply.github.com> Date: Sat, 7 Nov 2026 13:45:31 +0100 Subject: [PATCH 006/101] Reject negative and fractional index in image.savePreset Found while testing crates/engine/src/cmd/image.rs:239 (save_preset, `index = num(p, "index").filter(..).map(|k| k as usize)`) Co-Authored-By: Claude Haiku 5.5 Co-Authored-By: Claude Sonnet 5.5 --- crates/engine/src/cmd/image.rs | 7 +++++-- crates/engine/src/paint_tests.rs | 10 ++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/crates/engine/src/cmd/image.rs b/crates/engine/src/cmd/image.rs index 865e4d19a..37472b2d4 100644 --- a/crates/engine/src/cmd/image.rs +++ b/crates/engine/src/cmd/image.rs @@ -5,7 +5,7 @@ use figcraft_doc::{Document, ImagePreset, Node}; use serde_json::{Value, json}; use super::{CommandSpec, ok}; -use crate::params::{f64_of, get, num, req_index, req_string, req_targets, string, targets}; +use crate::params::{f64_of, get, req_index, req_string, req_targets, string, targets}; use crate::{EngineError, Result, Session, bad, spec}; pub fn specs() -> Vec { @@ -236,7 +236,10 @@ fn save_preset(s: &mut Session, p: &Value) -> Result { Some(v) => with_values(cmd, ImageFilters::NONE, v)?, None => { let stroke = strokes(cmd, p)?; - let index = num(p, "index").filter(|k| k.is_finite() && *k >= 0.0).map(|k| k as usize); + let index = match get(p, "index") { + None | Some(Value::Null) => None, + Some(_) => Some(req_index(cmd, p, "index")?), + }; let doc = s.doc()?; targets(s, p) .iter() diff --git a/crates/engine/src/paint_tests.rs b/crates/engine/src/paint_tests.rs index 1e97b05ca..00ada8d79 100644 --- a/crates/engine/src/paint_tests.rs +++ b/crates/engine/src/paint_tests.rs @@ -135,6 +135,16 @@ fn image_adjust_refuses_what_it_cannot_do() { assert_eq!(s.execute("image.adjust", &json!({"ids": [plain, r], "index": 1, "preset": "vivid"})).unwrap()["changed"], 1); } +#[test] +fn save_preset_rejects_bad_index() { + let mut s = Session::new(); + let r = image_rect(&mut s); + assert!(s.execute("image.savePreset", &json!({"ids": [r], "name": "B", "index": 0})).is_err()); + assert!(s.execute("image.savePreset", &json!({"ids": [r], "name": "B", "index": -1})).is_err(), "negative index accepted"); + assert!(s.execute("image.savePreset", &json!({"ids": [r], "name": "B", "index": 1.5})).is_err(), "fractional index accepted"); + assert!(s.execute("image.savePreset", &json!({"ids": [r], "name": "B", "index": 1})).is_ok()); +} + #[test] fn saved_image_presets() { let mut s = Session::new(); From b33da8a7b0f3dd92d0a2a88ec22ab72f9d028a1d Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Sat, 7 Nov 2026 11:52:52 -0500 Subject: [PATCH 007/101] Ellipse: an unsliced ellipse edits as four anchor points, not six (#2080) A whole ellipse and each ring contour are built as four cubics through the extremes instead of a tolerance-subdivided arc. Sliced ellipses are unchanged. Co-Authored-By: Claude Fable 5.1 --- crates/geom/src/lib.rs | 23 ++++++++++++++++----- crates/geom/src/tests.rs | 43 +++++++++++++++++++++++++++++++++++++++- 2 files changed, 60 insertions(+), 6 deletions(-) diff --git a/crates/geom/src/lib.rs b/crates/geom/src/lib.rs index a775a4170..f290882d8 100644 --- a/crates/geom/src/lib.rs +++ b/crates/geom/src/lib.rs @@ -472,15 +472,28 @@ pub fn ellipse(width: f64, height: f64, start: f64, sweep: f64, inner: f64) -> B let mut path = BezPath::new(); // A whole turn as an arc with these radii: kurbo's `Ellipse` recovers its radii from an // affine map, which overflows to infinity for radii near f64's limit (and infinite cubics). - let whole = |rx: f64, ry: f64| kurbo::Arc::new(c, (rx, ry), 0.0, TAU, 0.0); + // Four cubics through the right, bottom, left and top extremes (clockwise from 3 o'clock), + // the same four anchors an ellipse has when edited as a vector; an arc subdivided by + // tolerance would give five or six. + let whole = |rx: f64, ry: f64| { + const K: f64 = 0.552_284_749_830_793_4; + let (kx, ky) = (rx * K, ry * K); + let mut p = BezPath::new(); + p.move_to(c + Vec2::new(rx, 0.0)); + p.curve_to(c + Vec2::new(rx, ky), c + Vec2::new(kx, ry), c + Vec2::new(0.0, ry)); + p.curve_to(c + Vec2::new(-kx, ry), c + Vec2::new(-rx, ky), c + Vec2::new(-rx, 0.0)); + p.curve_to(c + Vec2::new(-rx, -ky), c + Vec2::new(-kx, -ry), c + Vec2::new(0.0, -ry)); + p.curve_to(c + Vec2::new(kx, -ry), c + Vec2::new(rx, -ky), c + Vec2::new(rx, 0.0)); + p + }; if full && inner <= 0.0 { - return whole(rx, ry).to_path(tol); + return whole(rx, ry); } if full { // A ring: outer clockwise, inner counter-clockwise. - path.extend(whole(rx, ry).path_elements(tol)); - let inner_path = whole(rx * inner, ry * inner).to_path(tol); - path.extend(inner_path.reverse_subpaths()); + path.extend(whole(rx, ry).elements().iter().copied()); + let inner_path = whole(rx * inner, ry * inner); + path.extend(inner_path.reverse_subpaths().elements().iter().copied()); return path; } let outer = kurbo::Arc::new(c, (rx, ry), start, sweep, 0.0); diff --git a/crates/geom/src/tests.rs b/crates/geom/src/tests.rs index 459b2b101..909a3c475 100644 --- a/crates/geom/src/tests.rs +++ b/crates/geom/src/tests.rs @@ -263,7 +263,7 @@ fn smoothed_polygon_smooths_every_corner() { #[test] fn ellipse_ring_area() { let full = area(&ellipse(100.0, 100.0, 0.0, TAU, 0.0)); - assert!((full - PI * 2500.0).abs() < 2.0); + assert!((full - PI * 2500.0).abs() < 5.0, "{full}"); let ring = ellipse(100.0, 100.0, 0.0, TAU, 0.5); // Winding area of a ring with a reversed inner contour: outer - inner. let a = ring.area().abs(); @@ -321,6 +321,47 @@ fn reverse_subpaths_preserves_open_and_closed() { assert!(matches!(r.elements().last(), Some(kurbo::PathEl::ClosePath)), "{:?}", r.elements()); } +fn cubics(path: &BezPath) -> Vec { + path.segments() + .filter_map(|s| match s { + kurbo::PathSeg::Cubic(c) => Some(c), + _ => None, + }) + .collect() +} + +#[test] +fn a_whole_ellipse_is_four_cubics_through_the_extremes() { + for (w, h) in [(100.0, 100.0), (200.0, 60.0), (3.0, 900.0)] { + let segs = cubics(&ellipse(w, h, 0.0, TAU, 0.0)); + assert_eq!(segs.len(), 4, "{w}x{h}"); + let (rx, ry) = (w / 2.0, h / 2.0); + let want = [Point::new(rx, h), Point::new(0.0, ry), Point::new(rx, 0.0), Point::new(w, ry)]; + for (i, s) in segs.iter().enumerate() { + assert!((s.p3 - want[i]).hypot() < 1e-9, "{w}x{h}: anchor {i} is {:?}", s.p3); + // Handle length is 0.5523 of the radius along the tangent. + let k = 0.552_284_749_830_793_4; + let (r_along, r_across) = if i % 2 == 0 { (ry, rx) } else { (rx, ry) }; + let _ = r_across; + assert!(((s.p1 - s.p0).hypot() - k * r_along).abs() < 1e-9, "{w}x{h}: handle {i}"); + } + } +} + +#[test] +fn a_whole_ring_is_four_cubics_per_contour() { + let segs = cubics(&ellipse(100.0, 100.0, 0.0, TAU, 0.5)); + assert_eq!(segs.len(), 8); +} + +#[test] +fn a_sliced_ellipse_still_builds_its_arc() { + let pie = ellipse(100.0, 100.0, 0.0, PI, 0.0); + assert!(!cubics(&pie).is_empty()); + assert!(matches!(pie.elements().last(), Some(kurbo::PathEl::ClosePath))); + assert!((area(&pie) - PI * 1250.0).abs() < 2.0); +} + #[test] fn a_huge_ellipse_arc_is_a_few_cubics() { let big = ellipse(1e300, 1e300, 0.3, 2.0, 0.5); From 4118be890c2e15c9183293104a8a7e20e77e25b7 Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Sat, 7 Nov 2026 12:42:44 -0500 Subject: [PATCH 008/101] Ellipse: the four-cubic contour is closed, and the band test allows apex antialiasing (#2080) The band test compared row 10, the ellipse top, where the cubic now ends exactly at its level extreme; 8 pixels antialias slightly differently between a short band and the whole view. The row mean limit now grows by 0.05 per such pixel; whole-row artifacts still fail. Co-Authored-By: Claude Fable 5.1 --- crates/geom/src/lib.rs | 1 + crates/render/src/band_tests.rs | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/geom/src/lib.rs b/crates/geom/src/lib.rs index f290882d8..41669488f 100644 --- a/crates/geom/src/lib.rs +++ b/crates/geom/src/lib.rs @@ -484,6 +484,7 @@ pub fn ellipse(width: f64, height: f64, start: f64, sweep: f64, inner: f64) -> B p.curve_to(c + Vec2::new(-kx, ry), c + Vec2::new(-rx, ky), c + Vec2::new(-rx, 0.0)); p.curve_to(c + Vec2::new(-rx, -ky), c + Vec2::new(-kx, -ry), c + Vec2::new(0.0, -ry)); p.curve_to(c + Vec2::new(kx, -ry), c + Vec2::new(rx, -ky), c + Vec2::new(rx, 0.0)); + p.close_path(); p }; if full && inner <= 0.0 { diff --git a/crates/render/src/band_tests.rs b/crates/render/src/band_tests.rs index b9a7bfbcc..e01fad5d7 100644 --- a/crates/render/src/band_tests.rs +++ b/crates/render/src/band_tests.rs @@ -83,7 +83,8 @@ fn bands_match_one_piece_rendering() { assert_eq!((banded.width(), banded.height()), (one.width(), one.height())); for (y, (mean, off)) in row_diffs(&one, &banded).into_iter().enumerate() { assert!( - mean < 0.25 && off * 20 <= v.width as usize, + // Each pixel antialiased differently (the level top of an ellipse, where a cubic ends at its extreme) may add up to 0.05 to the row's mean. + mean < 0.25 + 0.05 * off as f64 && off * 20 <= v.width as usize, "scale {scale}, {bands} bands: row {y} differs ({off} pixels, {mean:.2} on average)" ); } From 0774e44fa8c4218821a300e341237cfcb071f822 Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Sat, 7 Nov 2026 13:41:25 -0500 Subject: [PATCH 009/101] Render band test: only small antialiasing differences are forgiven, a real band artifact still fails (#2080) Pixels whose largest channel differs by 24 or less are noise and left out of the row mean, which keeps its original 0.25 limit; the differing-pixel limit is unchanged. A unit test shows a 44-pixel row off by 60 still fails. Co-Authored-By: Claude Fable 5.1 --- crates/render/src/band_tests.rs | 68 ++++++++++++++++++++++++--------- 1 file changed, 51 insertions(+), 17 deletions(-) diff --git a/crates/render/src/band_tests.rs b/crates/render/src/band_tests.rs index e01fad5d7..4ea9fb1f6 100644 --- a/crates/render/src/band_tests.rs +++ b/crates/render/src/band_tests.rs @@ -56,20 +56,58 @@ fn view(scale: f64) -> View { View { origin: (-10.0, -10.0), scale, width: (440.0 * scale) as u32, height: (240.0 * scale) as u32 } } -/// Per row: the mean channel difference and how many pixels differ by more than 2. A band artifact -/// differs along a whole row; edge antialiasing may differ in a few pixels per edge (a curve -/// clipped at a band's edge rasterises a hair differently, most where it runs nearly level). +/// A pixel whose largest channel differs by at most this much between two renders is edge +/// antialiasing noise (a curve clipped at a band's edge rasterises a hair differently, most where +/// it runs level, as at the top of an ellipse), not a band artifact. +const NOISE: u8 = 24; + +/// One row of two renders: the mean channel difference over the pixels that are not noise (see +/// `NOISE`), and how many pixels differ by more than 2 at all. A band artifact differs along a +/// whole row, by more than noise. +fn row_stats(x: &[u8], y: &[u8]) -> (f64, usize) { + let mut sum = 0.0; + let mut off = 0; + for (p, q) in x.chunks(4).zip(y.chunks(4)) { + let worst = p.iter().zip(q).map(|(c, d)| c.abs_diff(*d)).max().unwrap_or(0); + if worst > 2 { + off += 1; + } + if worst > NOISE { + sum += p.iter().zip(q).map(|(c, d)| f64::from(c.abs_diff(*d))).sum::(); + } + } + (sum / x.len().max(1) as f64, off) +} + fn row_diffs(a: &Pixmap, b: &Pixmap) -> Vec<(f64, usize)> { let row = a.width() as usize * 4; - a.data() - .chunks(row) - .zip(b.data().chunks(row)) - .map(|(x, y)| { - let sum: f64 = x.iter().zip(y).map(|(p, q)| f64::from(p.abs_diff(*q))).sum(); - let off = x.chunks(4).zip(y.chunks(4)).filter(|(p, q)| p.iter().zip(*q).any(|(c, d)| c.abs_diff(*d) > 2)).count(); - (sum / row as f64, off) - }) - .collect() + a.data().chunks(row).zip(b.data().chunks(row)).map(|(x, y)| row_stats(x, y)).collect() +} + +/// Whether a row passes: the original mean limit over non-noise pixels, and at most a twentieth +/// of the row differing at all. +fn row_ok(mean: f64, off: usize, width: usize) -> bool { + mean < 0.25 && off * 20 <= width +} + +#[test] +fn a_real_band_artifact_fails_but_edge_noise_passes() { + let width = 880; // scale 2 + let flat = vec![100u8; width * 4]; + // 44 pixels differing by 60 per channel: under the old mean allowance, but a real artifact. + let mut artifact = flat.clone(); + for px in artifact.chunks_mut(4).take(44) { + px.iter_mut().for_each(|c| *c += 60); + } + let (mean, off) = row_stats(&flat, &artifact); + assert!(!row_ok(mean, off, width), "{mean} {off}"); + // 8 pixels differing by 16 (the ellipse top's antialiasing): forgiven. + let mut noise = flat.clone(); + for px in noise.chunks_mut(4).take(8) { + px.iter_mut().for_each(|c| *c += 16); + } + let (mean, off) = row_stats(&flat, &noise); + assert!(row_ok(mean, off, width), "{mean} {off}"); } #[test] @@ -82,11 +120,7 @@ fn bands_match_one_piece_rendering() { let banded = render_bands(&d, p, &v, &Options::default(), bands).unwrap(); assert_eq!((banded.width(), banded.height()), (one.width(), one.height())); for (y, (mean, off)) in row_diffs(&one, &banded).into_iter().enumerate() { - assert!( - // Each pixel antialiased differently (the level top of an ellipse, where a cubic ends at its extreme) may add up to 0.05 to the row's mean. - mean < 0.25 + 0.05 * off as f64 && off * 20 <= v.width as usize, - "scale {scale}, {bands} bands: row {y} differs ({off} pixels, {mean:.2} on average)" - ); + assert!(row_ok(mean, off, v.width as usize), "scale {scale}, {bands} bands: row {y} differs ({off} pixels, {mean:.2} on average)"); } } } From 97f086e091d712548a3415bceb344284b62302b8 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 7 Nov 2026 16:36:59 -0800 Subject: [PATCH 010/101] Docs: the Display P3 export sentence names RGB PDF and says CMYK PDF ends as DeviceCMYK The colour profile paragraph in docs/mcp.md said SVG and PDF export Display P3 files converted to sRGB, without the RGB qualifier the export tool text now carries. It now says SVG and RGB PDF convert to sRGB, and PDF with `cmyk` converts to sRGB the same way and then to DeviceCMYK. The comment above the export match in file.rs says the same. --- crates/engine/src/cmd/file.rs | 3 ++- docs/mcp.md | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/engine/src/cmd/file.rs b/crates/engine/src/cmd/file.rs index e52960d43..ca83292ec 100644 --- a/crates/engine/src/cmd/file.rs +++ b/crates/engine/src/cmd/file.rs @@ -372,7 +372,8 @@ pub fn export_file(doc: &Document, ids: &[NodeId], setting: &ExportSetting, scal && !setting.include_bounding_box && !ids.iter().any(|i| doc.node(*i).is_some_and(|n| matches!(n.kind, NodeKind::Slice))); match setting.format { - // SVG and PDF colours are sRGB: a Display P3 file exports converted (out-of-gamut colours clip). + // SVG and RGB PDF colors are sRGB: a Display P3 file exports converted (out-of-gamut colours clip). + // PDF with `cmyk` converts from those sRGB colors to DeviceCMYK. ExportFormat::Svg => { let opts = figcraft_svg::SvgOptions { include_ids: setting.svg_id_attribute, diff --git a/docs/mcp.md b/docs/mcp.md index 11945a76c..5b4efa3f7 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -255,8 +255,8 @@ Or in a project's `.mcp.json`: profile into the file's space: an embedded ICC profile (PNG, JPG, WebP, TIFF; RGB or grey), a PNG's `sRGB` / `gAMA` / `cHRM` chunks, else sRGB (also for CMYK or damaged profiles); `image.place` reports the profile's name as `imageProfile` (`null`: none usable, taken as sRGB). PNG exports are tagged (`sRGB` chunk, or a Display P3 ICC profile plus - `cICP`), JPG embeds the ICC profile for sRGB and for Display P3, WebP embeds it for Display P3 only (sRGB WebP is untagged), and SVG and PDF export Display P3 files - converted to sRGB (out-of-gamut colours clip). The app's canvas shows sRGB (P3 colours outside sRGB clip on screen): + `cICP`), JPG embeds the ICC profile for sRGB and for Display P3, WebP embeds it for Display P3 only (sRGB WebP is untagged), and SVG and RGB PDF export Display P3 files + converted to sRGB (out-of-gamut colours clip). PDF with `cmyk` converts them to sRGB the same way and then to DeviceCMYK. The app's canvas shows sRGB (P3 colours outside sRGB clip on screen): `view.proofSrgb {on?}` (View ▸ Soft-proof sRGB) stripes those pixels so `screenshot {window: true}` shows where they are (after the next canvas render), and the colour picker says Outside sRGB for such a colour. From 0c1fb11c4800d98090c00b4e531cec81e12507b0 Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Sat, 7 Nov 2026 19:37:16 -0500 Subject: [PATCH 011/101] Render band test: the comments say what row_stats divides by and what the artifact case measures (#2080) row_stats sums the differences of the pixels above noise and divides by the whole row's channel count; the doc now says so. The artifact case changes only the colour channels, so its mean is 2.25, which the earlier allowance let through, and its comment now says it fails on the mean while its count stays within a twentieth of the row. Co-Authored-By: Claude Opus 5.5 Model-Effort: Opus 5.5 drove and wrote at high; no brief --- crates/render/src/band_tests.rs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/crates/render/src/band_tests.rs b/crates/render/src/band_tests.rs index 4ea9fb1f6..9fcf29f20 100644 --- a/crates/render/src/band_tests.rs +++ b/crates/render/src/band_tests.rs @@ -61,9 +61,10 @@ fn view(scale: f64) -> View { /// it runs level, as at the top of an ellipse), not a band artifact. const NOISE: u8 = 24; -/// One row of two renders: the mean channel difference over the pixels that are not noise (see -/// `NOISE`), and how many pixels differ by more than 2 at all. A band artifact differs along a -/// whole row, by more than noise. +/// One row of two renders: the channel differences of the pixels above noise (see `NOISE`) summed +/// and divided by the whole row's channel count, so noise pixels add nothing but still count in +/// the denominator; and how many pixels differ by more than 2 at all. A band artifact differs along +/// a whole row, by more than noise. fn row_stats(x: &[u8], y: &[u8]) -> (f64, usize) { let mut sum = 0.0; let mut off = 0; @@ -84,8 +85,8 @@ fn row_diffs(a: &Pixmap, b: &Pixmap) -> Vec<(f64, usize)> { a.data().chunks(row).zip(b.data().chunks(row)).map(|(x, y)| row_stats(x, y)).collect() } -/// Whether a row passes: the original mean limit over non-noise pixels, and at most a twentieth -/// of the row differing at all. +/// Whether a row passes: the original 0.25 limit on the mean from `row_stats`, and at most a +/// twentieth of the row differing at all. fn row_ok(mean: f64, off: usize, width: usize) -> bool { mean < 0.25 && off * 20 <= width } @@ -94,10 +95,13 @@ fn row_ok(mean: f64, off: usize, width: usize) -> bool { fn a_real_band_artifact_fails_but_edge_noise_passes() { let width = 880; // scale 2 let flat = vec![100u8; width * 4]; - // 44 pixels differing by 60 per channel: under the old mean allowance, but a real artifact. + // 44 pixels whose colour channels differ by 60 (alpha unchanged): the mean is + // 44 * 3 * 60 / (880 * 4) = 2.25, which the earlier `0.25 + 0.05 * off` allowance (2.45 here) + // let through; the count, 44, is within a twentieth of the row. A real artifact, so it fails + // on the mean now. let mut artifact = flat.clone(); for px in artifact.chunks_mut(4).take(44) { - px.iter_mut().for_each(|c| *c += 60); + px.iter_mut().take(3).for_each(|c| *c += 60); } let (mean, off) = row_stats(&flat, &artifact); assert!(!row_ok(mean, off, width), "{mean} {off}"); From f5a52ea528e3e597e753f458d4fde92422b4583c Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Sat, 7 Nov 2026 21:20:56 -0500 Subject: [PATCH 012/101] Components: several layers selected, the component button offers Create multiple components (#2088) With two or more layers selected, the Design panel header's component button opens a menu with Create component and Create multiple components, as Figma's does; one layer keeps the plain button. Headless UI tests cover both cases (three frames: menu order, names kept, all selected, one undo; one frame: plain click), and an engine test pins createMultiple's names, positions and single undo step. Co-Authored-By: Claude Sonnet 5.5 Model-Effort: Opus 5.5 drove; Opus 5.5 briefed; Sonnet 5.5 wrote at medium --- .../engine/src/components_behaviour_tests.rs | 33 +++++ .../ui-egui/src/create_multiple_menu_tests.rs | 115 ++++++++++++++++++ crates/ui-egui/src/lib.rs | 2 + crates/ui-egui/src/panels/right.rs | 13 ++ docs/components-parity.md | 5 +- 5 files changed, 166 insertions(+), 2 deletions(-) create mode 100644 crates/ui-egui/src/create_multiple_menu_tests.rs diff --git a/crates/engine/src/components_behaviour_tests.rs b/crates/engine/src/components_behaviour_tests.rs index 3458b0b22..198151768 100644 --- a/crates/engine/src/components_behaviour_tests.rs +++ b/crates/engine/src/components_behaviour_tests.rs @@ -7,6 +7,7 @@ use serde_json::{Value, json}; use crate::Session; +use crate::automation::params::id_of; use crate::components::tests::{chars, copy_of, ex, fill, healthy, idv, kids, node}; use figcraft_doc::*; @@ -1000,3 +1001,35 @@ fn deleting_a_layer_inside_an_instance_hides_it_instead() { s.execute("edit.delete", &json!({"ids": [k.inst]})).unwrap(); assert!(s.doc().unwrap().node(k.inst).is_none()); } + +/// Create multiple components (#2088): each selected layer becomes its own component in place, +/// keeping its name and position; all stay selected and one undo reverts them all. +#[test] +fn create_multiple_components_keeps_names_and_places_and_is_one_undo_step() { + let mut s = Session::new(); + let mut frames = Vec::new(); + for (i, name) in ["Card", "Badge", "Tile"].into_iter().enumerate() { + let x = 150.0 * i as f64; + let v = s.execute("frame.create", &json!({"x": x, "y": 20, "width": 100, "height": 60})).unwrap(); + let f = id_of(&v["id"]).unwrap(); + s.execute("object.rename", &json!({"ids": [f], "name": name})).unwrap(); + frames.push(f); + } + let before = undo_len(&s); + let out = s.execute("component.createMultiple", &json!({"ids": frames})).unwrap(); + assert_eq!(undo_len(&s), before + 1, "one undo step"); + let made: Vec = out["ids"].as_array().unwrap().iter().filter_map(id_of).collect(); + assert_eq!(made.len(), 3); + assert_eq!(s.selection(), made, "all of them stay selected"); + let doc = s.doc().unwrap(); + for (i, (c, name)) in made.iter().zip(["Card", "Badge", "Tile"]).enumerate() { + let n = doc.node(*c).unwrap(); + assert!(matches!(n.kind, NodeKind::Component { .. }), "{name} is a component"); + assert_eq!(n.name, name); + let b = doc.world_bounds(*c).unwrap(); + assert_eq!((b.x0, b.y0), (150.0 * i as f64, 20.0), "{name} stays in place"); + } + s.undo().unwrap(); + let doc = s.doc().unwrap(); + assert!(frames.iter().all(|f| matches!(doc.node(*f).map(|n| &n.kind), Some(NodeKind::Frame))), "one undo restores the frames"); +} diff --git a/crates/ui-egui/src/create_multiple_menu_tests.rs b/crates/ui-egui/src/create_multiple_menu_tests.rs new file mode 100644 index 000000000..a8c2b3a56 --- /dev/null +++ b/crates/ui-egui/src/create_multiple_menu_tests.rs @@ -0,0 +1,115 @@ +//! With two or more layers selected the Design panel's component button opens a menu (Create +//! component, Create multiple components); one layer keeps the plain click (#2088): drawn headless. + +use egui::accesskit::Node; +use egui::{Event, PointerButton, Pos2, Rect, pos2}; +use figcraft_doc::{NodeId, NodeKind}; +use figcraft_engine::Session; +use serde_json::json; + +use crate::layers_drag_tests::Ui; + +const NAMES: [&str; 3] = ["Card", "Badge", "Tile"]; + +fn id(v: serde_json::Value) -> NodeId { + serde_json::from_value(v["id"].clone()).unwrap() +} + +/// Frames named `NAMES[..n]`, all selected, headless. +fn frames(n: usize) -> (Ui, Vec) { + let mut s = Session::new(); + let mut ids = Vec::new(); + for (i, name) in NAMES.into_iter().take(n).enumerate() { + let f = id(s.execute("frame.create", &json!({"x": 150 * i, "y": 0, "width": 100, "height": 60})).unwrap()); + s.execute("object.rename", &json!({"ids": [f], "name": name})).unwrap(); + ids.push(f); + } + s.execute("select.set", &json!({"ids": ids})).unwrap(); + let mut u = Ui::new(s); + u.frame(vec![]); + (u, ids) +} + +fn nodes(u: &mut Ui) -> Vec { + u.ctx.enable_accesskit(); + u.frame(vec![]); + u.frame_output(vec![]).platform_output.accesskit_update.expect("an AccessKit update").nodes.into_iter().map(|(_, n)| n).collect() +} + +fn bounds(n: &Node) -> Rect { + let b = n.bounds().unwrap(); + Rect::from_min_max(pos2(b.x0 as f32, b.y0 as f32), pos2(b.x1 as f32, b.y1 as f32)) +} + +fn click(u: &mut Ui, at: Pos2) { + for pressed in [true, false] { + u.frame(vec![ + Event::PointerMoved(at), + Event::PointerButton { pos: at, button: PointerButton::Primary, pressed, modifiers: Default::default() }, + ]); + } +} + +fn settle(u: &mut Ui) { + for _ in 0..10 { + u.frame(vec![]); + } +} + +/// The header's component button (its tooltip may carry the shortcut). +fn click_button(u: &mut Ui) { + let all = nodes(u); + let button = all.iter().find(|n| n.label().is_some_and(|l| l.starts_with("Create component"))).expect("the Design panel's component button"); + click(u, bounds(button).center()); + settle(u); +} + +fn undo_len(u: &Ui) -> usize { + u.app.session.ds().unwrap().history.undo.len() +} + +#[test] +fn several_layers_open_a_menu_and_create_multiple_components_in_one_undo_step() { + let (mut u, ids) = frames(3); + let before = undo_len(&u); + click_button(&mut u); + assert_eq!(undo_len(&u), before, "opening the menu changes nothing"); + let all = nodes(&mut u); + // The menu's rows share an x with Create multiple components: exactly these two, in this order. + let multiple = all.iter().find(|n| n.label() == Some("Create multiple components")).expect("the menu's second entry"); + let mb = bounds(multiple); + let mut rows: Vec<(f32, String)> = all + .iter() + .filter(|n| n.label().is_some() && (bounds(n).min.x - mb.min.x).abs() < 1.0 && (bounds(n).min.y - mb.min.y).abs() < 60.0) + .map(|n| (bounds(n).min.y, n.label().unwrap_or("").to_owned())) + .collect(); + rows.sort_by(|a, b| a.0.total_cmp(&b.0)); + let labels: Vec<&str> = rows.iter().map(|(_, l)| l.as_str()).collect(); + assert_eq!(labels, ["Create component", "Create multiple components"], "the menu's entries"); + click(&mut u, bounds(multiple).center()); + settle(&mut u); + let sel = u.app.session.selection(); + assert_eq!(sel.len(), 3); + let doc = u.app.session.doc().unwrap(); + let names: Vec<&str> = sel.iter().map(|i| doc.node(*i).unwrap().name.as_str()).collect(); + assert_eq!(names, NAMES); + assert!(sel.iter().all(|i| matches!(doc.node(*i).unwrap().kind, NodeKind::Component { .. }))); + assert_eq!(undo_len(&u), before + 1); + u.app.session.undo().unwrap(); + let doc = u.app.session.doc().unwrap(); + assert!(ids.iter().all(|i| matches!(doc.node(*i).map(|n| &n.kind), Some(NodeKind::Frame))), "one undo reverts all three"); +} + +#[test] +fn one_layer_keeps_the_plain_button() { + let (mut u, ids) = frames(1); + click_button(&mut u); + let all = nodes(&mut u); + assert!(all.iter().all(|n| n.label() != Some("Create multiple components")), "no menu opens"); + let sel = u.app.session.selection(); + assert_eq!(sel.len(), 1); + let doc = u.app.session.doc().unwrap(); + assert!(matches!(doc.node(sel[0]).unwrap().kind, NodeKind::Component { .. })); + assert_eq!(doc.node(sel[0]).unwrap().name, NAMES[0]); + let _ = ids; +} diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 11c96da74..b47f05fbb 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -88,6 +88,8 @@ mod context_menu_tests; #[cfg(test)] mod corner_individual_tests; #[cfg(test)] +mod create_multiple_menu_tests; +#[cfg(test)] mod crop_image_tests; #[cfg(test)] mod cursors_tests; diff --git a/crates/ui-egui/src/panels/right.rs b/crates/ui-egui/src/panels/right.rs index bba57c778..b408491a2 100644 --- a/crates/ui-egui/src/panels/right.rs +++ b/crates/ui-egui/src/panels/right.rs @@ -530,6 +530,19 @@ fn header(app: &mut FigApp, ui: &mut Ui, doc: &Document, sel: &[NodeId]) { ui.close(); } }); + } else if cmd == "component.create" && sel.len() > 1 { + // Several layers: the button opens a menu, as Figma's does (#2088). One layer keeps the plain click. + // TODO: "Create component set" is the third entry, to add once its naming is measured. + menu_popup(&bresp).width(220.0).show(|ui| { + let multiple = crate::i18n::command("component.createMultiple", "Create multiple components"); + for (c, label) in [("component.create", tr("Create component")), ("component.createMultiple", &multiple)] { + let key = crate::shortcuts::shortcut(c).unwrap_or(""); + if menu_icon_item(ui, None, None, label, key) { + app.run(c, json!({})); + ui.close(); + } + } + }); } else if bresp.clicked() { app.run(cmd, json!({})); } diff --git a/docs/components-parity.md b/docs/components-parity.md index d6b1ee5e6..3ecdae292 100644 --- a/docs/components-parity.md +++ b/docs/components-parity.md @@ -1,6 +1,6 @@ # Components, variants, styles and variables parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-06 · **Change:** minor (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 renamed, and Make slot asks for the slot's name first (#1536, #1537); components can't contain their own instances, directly or through others (#1084); the instance-swap menus have a search field (#1338); an instance-swap property's default menu scrolls (#1338); variables on a text style's fields from the style editor; instance-swap properties in the component playground; duplicating or Alt-dragging a main component makes an instance of it (#892); a bound colour variable's alpha applies once (#802); variables import reads `variables` outside `meta` and warns when it imports none (#790); variant properties reorder by drag; library files saved right after a read are read again; Hide when publishing note corrected; size and resizing overrides of layers inside instances (#731); variables export in the browser as a download; core editor leftovers: component playground, variables inside styles; layers and assets panels behaviour suite and fixes; extended collections tail; styles and variables behaviour suite and fixes; components behaviour suite and fixes; team libraries on the server, library usage and swapping a library; extended collections, variables import/export, gradient stops and variant properties bound to variables) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-07 · **Change:** minor (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 renamed, and Make slot asks for the slot's name first (#1536, #1537); components can't contain their own instances, directly or through others (#1084); the instance-swap menus have a search field (#1338); an instance-swap property's default menu scrolls (#1338); variables on a text style's fields from the style editor; instance-swap properties in the component playground; duplicating or Alt-dragging a main component makes an instance of it (#892); a bound colour variable's alpha applies once (#802); variables import reads `variables` outside `meta` and warns when it imports none (#790); variant properties reorder by drag; library files saved right after a read are read again; Hide when publishing note corrected; size and resizing overrides of layers inside instances (#731); variables export in the browser as a download; core editor leftovers: component playground, variables inside styles; layers and assets panels behaviour suite and fixes; extended collections tail; styles and variables behaviour suite and fixes; components behaviour suite and fixes; team libraries on the server, library usage and swapping a library; extended collections, variables import/export, gradient stops and variant properties bound to variables) · **Target:** Figma Design (desktop app 126.10.7) 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 @@ -12,7 +12,7 @@ accounts). | Feature | Status | Notes | |---|---|---| -| Create component, instances, detach, reset, go to main, restore main, push changes | done | push from a nested layer goes to the outer main | +| Create component, instances, detach, reset, go to main, restore main, push changes | done | push from a nested layer goes to the outer main; with two or more layers selected the Design panel header's component button opens a menu with Create component and Create multiple components (each layer its own component in place, one undo step), one layer keeps the plain click (#2088); Create component set is not in the menu yet | | Per-layer overrides with reset; kept across main edits, nested swaps, copy/paste | done | main edits match a full rebuild exactly at 2,000 instances | | What an instance overrides: fills, strokes, effects, visibility, layer names, text content and every text property (resizing included), auto layout padding, gap and alignment, layout grids, export settings, prototype interactions, nested swaps and property values; the size and resizing (hug, fill, fixed, min and max) of layers inside it | done | each kept when the main changes that property, reset per group; opacity and corner radius too (documentation silent); size and resizing are kept through relayout, undo, save, `.fig` and REST import and detach, and stay with the instance on push | | What it doesn't: position, rotation, constraints and absolute or grid placement of layers inside it, its auto layout direction and other settings, its structure | done | refused with a message, the fields greyed out (Delete on a layer inside an instance hides it instead of removing it, as the help center says it does); the instance itself resizes and its layers follow the main's constraints | @@ -79,6 +79,7 @@ updates with overrides kept: `library_tests.rs`, `components_scale_tests.rs`. | Date | Change | Summary | |---|---|---| +| 2026-11-07 | patch | M3, #2088: with two or more layers selected the Design panel header's component button opens a menu with Create component and Create multiple components, as Figma's does; one layer keeps the plain button. Create component set is left out until its naming is measured. Tests: `create_multiple_menu_tests`, `components_behaviour_tests::create_multiple_components_keeps_names_and_places_and_is_one_undo_step`. Grade unchanged. | | 2026-11-05 | minor | M3, #2002: the Local variables window selects several variables, as the Layers panel selects layers. A click selects one row, Shift+click the range from the anchor through the rows shown, Cmd/Ctrl+click toggles a row, Escape or a click on the empty space below the rows clears; selected rows use the sidebar's selected-row colour. Right-clicking a row that is part of a selection of several offers Delete, Move to group and Scope (all supported properties, hidden from pickers, or only one scope) for the selected local variables, each sent as one `command.batch`, so one undo step; no engine command changed. Renaming and value edits stay single-row. Tests: `variables_select_tests` (headless UI). Grade unchanged | | 2026-11-02 | minor | M3, #1829: text styles carry paragraph spacing and indent, the list style and the OpenType features ("Supported in text styles": "Paragraph spacing and indentation", "Lists", "OpenType features", Create and apply text styles) beside the character properties: `style.create` takes them from the layer (or the selected paragraphs' list) or from a `value` (`paragraphSpacing`, `paragraphIndent`, `listStyle`, `features`), `style.apply` sets them (on a range, the list goes to the paragraphs touched; the rest is the layer's, as in Figma), `style.update` moves them on every linked layer, editing one on a styled text unlinks it as editing its font does, the style editor lists them, and a `.fig` file keeps them with the style (its sample layer). Grade unchanged. | | 2026-11-06 | patch | M3: a glass's light angle bound to a number past ±180 turns round to the same direction (270 is -90), as the angle drawn from it does, instead of stopping at 180. Tests: `effects_tests::a_bound_light_angle_turns_round_instead_of_stopping`. Grade unchanged. | From 524ad8b1ddfd576ad86dd13d7c1b71f4deaad3e1 Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Sat, 7 Nov 2026 21:38:30 -0500 Subject: [PATCH 013/101] Components: Create component set in the component button's menu (#2088) The third entry of the menu several selected layers get: each layer becomes a component and they are wrapped in a component set in place, 20 px around, named as Figma names them (measured): "Property 1=" in left-to-right order, prop=value names kept, and layers that all share a name give a set of that name with "Default" variants. Engine tests cover the three measured cases, geometry, selection, one undo and the refusal of instances; the UI test checks the three menu entries in order and that the third makes one set. Co-Authored-By: Claude Sonnet 5.5 Model-Effort: Opus 5.5 drove; Opus 5.5 briefed; Sonnet 5.5 wrote at medium --- crates/engine/src/cmd/component.rs | 9 +- crates/engine/src/cmd/component/variants.rs | 55 ++++++++- .../engine/src/components_behaviour_tests.rs | 106 ++++++++++++++++++ .../ui-egui/src/create_multiple_menu_tests.rs | 27 ++++- crates/ui-egui/src/panels/right.rs | 6 +- docs/components-parity.md | 4 +- 6 files changed, 197 insertions(+), 10 deletions(-) diff --git a/crates/engine/src/cmd/component.rs b/crates/engine/src/cmd/component.rs index e0b2e02f4..06e6bf166 100644 --- a/crates/engine/src/cmd/component.rs +++ b/crates/engine/src/cmd/component.rs @@ -24,7 +24,7 @@ use instance::{detach, make_slot, push_changes, remove_slot, reset_instance, res pub(crate) use instance::{swap_at, swap_instance}; use props::{add_prop, bind_prop, delete_prop, edit_prop, set_props}; pub(crate) use props::{apply_prop_bindings, check_prop_binding, describe_props}; -use variants::{add_variant, combine}; +use variants::{add_variant, combine, create_set}; pub use variants::{can_add_variant, can_combine_variants}; /// `component.hideWhenPublishing`: the leading `.` of the names of this file's components and @@ -72,6 +72,13 @@ pub fn specs() -> Vec { s.set_selection(out.iter().filter_map(id_of).collect()); Ok(json!({"ids": out})) }), + spec!( + "component.createSet", + "Create component set", + "{ids? (layers, not components, sets or instances)} (each becomes a component, wrapped in place in a component set: variants \"Property 1=\" left to right, 20 px around)", + true, + create_set + ), spec!( "component.combineVariants", "Combine as variants", diff --git a/crates/engine/src/cmd/component/variants.rs b/crates/engine/src/cmd/component/variants.rs index 5f9e218ac..53e00ca6d 100644 --- a/crates/engine/src/cmd/component/variants.rs +++ b/crates/engine/src/cmd/component/variants.rs @@ -1,6 +1,6 @@ use super::{ - BTreeMap, BTreeSet, Document, EngineError, Node, NodeId, NodeKind, Result, Session, Value, bad, inside_instance, json, owning_instance, - req_targets, roots, set_name_from, string, targets, variant_name, variant_options, variant_props, variant_set, z_sorted, + BTreeMap, BTreeSet, Document, EngineError, Node, NodeId, NodeKind, Result, Session, Value, bad, create, id_of, inside_instance, json, + owning_instance, req_targets, roots, set_name_from, string, targets, variant_name, variant_options, variant_props, variant_set, z_sorted, }; /// Wrap components in a new component set (named after the first) placed around them. @@ -94,6 +94,57 @@ pub(super) fn combine(s: &mut Session, p: &Value) -> Result { Ok(json!({"id": set})) } +/// `component.createSet`: each target becomes a component (as `component.createMultiple` makes +/// them) and all are wrapped in place in a component set, 20 px around, named as Figma names them: +/// variants "Property 1=" in left-to-right order (a name holding `=` is kept); layers +/// that all share a name give a set of that name with "Property 1=Default" variants; otherwise the +/// set is "Component N". +pub(super) fn create_set(s: &mut Session, p: &Value) -> Result { + let cmd = "component.createSet"; + let mut seen = BTreeSet::new(); + let ids: Vec = req_targets(cmd, s, p)?.into_iter().filter(|i| seen.insert(*i)).collect(); + let doc = s.doc()?; + if ids.iter().any(|i| inside_instance(doc, *i)) { + return Err(EngineError::Disabled(cmd.into(), "layers inside an instance can't become components".into())); + } + if ids.iter().any(|i| doc.is_remote(*i)) { + return Err(EngineError::Disabled(cmd.into(), crate::library::READ_ONLY.into())); + } + if ids.iter().any(|i| { + doc.node(*i).is_some_and(|n| matches!(n.kind, NodeKind::Instance { .. } | NodeKind::Component { .. } | NodeKind::ComponentSet { .. })) + }) { + return Err(EngineError::Disabled(cmd.into(), "select layers that aren't components, component sets or instances".into())); + } + let mut made = Vec::new(); + for i in roots(doc, &ids) { + let r = create(s, &json!({"ids": [i]}))?; + made.push(id_of(&r["id"]).ok_or_else(|| bad(cmd, "component creation failed"))?); + } + let doc = s.doc_mut()?; + // Left to right by world x, ties by y: the variants' order, and the values' order. + let mut by_x: Vec<(NodeId, f64, f64)> = made.iter().map(|i| doc.world_bounds(*i).map_or((*i, 0.0, 0.0), |b| (*i, b.x0, b.y0))).collect(); + by_x.sort_by(|a, b| a.1.total_cmp(&b.1).then(a.2.total_cmp(&b.2))); + let names: Vec = by_x.iter().map(|(i, ..)| doc.node(*i).map(|n| n.name.clone()).unwrap_or_default()).collect(); + let same = names.windows(2).all(|w| w.first() == w.get(1)) && names.first().is_some_and(|n| !n.is_empty() && !n.contains('=')); + let set_name = match names.first() { + Some(n) if same => n.clone(), + _ => doc.next_name("Component"), + }; + for ((i, ..), name) in by_x.iter().zip(&names) { + let node = doc.get_mut(*i)?; + if same { + node.name = "Property 1=Default".into(); + } else if !name.contains('=') { + node.name = format!("Property 1={name}"); + } + } + let ordered = z_sorted(doc, &made); + let set = wrap_in_set(cmd, doc, &ordered)?; + doc.get_mut(set)?.name = set_name; + s.set_selection(vec![set]); + Ok(json!({"id": set})) +} + /// Grow a component set so it wraps its variants with 20 px of padding (right and bottom). pub(super) fn fit_set(doc: &mut Document, set: NodeId) { let Some(kids) = doc.node(set).map(|n| n.children.clone()) else { return }; diff --git a/crates/engine/src/components_behaviour_tests.rs b/crates/engine/src/components_behaviour_tests.rs index 198151768..f65049de5 100644 --- a/crates/engine/src/components_behaviour_tests.rs +++ b/crates/engine/src/components_behaviour_tests.rs @@ -1033,3 +1033,109 @@ fn create_multiple_components_keeps_names_and_places_and_is_one_undo_step() { let doc = s.doc().unwrap(); assert!(frames.iter().all(|f| matches!(doc.node(*f).map(|n| &n.kind), Some(NodeKind::Frame))), "one undo restores the frames"); } + +/// Frames named `names` at x = 150 * i (mirrored when `reverse`), y 20, 100 x 60. +fn named_frames(s: &mut Session, names: &[&str], reverse: bool) -> Vec { + let n = names.len(); + names + .iter() + .enumerate() + .map(|(i, name)| { + let x = 150.0 * if reverse { n - 1 - i } else { i } as f64; + let v = s.execute("frame.create", &json!({"x": x, "y": 20, "width": 100, "height": 60})).unwrap(); + let f = id_of(&v["id"]).unwrap(); + s.execute("object.rename", &json!({"ids": [f], "name": name})).unwrap(); + f + }) + .collect() +} + +/// The set's name and its children's names in layer order. +fn set_names(s: &Session, set: NodeId) -> (String, Vec) { + let doc = s.doc().unwrap(); + let n = doc.node(set).unwrap(); + (n.name.clone(), n.children.iter().map(|c| doc.node(*c).unwrap().name.clone()).collect()) +} + +/// The set's variant names ordered by world x. +fn names_by_x(s: &Session, set: NodeId) -> Vec { + let doc = s.doc().unwrap(); + let mut v: Vec<(f64, String)> = + doc.node(set).unwrap().children.iter().map(|c| (doc.world_bounds(*c).unwrap().x0, doc.node(*c).unwrap().name.clone())).collect(); + v.sort_by(|a, b| a.0.total_cmp(&b.0)); + v.into_iter().map(|(_, n)| n).collect() +} + +/// Create component set (#2088, measured in Figma): variants "Property 1=" in left-to-right +/// order, the set "Component 1", wrapped in place 20 px around, selected, one undo step. +#[test] +fn create_set_names_variants_by_layer_name_and_wraps_in_place() { + let mut s = Session::new(); + let frames = named_frames(&mut s, &["Primary", "Secondary", "Ghost"], false); + let before = undo_len(&s); + let out = s.execute("component.createSet", &json!({"ids": frames})).unwrap(); + assert_eq!(undo_len(&s), before + 1, "one undo step"); + let set = id_of(&out["id"]).unwrap(); + assert_eq!(s.selection(), vec![set], "the set is selected"); + assert_eq!(set_names(&s, set).0, "Component 1"); + assert_eq!(names_by_x(&s, set), ["Property 1=Primary", "Property 1=Secondary", "Property 1=Ghost"]); + let doc = s.doc().unwrap(); + for (i, c) in doc.node(set).unwrap().children.iter().enumerate() { + assert!(matches!(doc.node(*c).unwrap().kind, NodeKind::Component { .. })); + let b = doc.world_bounds(*c).unwrap(); + assert_eq!((b.x0, b.y0), (150.0 * i as f64, 20.0), "frames stay put"); + } + let sb = doc.world_bounds(set).unwrap(); + assert_eq!((sb.x0, sb.y0, sb.x1, sb.y1), (-20.0, 0.0, 420.0, 100.0), "20 px on every side"); + s.undo().unwrap(); + let doc = s.doc().unwrap(); + assert!(doc.node(set).is_none()); + assert!(frames.iter().all(|f| matches!(doc.node(*f).map(|n| &n.kind), Some(NodeKind::Frame))), "one undo restores the frames"); +} + +#[test] +fn create_set_orders_left_to_right_whatever_the_selection_order() { + let mut s = Session::new(); + let frames = named_frames(&mut s, &["A", "B", "C"], true); + let out = s.execute("component.createSet", &json!({"ids": frames})).unwrap(); + let set = id_of(&out["id"]).unwrap(); + assert_eq!(names_by_x(&s, set), ["Property 1=C", "Property 1=B", "Property 1=A"]); + let (_, kids) = set_names(&s, set); + assert_eq!(kids.len(), 3); +} + +#[test] +fn create_set_keeps_names_already_in_prop_value_form() { + let mut s = Session::new(); + let frames = named_frames(&mut s, &["Size=Small", "Size=Large", "Size=Medium"], false); + let out = s.execute("component.createSet", &json!({"ids": frames})).unwrap(); + let set = id_of(&out["id"]).unwrap(); + assert_eq!(set_names(&s, set).0, "Component 1"); + assert_eq!(names_by_x(&s, set), ["Size=Small", "Size=Large", "Size=Medium"]); +} + +#[test] +fn create_set_with_one_shared_name_names_the_set_and_makes_default_variants() { + let mut s = Session::new(); + let frames = named_frames(&mut s, &["Card", "Card", "Card"], false); + let out = s.execute("component.createSet", &json!({"ids": frames})).unwrap(); + let set = id_of(&out["id"]).unwrap(); + let (name, kids) = set_names(&s, set); + assert_eq!(name, "Card"); + assert_eq!(kids, ["Property 1=Default", "Property 1=Default", "Property 1=Default"]); +} + +#[test] +fn create_set_refuses_instances_and_leaves_the_document_alone() { + let mut s = Session::new(); + let frames = named_frames(&mut s, &["A", "B"], false); + let c = s.execute("component.create", &json!({"ids": [frames[0]]})).unwrap(); + let comp = id_of(&c["id"]).unwrap(); + let inst = s.execute("instance.create", &json!({"component": comp})).unwrap(); + let inst = id_of(&inst["id"]).unwrap(); + let before = undo_len(&s); + let e = s.execute("component.createSet", &json!({"ids": [inst, frames[1]]})).unwrap_err(); + assert!(matches!(e, crate::EngineError::Disabled(..)), "{e:?}"); + assert_eq!(undo_len(&s), before); + assert!(matches!(s.doc().unwrap().node(frames[1]).unwrap().kind, NodeKind::Frame)); +} diff --git a/crates/ui-egui/src/create_multiple_menu_tests.rs b/crates/ui-egui/src/create_multiple_menu_tests.rs index a8c2b3a56..409b67e54 100644 --- a/crates/ui-egui/src/create_multiple_menu_tests.rs +++ b/crates/ui-egui/src/create_multiple_menu_tests.rs @@ -1,5 +1,5 @@ //! With two or more layers selected the Design panel's component button opens a menu (Create -//! component, Create multiple components); one layer keeps the plain click (#2088): drawn headless. +//! component, Create multiple components, Create component set); one layer keeps the plain click (#2088): drawn headless. use egui::accesskit::Node; use egui::{Event, PointerButton, Pos2, Rect, pos2}; @@ -80,12 +80,12 @@ fn several_layers_open_a_menu_and_create_multiple_components_in_one_undo_step() let mb = bounds(multiple); let mut rows: Vec<(f32, String)> = all .iter() - .filter(|n| n.label().is_some() && (bounds(n).min.x - mb.min.x).abs() < 1.0 && (bounds(n).min.y - mb.min.y).abs() < 60.0) + .filter(|n| n.label().is_some() && (bounds(n).min.x - mb.min.x).abs() < 1.0 && (bounds(n).min.y - mb.min.y).abs() < 90.0) .map(|n| (bounds(n).min.y, n.label().unwrap_or("").to_owned())) .collect(); rows.sort_by(|a, b| a.0.total_cmp(&b.0)); let labels: Vec<&str> = rows.iter().map(|(_, l)| l.as_str()).collect(); - assert_eq!(labels, ["Create component", "Create multiple components"], "the menu's entries"); + assert_eq!(labels, ["Create component", "Create multiple components", "Create component set"], "the menu's entries"); click(&mut u, bounds(multiple).center()); settle(&mut u); let sel = u.app.session.selection(); @@ -113,3 +113,24 @@ fn one_layer_keeps_the_plain_button() { assert_eq!(doc.node(sel[0]).unwrap().name, NAMES[0]); let _ = ids; } + +#[test] +fn the_third_entry_creates_one_component_set() { + let (mut u, ids) = frames(3); + let before = undo_len(&u); + click_button(&mut u); + let all = nodes(&mut u); + let entry = all.iter().find(|n| n.label() == Some("Create component set")).expect("the menu's third entry"); + click(&mut u, bounds(entry).center()); + settle(&mut u); + let sel = u.app.session.selection(); + assert_eq!(sel.len(), 1, "the set is selected"); + let doc = u.app.session.doc().unwrap(); + let set = doc.node(sel[0]).unwrap(); + assert!(matches!(set.kind, NodeKind::ComponentSet { .. })); + assert_eq!(set.children.len(), 3); + assert_eq!(undo_len(&u), before + 1); + u.app.session.undo().unwrap(); + let doc = u.app.session.doc().unwrap(); + assert!(ids.iter().all(|i| matches!(doc.node(*i).map(|n| &n.kind), Some(NodeKind::Frame))), "one undo reverts it all"); +} diff --git a/crates/ui-egui/src/panels/right.rs b/crates/ui-egui/src/panels/right.rs index b408491a2..55b36ebf5 100644 --- a/crates/ui-egui/src/panels/right.rs +++ b/crates/ui-egui/src/panels/right.rs @@ -532,10 +532,12 @@ fn header(app: &mut FigApp, ui: &mut Ui, doc: &Document, sel: &[NodeId]) { }); } else if cmd == "component.create" && sel.len() > 1 { // Several layers: the button opens a menu, as Figma's does (#2088). One layer keeps the plain click. - // TODO: "Create component set" is the third entry, to add once its naming is measured. menu_popup(&bresp).width(220.0).show(|ui| { let multiple = crate::i18n::command("component.createMultiple", "Create multiple components"); - for (c, label) in [("component.create", tr("Create component")), ("component.createMultiple", &multiple)] { + let set = crate::i18n::command("component.createSet", "Create component set"); + for (c, label) in + [("component.create", tr("Create component")), ("component.createMultiple", &multiple), ("component.createSet", &set)] + { let key = crate::shortcuts::shortcut(c).unwrap_or(""); if menu_icon_item(ui, None, None, label, key) { app.run(c, json!({})); diff --git a/docs/components-parity.md b/docs/components-parity.md index 3ecdae292..a28ca6d0e 100644 --- a/docs/components-parity.md +++ b/docs/components-parity.md @@ -12,7 +12,7 @@ accounts). | Feature | Status | Notes | |---|---|---| -| Create component, instances, detach, reset, go to main, restore main, push changes | done | push from a nested layer goes to the outer main; with two or more layers selected the Design panel header's component button opens a menu with Create component and Create multiple components (each layer its own component in place, one undo step), one layer keeps the plain click (#2088); Create component set is not in the menu yet | +| Create component, instances, detach, reset, go to main, restore main, push changes | done | push from a nested layer goes to the outer main; with two or more layers selected the Design panel header's component button opens a menu with Create component, Create multiple components (each layer its own component in place, one undo step) and Create component set (each layer a component, wrapped in place in a set 20 px around: variants `Property 1=` left to right, `prop=value` names kept, layers that all share a name give a set of that name with `Property 1=Default` variants; measured in Figma), one layer keeps the plain click (#2088) | | Per-layer overrides with reset; kept across main edits, nested swaps, copy/paste | done | main edits match a full rebuild exactly at 2,000 instances | | What an instance overrides: fills, strokes, effects, visibility, layer names, text content and every text property (resizing included), auto layout padding, gap and alignment, layout grids, export settings, prototype interactions, nested swaps and property values; the size and resizing (hug, fill, fixed, min and max) of layers inside it | done | each kept when the main changes that property, reset per group; opacity and corner radius too (documentation silent); size and resizing are kept through relayout, undo, save, `.fig` and REST import and detach, and stay with the instance on push | | What it doesn't: position, rotation, constraints and absolute or grid placement of layers inside it, its auto layout direction and other settings, its structure | done | refused with a message, the fields greyed out (Delete on a layer inside an instance hides it instead of removing it, as the help center says it does); the instance itself resizes and its layers follow the main's constraints | @@ -79,7 +79,7 @@ updates with overrides kept: `library_tests.rs`, `components_scale_tests.rs`. | Date | Change | Summary | |---|---|---| -| 2026-11-07 | patch | M3, #2088: with two or more layers selected the Design panel header's component button opens a menu with Create component and Create multiple components, as Figma's does; one layer keeps the plain button. Create component set is left out until its naming is measured. Tests: `create_multiple_menu_tests`, `components_behaviour_tests::create_multiple_components_keeps_names_and_places_and_is_one_undo_step`. Grade unchanged. | +| 2026-11-07 | patch | M3, #2088: with two or more layers selected the Design panel header's component button opens a menu with Create component, Create multiple components and Create component set (`component.createSet`, naming measured in Figma), as Figma's does; one layer keeps the plain button. Tests: `create_multiple_menu_tests`, `components_behaviour_tests::create_multiple_components_keeps_names_and_places_and_is_one_undo_step`, `components_behaviour_tests::create_set_*`. Grade unchanged. | | 2026-11-05 | minor | M3, #2002: the Local variables window selects several variables, as the Layers panel selects layers. A click selects one row, Shift+click the range from the anchor through the rows shown, Cmd/Ctrl+click toggles a row, Escape or a click on the empty space below the rows clears; selected rows use the sidebar's selected-row colour. Right-clicking a row that is part of a selection of several offers Delete, Move to group and Scope (all supported properties, hidden from pickers, or only one scope) for the selected local variables, each sent as one `command.batch`, so one undo step; no engine command changed. Renaming and value edits stay single-row. Tests: `variables_select_tests` (headless UI). Grade unchanged | | 2026-11-02 | minor | M3, #1829: text styles carry paragraph spacing and indent, the list style and the OpenType features ("Supported in text styles": "Paragraph spacing and indentation", "Lists", "OpenType features", Create and apply text styles) beside the character properties: `style.create` takes them from the layer (or the selected paragraphs' list) or from a `value` (`paragraphSpacing`, `paragraphIndent`, `listStyle`, `features`), `style.apply` sets them (on a range, the list goes to the paragraphs touched; the rest is the layer's, as in Figma), `style.update` moves them on every linked layer, editing one on a styled text unlinks it as editing its font does, the style editor lists them, and a `.fig` file keeps them with the style (its sample layer). Grade unchanged. | | 2026-11-06 | patch | M3: a glass's light angle bound to a number past ±180 turns round to the same direction (270 is -90), as the angle drawn from it does, instead of stopping at 180. Tests: `effects_tests::a_bound_light_angle_turns_round_instead_of_stopping`. Grade unchanged. | From 34c44e6063e4eb70f801bf3b8bffc6d6398faf6c Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Sat, 7 Nov 2026 22:15:22 -0500 Subject: [PATCH 014/101] Text: a font loaded with text.loadFont wins over the built-in and installed faces of the same family and style (#2092) FigCraft chose the first face added for a family and style, so the embedded Inter 4.x kept Regular, SemiBold and Bold after Inter 3.19 was loaded and only Medium refitted. A loaded font is the counterpart of a font uploaded to the organization, which Figma's help center ranks first ("Manage conflicting fonts"). The test builds its faces from any embedded or installed font (skipped when there is none) and checks a loaded face beats a built-in one, the latest load beats earlier ones, and other styles resolve as before. Co-Authored-By: Claude Sonnet 5.5 Model-Effort: Opus 5.5 drove; Opus 5.5 briefed; Sonnet 5.5 wrote at medium --- crates/text/src/fontdb.rs | 29 +++++++++++++++++++++--- crates/text/src/fontdb_tests.rs | 39 +++++++++++++++++++++++++++++++++ docs/file-format-parity.md | 2 ++ 3 files changed, 67 insertions(+), 3 deletions(-) diff --git a/crates/text/src/fontdb.rs b/crates/text/src/fontdb.rs index 3c82cd261..5159a68d1 100644 --- a/crates/text/src/fontdb.rs +++ b/crates/text/src/fontdb.rs @@ -92,6 +92,10 @@ pub struct Face { pub italic: bool, pub bytes: FontBytes, pub index: u32, + /// 0 for a built-in or installed face; else the order it was loaded in with `text.loadFont` + /// ([`FontDb::add_loaded`]). A loaded face wins over any other of its family and style, the + /// latest load over earlier ones (#2092). + pub loaded: u32, pub upem: f64, /// Ascent and descent in font units, both positive. pub ascent: f64, @@ -207,6 +211,7 @@ impl Face { family, style, index, + loaded: 0, upem, ascent, descent, @@ -620,6 +625,8 @@ pub struct FontDb { loaded_files: std::collections::BTreeSet<(std::path::PathBuf, u32)>, /// Font files added as bytes (hash and length → families), so loading one again adds nothing. loaded_bytes: std::collections::HashMap<(u64, usize), Vec>, + /// Loads so far ([`Face::loaded`]). + load_seq: u32, system_scanned: bool, /// Browser fonts text asked for and not yet taken by the browser layer. wanted: Vec, @@ -716,8 +723,20 @@ impl FontDb { face } + /// [`add`](Self::add) a face loaded explicitly (`text.loadFont`): it wins over the other faces + /// of its family and style, and over those loaded before it. + pub fn add_loaded(&mut self, mut face: Face) -> Arc { + self.load_seq += 1; + face.loaded = self.load_seq; + self.add(face) + } + /// Add font file bytes (all faces of a collection). Returns the faces added. pub fn add_bytes(&mut self, bytes: Vec) -> Vec> { + self.add_bytes_with(bytes, false) + } + + fn add_bytes_with(&mut self, bytes: Vec, loaded: bool) -> Vec> { let shared = Arc::new(bytes); let count = match FileRef::new(shared.as_slice()) { // A collection's header may name any number of faces, each a few bytes pointing at @@ -727,7 +746,9 @@ impl FontDb { Ok(FileRef::Font(_)) => 1, Err(_) => 0, }; - (0..count).filter_map(|i| Face::from_bytes(FontBytes::Shared(shared.clone()), i, None, None)).map(|f| self.add(f)).collect() + (0..count).filter_map(|i| Face::from_bytes(FontBytes::Shared(shared.clone()), i, None, None)) + .map(|f| if loaded { self.add_loaded(f) } else { self.add(f) }) + .collect() } /// The family and style of the face whose PostScript name is `ps` (ignoring case), loaded or @@ -1035,7 +1056,9 @@ impl FontDb { /// The loaded face of `family` nearest `style`. fn best(&self, family: &str, style: &str) -> Option> { let (_, idx) = self.families.get(&self.key(family))?; - let faces: Vec<&Arc> = idx.iter().filter_map(|i| self.faces.get(*i)).collect(); + let mut faces: Vec<&Arc> = idx.iter().filter_map(|i| self.faces.get(*i)).collect(); + // A loaded font comes first (the latest load first): of faces as near, the first wins. + faces.sort_by_key(|f| std::cmp::Reverse(f.loaded)); let want = norm_style(style); if let Some(f) = faces.iter().find(|f| norm_style(&f.style) == want).or_else(|| faces.iter().find(|f| has_style(f, style))) { return Some((*f).clone()); @@ -1595,7 +1618,7 @@ pub fn load_font_bytes(bytes: Vec) -> Vec { if let Some(families) = db.loaded_bytes.get(&key) { return families.clone(); } - let faces = db.add_bytes(bytes); + let faces = db.add_bytes_with(bytes, true); let mut families: Vec = faces.iter().map(|f| f.family.clone()).collect(); families.dedup(); if !families.is_empty() { diff --git a/crates/text/src/fontdb_tests.rs b/crates/text/src/fontdb_tests.rs index 38e04c790..a3dd15396 100644 --- a/crates/text/src/fontdb_tests.rs +++ b/crates/text/src/fontdb_tests.rs @@ -382,6 +382,45 @@ fn font_bytes_load_into_the_db() { } } +/// #2092: a font loaded with `text.loadFont` wins over the built-in and installed faces of its family +/// and style, the latest load over earlier ones; other styles resolve as before. +#[test] +fn a_loaded_face_wins_over_the_built_in_one_of_its_family_and_style() { + // Any embedded or installed font stands in for the faces (none without craft-fonts on CI). + let stand_in = CRAFT_FONTS.first().map(|f| f.bytes.to_vec()).or_else(|| { + let mut installed = BTreeMap::new(); + for dir in system_font_dirs() { + scan_dir(&dir, 0, &mut installed); + } + installed.values().flat_map(|(_, v)| v).find_map(|p| std::fs::read(&p.path).ok()) + }); + let Some(bytes) = stand_in.map(Arc::new) else { + eprintln!("skipping: no font to stand in"); + return; + }; + let face = |style: &str, name: &str| { + let mut f = Face::from_bytes(FontBytes::Shared(bytes.clone()), 0, Some("Brand Sans"), Some(style)).unwrap(); + f.instances.clear(); + f.postscript = Some(name.into()); + f + }; + let name = |db: &FontDb, style: &str| db.best("Brand Sans", style).and_then(|f| f.postscript.clone()); + let mut db = FontDb::default(); + db.add(face("Regular", "Built-in-Regular")); + db.add(face("Bold", "Built-in-Bold")); + assert_eq!(name(&db, "Regular").as_deref(), Some("Built-in-Regular")); + db.add_loaded(face("Regular", "Loaded-Regular")); + assert_eq!(name(&db, "Regular").as_deref(), Some("Loaded-Regular")); + // Bold wasn't loaded: the built-in one stays. Nor does the loaded Regular stand in for it. + assert_eq!(name(&db, "Bold").as_deref(), Some("Built-in-Bold")); + // The latest load wins. + db.add_loaded(face("Regular", "Loaded-Regular-2")); + assert_eq!(name(&db, "Regular").as_deref(), Some("Loaded-Regular-2")); + // A face added after a load, not loaded, doesn't displace it. + db.add(face("Regular", "Installed-Regular")); + assert_eq!(name(&db, "Regular").as_deref(), Some("Loaded-Regular-2")); +} + /// Apple's system font answers to the names designs and CSS use for it (SF Pro, SF UI Text, /// system-ui, …), unless a font of that name is installed. #[test] diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index bce90b008..0aaf249ca 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -181,6 +181,7 @@ source paint coordinates. | | Figma | FigCraft | |---|---|---| | Local fonts | yes (font helper / desktop app) | yes (system scan) | +| Conflicting fonts | an uploaded organization font comes first, then fonts installed on the device, then Figma's web fonts (help center, "Manage conflicting fonts") | a font loaded with `text.loadFont` wins over the built-in and installed faces of the same family and style, the latest load over earlier ones (#2092); installed versus built-in order is unchanged, and browser local fonts count as installed | | Bundled/shared fonts | Google Fonts in the cloud | optional `CRAFT_FONTS_DIR` build input (storytold/craft-fonts) | | Variable fonts | yes | yes (axes, named instances, per-range axis values) | | Missing-font replacement on open | yes | listed, not replaced: in the desktop app the Missing fonts window opens after a file that uses them opens and from Text ▸ Missing fonts (`text.missingFonts`; `figcraft-cli info` prints `missing font` lines), and their text draws in a fallback font. A family the font store has (Google Fonts, Noto) downloads from the window once the user allows downloading fonts (`font.download`, #754): pinned, checksum-verified files into the Craft apps' shared font folder, after which the text draws in it. A family is found however a file names it: by the legacy name of one of its weights ("Family Medium") or by the typographic name of a family installed one family per weight, and spelt with other case, spaces or hyphens (#1292). No substitute picker | @@ -189,6 +190,7 @@ source paint coordinates. | Date | Change | Summary | |---|---|---| +| 2026-11-07 | patch | Fonts, #2092: a font loaded with `text.loadFont` is the counterpart of a font uploaded to the organization, which Figma's help center ("Manage conflicting fonts") ranks first, ahead of installed fonts and the web fonts. FigCraft chose the first face added for a family and style, so the built-in Inter 4.x kept Regular, SemiBold and Bold after Inter 3.19 was loaded and only Medium refitted. A loaded face now wins over the other faces of its family and style, the latest load over earlier ones; style matching and fallbacks are unchanged, and `refitted` lists the text whose size changes. Installed versus built-in order is not changed here. Test: `fontdb::tests::a_loaded_face_wins_over_the_built_in_one_of_its_family_and_style`. Numbers unchanged. | | 2026-11-03 | patch | M6, #1909: `.jam` import: a connector end whose magnet is `AUTO` (FigJam picks the side when it draws) or `CENTER` (the end aims at the layer's middle) left the side its stale `relativePosition` named, the left one in the reporter's file, so the connectors looped behind their shape or crossed it. It now leaves the side facing the other end, as a board connector drawn here does (`Side::Auto`), for straight, elbowed and curved connectors alike; a named magnet (`TOP`, `RIGHT`, `BOTTOM`, `LEFT`) is unchanged, and an end without a magnet still takes the edge its point lies on. The Plugin API lists the magnets (`ConnectorEndpoint.magnet`: "Which side of the node it attaches to"; NONE, AUTO, TOP, LEFT, BOTTOM, RIGHT, CENTER; "Straight connectors may use only CENTER or NONE magnets"). Test: `connectors_with_an_automatic_side_leave_the_side_facing_the_target`. Numbers unchanged. | | 2026-11-04 | minor | JPG export: `quality` (1 to 100, default 90) on `file.export`, `export.add` / `export.update` and MCP `export`, kept in the export setting; an sRGB file's JPGs embed the sRGB ICC profile, as Display P3 files' JPGs already embedded theirs, since an untagged JPG is only assumed to be sRGB (#2004). | | 2026-11-04 | minor | `.fig` and `.jam` import, #1910: an elbowed connector saved with its path keeps it. FigJam stores `connectorControlPoints`, one per run between the first and the last, each a point on its run (in the connector's parent's coordinates) with the run's axis; the first run leaves the start's side and the last arrives at the end's. They become the `ConnectorPath::Runs` a board connector reshaped by hand has (`figcraft_doc::route_along`), so a connector drawn around a layer in FigJam stays around it instead of being routed through it. Points that don't make such a path (off both axes, two runs in a row the same way, a first or last run sideways to its side or going back into its object, more runs than a hand could make) leave the connector to the router as before, and only connectors routed here count in the "follow FigCraft's own routing" note. A curved connector's `connectorBezierControlPoints` are still not read. Tests: `tail_tests::an_elbow_connector_saved_with_its_path_keeps_it`, `tail_tests::an_elbow_whose_saved_path_doesnt_fit_its_sides_is_routed_here`. | From a375ac06893ed41af6916508c18bb5896e1e527b Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Sat, 7 Nov 2026 22:15:41 -0500 Subject: [PATCH 015/101] Format (#2092) Co-Authored-By: Claude Sonnet 5.5 --- crates/text/src/fontdb.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/text/src/fontdb.rs b/crates/text/src/fontdb.rs index 5159a68d1..65df051e7 100644 --- a/crates/text/src/fontdb.rs +++ b/crates/text/src/fontdb.rs @@ -746,7 +746,8 @@ impl FontDb { Ok(FileRef::Font(_)) => 1, Err(_) => 0, }; - (0..count).filter_map(|i| Face::from_bytes(FontBytes::Shared(shared.clone()), i, None, None)) + (0..count) + .filter_map(|i| Face::from_bytes(FontBytes::Shared(shared.clone()), i, None, None)) .map(|f| if loaded { self.add_loaded(f) } else { self.add(f) }) .collect() } From 253e0c3df3951f4a6e6f4f85e6d2ae0a08dfd309 Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Sat, 7 Nov 2026 22:49:04 -0500 Subject: [PATCH 016/101] Components: Create component set refuses nested layers and is translated (#2095 review) component.createSet now refuses a selection where one layer is inside another, as component.combineVariants does, before changing the document (the nested layer was silently dropped from the set). Adds the component.createSet label to the 22 locale catalogs that list component.createMultiple. Co-Authored-By: Claude Sonnet 5.5 Model-Effort: Opus 5.5 drove; Opus 5.5 briefed; Sonnet 5.5 wrote at medium --- crates/engine/src/cmd/component/variants.rs | 3 +++ crates/engine/src/components_behaviour_tests.rs | 14 ++++++++++++++ crates/ui-egui/locales/ar.toml | 1 + crates/ui-egui/locales/bs.toml | 1 + crates/ui-egui/locales/cs.toml | 1 + crates/ui-egui/locales/de.toml | 1 + crates/ui-egui/locales/es.toml | 1 + crates/ui-egui/locales/fi.toml | 1 + crates/ui-egui/locales/fr.toml | 1 + crates/ui-egui/locales/id.toml | 1 + crates/ui-egui/locales/it.toml | 1 + crates/ui-egui/locales/ja.toml | 1 + crates/ui-egui/locales/ka.toml | 1 + crates/ui-egui/locales/ko.toml | 1 + crates/ui-egui/locales/nl.toml | 1 + crates/ui-egui/locales/pl.toml | 1 + crates/ui-egui/locales/pt-BR.toml | 1 + crates/ui-egui/locales/ru.toml | 1 + crates/ui-egui/locales/sv.toml | 1 + crates/ui-egui/locales/th.toml | 1 + crates/ui-egui/locales/tr.toml | 1 + crates/ui-egui/locales/vi.toml | 1 + crates/ui-egui/locales/zh-Hans.toml | 1 + crates/ui-egui/locales/zh-Hant.toml | 1 + 24 files changed, 39 insertions(+) diff --git a/crates/engine/src/cmd/component/variants.rs b/crates/engine/src/cmd/component/variants.rs index 53e00ca6d..cfba5accf 100644 --- a/crates/engine/src/cmd/component/variants.rs +++ b/crates/engine/src/cmd/component/variants.rs @@ -115,6 +115,9 @@ pub(super) fn create_set(s: &mut Session, p: &Value) -> Result { }) { return Err(EngineError::Disabled(cmd.into(), "select layers that aren't components, component sets or instances".into())); } + if roots(doc, &ids).len() != ids.len() { + return Err(EngineError::Disabled(cmd.into(), "a layer can't be in a set with one inside it".into())); + } let mut made = Vec::new(); for i in roots(doc, &ids) { let r = create(s, &json!({"ids": [i]}))?; diff --git a/crates/engine/src/components_behaviour_tests.rs b/crates/engine/src/components_behaviour_tests.rs index f65049de5..510fb2e74 100644 --- a/crates/engine/src/components_behaviour_tests.rs +++ b/crates/engine/src/components_behaviour_tests.rs @@ -1139,3 +1139,17 @@ fn create_set_refuses_instances_and_leaves_the_document_alone() { assert_eq!(undo_len(&s), before); assert!(matches!(s.doc().unwrap().node(frames[1]).unwrap().kind, NodeKind::Frame)); } + +#[test] +fn create_set_refuses_a_target_inside_another_target_and_leaves_the_document_alone() { + let mut s = Session::new(); + let frames = named_frames(&mut s, &["Outer", "Inner"], false); + s.execute("node.reparent", &json!({"ids": [frames[1]], "parent": frames[0]})).unwrap(); + let before = undo_len(&s); + let e = s.execute("component.createSet", &json!({"ids": [frames[0], frames[1]]})).unwrap_err(); + assert!(matches!(e, crate::EngineError::Disabled(..)), "{e:?}"); + assert_eq!(undo_len(&s), before); + let doc = s.doc().unwrap(); + assert!(matches!(doc.node(frames[0]).unwrap().kind, NodeKind::Frame)); + assert!(matches!(doc.node(frames[1]).unwrap().kind, NodeKind::Frame)); +} diff --git a/crates/ui-egui/locales/ar.toml b/crates/ui-egui/locales/ar.toml index da4474e79..cbbe8e07d 100644 --- a/crates/ui-egui/locales/ar.toml +++ b/crates/ui-egui/locales/ar.toml @@ -2009,6 +2009,7 @@ status = "draft — needs native review" "component.combineVariants" = "جمع كتنويعات" "component.create" = "إنشاء مكوّن" "component.createMultiple" = "إنشاء مكونات متعددة" +"component.createSet" = "إنشاء مجموعة مكونات" "component.deleteProperty" = "حذف خاصية المكوّن" "component.detach" = "فصل النسخة المثيلة" "component.editProperty" = "تحرير خاصية المكوّن" diff --git a/crates/ui-egui/locales/bs.toml b/crates/ui-egui/locales/bs.toml index 36d71664c..e39053f08 100644 --- a/crates/ui-egui/locales/bs.toml +++ b/crates/ui-egui/locales/bs.toml @@ -2038,6 +2038,7 @@ status = "draft — needs native review" "component.combineVariants" = "Kombinuj kao varijante" "component.create" = "Kreiraj komponentu" "component.createMultiple" = "Kreiraj više komponenti" +"component.createSet" = "Kreiraj skup komponenti" "component.deleteProperty" = "Izbriši svojstvo komponente" "component.detach" = "Odvoji instancu" "component.editProperty" = "Uredi svojstvo komponente" diff --git a/crates/ui-egui/locales/cs.toml b/crates/ui-egui/locales/cs.toml index d401654ac..de7f9cc89 100644 --- a/crates/ui-egui/locales/cs.toml +++ b/crates/ui-egui/locales/cs.toml @@ -1913,6 +1913,7 @@ status = "draft — needs native review" "component.combineVariants" = "Sloučit jako varianty" "component.create" = "Vytvořit komponentu" "component.createMultiple" = "Vytvořit více komponent" +"component.createSet" = "Vytvořit sadu komponent" "component.deleteProperty" = "Smazat vlastnost komponenty" "component.detach" = "Odpojit instanci" "component.editProperty" = "Upravit vlastnost komponenty" diff --git a/crates/ui-egui/locales/de.toml b/crates/ui-egui/locales/de.toml index 6fd1838d6..6256fc1e0 100644 --- a/crates/ui-egui/locales/de.toml +++ b/crates/ui-egui/locales/de.toml @@ -2079,6 +2079,7 @@ status = "draft — needs native review" "component.combineVariants" = "Als Varianten kombinieren" "component.create" = "Komponente erstellen" "component.createMultiple" = "Mehrere Komponenten erstellen" +"component.createSet" = "Komponentensatz erstellen" "component.deleteProperty" = "Komponenteneigenschaft löschen" "component.detach" = "Instanz lösen" "component.editProperty" = "Komponenteneigenschaft bearbeiten" diff --git a/crates/ui-egui/locales/es.toml b/crates/ui-egui/locales/es.toml index 2baa2b31e..6c2d171c3 100644 --- a/crates/ui-egui/locales/es.toml +++ b/crates/ui-egui/locales/es.toml @@ -2002,6 +2002,7 @@ status = "draft — needs native review" "component.combineVariants" = "Combinar como variantes" "component.create" = "Crear componente" "component.createMultiple" = "Crear varios componentes" +"component.createSet" = "Crear conjunto de componentes" "component.deleteProperty" = "Eliminar propiedad de componente" "component.detach" = "Separar instancia" "component.editProperty" = "Editar propiedad de componente" diff --git a/crates/ui-egui/locales/fi.toml b/crates/ui-egui/locales/fi.toml index 2f5db319a..a1b33417f 100644 --- a/crates/ui-egui/locales/fi.toml +++ b/crates/ui-egui/locales/fi.toml @@ -2086,6 +2086,7 @@ status = "draft — needs native review" "component.combineVariants" = "Yhdistä varianteiksi" "component.create" = "Luo komponentti" "component.createMultiple" = "Luo useita komponentteja" +"component.createSet" = "Luo komponenttijoukko" "component.deleteProperty" = "Poista komponentin ominaisuus" "component.detach" = "Irrota ilmentymä" "component.editProperty" = "Muokkaa komponentin ominaisuutta" diff --git a/crates/ui-egui/locales/fr.toml b/crates/ui-egui/locales/fr.toml index d47ad9597..e5feebc9b 100644 --- a/crates/ui-egui/locales/fr.toml +++ b/crates/ui-egui/locales/fr.toml @@ -1958,6 +1958,7 @@ status = "draft — needs native review" "component.combineVariants" = "Combiner en variantes" "component.create" = "Créer un composant" "component.createMultiple" = "Créer plusieurs composants" +"component.createSet" = "Créer un ensemble de composants" "component.deleteProperty" = "Supprimer la propriété de composant" "component.detach" = "Détacher l’instance" "component.editProperty" = "Modifier la propriété de composant" diff --git a/crates/ui-egui/locales/id.toml b/crates/ui-egui/locales/id.toml index cbebaf1c4..3bb5d027c 100644 --- a/crates/ui-egui/locales/id.toml +++ b/crates/ui-egui/locales/id.toml @@ -1917,6 +1917,7 @@ status = "draft — needs native review" "component.combineVariants" = "Gabungkan sebagai variant" "component.create" = "Buat component" "component.createMultiple" = "Buat beberapa component" +"component.createSet" = "Buat set component" "component.deleteProperty" = "Hapus properti component" "component.detach" = "Lepaskan instance" "component.editProperty" = "Edit properti component" diff --git a/crates/ui-egui/locales/it.toml b/crates/ui-egui/locales/it.toml index 364aeedf8..f6b6dfe0d 100644 --- a/crates/ui-egui/locales/it.toml +++ b/crates/ui-egui/locales/it.toml @@ -1861,6 +1861,7 @@ status = "draft — needs native review" "component.combineVariants" = "Combina come varianti" "component.create" = "Crea componente" "component.createMultiple" = "Crea più componenti" +"component.createSet" = "Crea set di componenti" "component.deleteProperty" = "Elimina proprietà del componente" "component.detach" = "Scollega istanza" "component.editProperty" = "Modifica proprietà del componente" diff --git a/crates/ui-egui/locales/ja.toml b/crates/ui-egui/locales/ja.toml index 5a8918a20..c53b03e25 100644 --- a/crates/ui-egui/locales/ja.toml +++ b/crates/ui-egui/locales/ja.toml @@ -1938,6 +1938,7 @@ status = "draft — needs native review" "component.combineVariants" = "バリアントとして結合" "component.create" = "コンポーネントを作成" "component.createMultiple" = "複数のコンポーネントを作成" +"component.createSet" = "コンポーネントセットを作成" "component.deleteProperty" = "コンポーネントプロパティを削除" "component.detach" = "インスタンスを切り離す" "component.editProperty" = "コンポーネントプロパティを編集" diff --git a/crates/ui-egui/locales/ka.toml b/crates/ui-egui/locales/ka.toml index 2af58f385..fa681b9fd 100644 --- a/crates/ui-egui/locales/ka.toml +++ b/crates/ui-egui/locales/ka.toml @@ -2013,6 +2013,7 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "component.combineVariants" = "ვარიანტებად გაერთიანება" "component.create" = "კომპონენტის შექმნა" "component.createMultiple" = "რამდენიმე კომპონენტის შექმნა" +"component.createSet" = "კომპონენტების ნაკრების შექმნა" "component.deleteProperty" = "კომპონენტის თვისების წაშლა" "component.detach" = "ინსტანსის გამოყოფა" "component.editProperty" = "კომპონენტის თვისების რედაქტირება" diff --git a/crates/ui-egui/locales/ko.toml b/crates/ui-egui/locales/ko.toml index ebea678d1..6b5a39b60 100644 --- a/crates/ui-egui/locales/ko.toml +++ b/crates/ui-egui/locales/ko.toml @@ -1978,6 +1978,7 @@ status = "draft — needs native review" "component.combineVariants" = "배리언트로 결합" "component.create" = "컴포넌트 만들기" "component.createMultiple" = "여러 컴포넌트 만들기" +"component.createSet" = "컴포넌트 세트 만들기" "component.deleteProperty" = "컴포넌트 속성 삭제" "component.detach" = "인스턴스 분리" "component.editProperty" = "컴포넌트 속성 편집" diff --git a/crates/ui-egui/locales/nl.toml b/crates/ui-egui/locales/nl.toml index e43d40b5e..a1d39c7fd 100644 --- a/crates/ui-egui/locales/nl.toml +++ b/crates/ui-egui/locales/nl.toml @@ -1956,6 +1956,7 @@ status = "draft — needs native review" "component.combineVariants" = "Combineren als varianten" "component.create" = "Component maken" "component.createMultiple" = "Meerdere componenten maken" +"component.createSet" = "Componentenset maken" "component.deleteProperty" = "Componenteigenschap verwijderen" "component.detach" = "Instance loskoppelen" "component.editProperty" = "Componenteigenschap bewerken" diff --git a/crates/ui-egui/locales/pl.toml b/crates/ui-egui/locales/pl.toml index 68fe136d7..c479cd1be 100644 --- a/crates/ui-egui/locales/pl.toml +++ b/crates/ui-egui/locales/pl.toml @@ -1969,6 +1969,7 @@ name = "Polski" "component.combineVariants" = "Połącz jako warianty" "component.create" = "Utwórz komponent" "component.createMultiple" = "Utwórz wiele komponentów" +"component.createSet" = "Utwórz zestaw komponentów" "component.deleteProperty" = "Usuń właściwość komponentu" "component.detach" = "Odłącz instancję" "component.editProperty" = "Edytuj właściwość komponentu" diff --git a/crates/ui-egui/locales/pt-BR.toml b/crates/ui-egui/locales/pt-BR.toml index c2ccba835..efcde47fe 100644 --- a/crates/ui-egui/locales/pt-BR.toml +++ b/crates/ui-egui/locales/pt-BR.toml @@ -1975,6 +1975,7 @@ status = "draft — needs native review" "component.combineVariants" = "Combinar como variantes" "component.create" = "Criar componente" "component.createMultiple" = "Criar vários componentes" +"component.createSet" = "Criar conjunto de componentes" "component.deleteProperty" = "Excluir propriedade de componente" "component.detach" = "Desvincular instância" "component.editProperty" = "Editar propriedade de componente" diff --git a/crates/ui-egui/locales/ru.toml b/crates/ui-egui/locales/ru.toml index 01e1d86ac..97980eaed 100644 --- a/crates/ui-egui/locales/ru.toml +++ b/crates/ui-egui/locales/ru.toml @@ -1969,6 +1969,7 @@ name = "Русский" "component.combineVariants" = "Объединить в варианты" "component.create" = "Создать компонент" "component.createMultiple" = "Создать несколько компонентов" +"component.createSet" = "Создать набор компонентов" "component.deleteProperty" = "Удалить свойство компонента" "component.detach" = "Отсоединить экземпляр" "component.editProperty" = "Изменить свойство компонента" diff --git a/crates/ui-egui/locales/sv.toml b/crates/ui-egui/locales/sv.toml index a94feb2a9..0a97701f8 100644 --- a/crates/ui-egui/locales/sv.toml +++ b/crates/ui-egui/locales/sv.toml @@ -2076,6 +2076,7 @@ name = "Svenska" "component.combineVariants" = "Kombinera som varianter" "component.create" = "Skapa komponent" "component.createMultiple" = "Skapa flera komponenter" +"component.createSet" = "Skapa komponentuppsättning" "component.deleteProperty" = "Radera komponentegenskap" "component.detach" = "Koppla bort instans" "component.editProperty" = "Redigera komponentegenskap" diff --git a/crates/ui-egui/locales/th.toml b/crates/ui-egui/locales/th.toml index 81b581ce0..d5e98915f 100644 --- a/crates/ui-egui/locales/th.toml +++ b/crates/ui-egui/locales/th.toml @@ -1934,6 +1934,7 @@ status = "draft — needs native review" "component.combineVariants" = "รวมเป็นแวเรียนต์" "component.create" = "สร้างคอมโพเนนต์" "component.createMultiple" = "สร้างหลายคอมโพเนนต์" +"component.createSet" = "สร้างชุดคอมโพเนนต์" "component.deleteProperty" = "ลบพร็อพเพอร์ตีของคอมโพเนนต์" "component.detach" = "ถอดอินสแตนซ์" "component.editProperty" = "แก้ไขพร็อพเพอร์ตีของคอมโพเนนต์" diff --git a/crates/ui-egui/locales/tr.toml b/crates/ui-egui/locales/tr.toml index b07d25462..25bf777ce 100644 --- a/crates/ui-egui/locales/tr.toml +++ b/crates/ui-egui/locales/tr.toml @@ -1917,6 +1917,7 @@ name = "Türkçe" "component.combineVariants" = "Varyant olarak birleştir" "component.create" = "Bileşen oluştur" "component.createMultiple" = "Birden çok bileşen oluştur" +"component.createSet" = "Bileşen kümesi oluştur" "component.deleteProperty" = "Bileşen özelliğini sil" "component.detach" = "Örneği ayır" "component.editProperty" = "Bileşen özelliğini düzenle" diff --git a/crates/ui-egui/locales/vi.toml b/crates/ui-egui/locales/vi.toml index 9a4d600fe..98420ba48 100644 --- a/crates/ui-egui/locales/vi.toml +++ b/crates/ui-egui/locales/vi.toml @@ -1862,6 +1862,7 @@ status = "draft — needs native review" "component.combineVariants" = "Kết hợp thành các biến thể" "component.create" = "Tạo thành phần" "component.createMultiple" = "Tạo nhiều thành phần" +"component.createSet" = "Tạo bộ thành phần" "component.deleteProperty" = "Xóa thuộc tính thành phần" "component.detach" = "Tách bản thể" "component.editProperty" = "Chỉnh sửa thuộc tính thành phần" diff --git a/crates/ui-egui/locales/zh-Hans.toml b/crates/ui-egui/locales/zh-Hans.toml index b48345acc..7d6bfb0b7 100644 --- a/crates/ui-egui/locales/zh-Hans.toml +++ b/crates/ui-egui/locales/zh-Hans.toml @@ -1871,6 +1871,7 @@ status = "draft — needs native review" "component.combineVariants" = "合并为变体" "component.create" = "创建组件" "component.createMultiple" = "创建多个组件" +"component.createSet" = "创建组件集" "component.deleteProperty" = "删除组件属性" "component.detach" = "分离实例" "component.editProperty" = "编辑组件属性" diff --git a/crates/ui-egui/locales/zh-Hant.toml b/crates/ui-egui/locales/zh-Hant.toml index f14698b00..59b9064de 100644 --- a/crates/ui-egui/locales/zh-Hant.toml +++ b/crates/ui-egui/locales/zh-Hant.toml @@ -2089,6 +2089,7 @@ status = "draft — needs native review" "component.combineVariants" = "合併為變體" "component.create" = "建立元件" "component.createMultiple" = "建立多個元件" +"component.createSet" = "建立元件集" "component.deleteProperty" = "刪除元件屬性" "component.detach" = "分離實例" "component.editProperty" = "編輯元件屬性" From 0fec344f3cc1cc439808aed4781390f9ca76123c Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Sat, 7 Nov 2026 23:38:58 -0500 Subject: [PATCH 017/101] M8: copy, cut and paste in vector edit mode act on the selected points and segments (#1875) Measured in Figma: in vector edit mode Copy takes only the selected segments (a lone point, the segments touching it) and a paste outside makes a new vector in place; Cut removes them, splitting the path in the same layer and staying in edit mode; Paste while editing adds the clipboard's segments or a copied layer's outline to the vector's network in place, selecting them. FigCraft copied the whole layer, Cut left nothing to paste, and Paste while editing did nothing. 16 new engine and UI tests cover copy, cut, paste, undo and junk parameters; the whole engine suite passes bar the known font test. Co-Authored-By: Claude Sonnet 5.5 Model-Effort: Opus 5.5 drove; Opus 5.5 briefed; Sonnet 5.5 wrote at high --- crates/engine/src/canvas/vectoredit.rs | 2 +- crates/engine/src/cmd/edit.rs | 21 +- crates/engine/src/cmd/edit/clipboard.rs | 62 +++- .../engine/src/cmd/edit/vector_clipboard.rs | 274 +++++++++++++++ .../src/cmd/edit/vector_clipboard_tests.rs | 324 ++++++++++++++++++ crates/ui-egui/src/menus.rs | 10 +- crates/ui-egui/src/shortcuts.rs | 13 +- crates/ui-egui/src/vector_keys_tests.rs | 12 + docs/ui-parity.md | 5 +- 9 files changed, 701 insertions(+), 22 deletions(-) create mode 100644 crates/engine/src/cmd/edit/vector_clipboard.rs create mode 100644 crates/engine/src/cmd/edit/vector_clipboard_tests.rs diff --git a/crates/engine/src/canvas/vectoredit.rs b/crates/engine/src/canvas/vectoredit.rs index 4f265e0f5..749e246c0 100644 --- a/crates/engine/src/canvas/vectoredit.rs +++ b/crates/engine/src/canvas/vectoredit.rs @@ -638,7 +638,7 @@ fn index(cmd: &str, p: &Value, key: &str) -> Result { } /// Delete the points and segments of `parts` (`heal` keeps paths through deleted points closed). -fn delete_selection(s: &mut Session, parts: Vec, heal: bool) -> Result<()> { +pub(crate) fn delete_selection(s: &mut Session, parts: Vec, heal: bool) -> Result<()> { let doc = s.doc_mut()?; for EditPart { id, vertices: verts, segments: segs } in parts { edit(doc, id, |net| { diff --git a/crates/engine/src/cmd/edit.rs b/crates/engine/src/cmd/edit.rs index efcb0fc52..19a7d7011 100644 --- a/crates/engine/src/cmd/edit.rs +++ b/crates/engine/src/cmd/edit.rs @@ -17,6 +17,9 @@ mod clipboard; mod props; pub(crate) use props::{edit_region_fills, fill_regions}; mod select; +mod vector_clipboard; +#[cfg(test)] +mod vector_clipboard_tests; pub(crate) use clipboard::apply_copied_props; pub use clipboard::{CLIP_CLOSE, CLIP_OPEN, copy_to_clipboard, design_clipboard_buffer, paste_into}; @@ -117,12 +120,24 @@ pub fn specs() -> Vec { true, duplicate ), - spec!("edit.copy", "Copy", "{ids?}", false, copy), - spec!("edit.cut", "Cut", "{ids?}", true, cut), + spec!( + "edit.copy", + "Copy", + "{ids?} in vector edit mode with points or segments selected (and no ids): just those, the segments touching a selected point, as a new vector with the edited layer's look", + false, + copy + ), + spec!( + "edit.cut", + "Cut", + "{ids?} in vector edit mode with points or segments selected (and no ids): copies them as Copy does, then removes them as Delete does; the path splits in the same layer and edit mode stays on", + true, + cut + ), spec!( "edit.paste", "Paste", - "{parent?, x?, y? (page coordinates of the pasted top-left)} a copied main component pastes as an instance of it within its file (cut ones, and pastes into other files, keep the component)", + "{parent?, x?, y? (page coordinates of the pasted top-left)} in vector edit mode (and no parent): the copied vectors' segments and shapes' outlines join the edited vector's network in place, selected, and the layers that have no outline (text, frames, groups) are skipped (`skipped`); a copied main component pastes as an instance of it within its file (cut ones, and pastes into other files, keep the component)", true, paste ), diff --git a/crates/engine/src/cmd/edit/clipboard.rs b/crates/engine/src/cmd/edit/clipboard.rs index 150a3b577..da5089419 100644 --- a/crates/engine/src/cmd/edit/clipboard.rs +++ b/crates/engine/src/cmd/edit/clipboard.rs @@ -1,6 +1,6 @@ use super::{ - Affine, BTreeMap, BTreeSet, Document, EngineError, ImageData, Node, NodeId, NodeKind, Result, Session, Value, bad, delete, id, json, num, ok, - req_targets, roots, string, targets, z_sorted, + Affine, BTreeMap, BTreeSet, Document, EngineError, ImageData, Node, NodeId, NodeKind, Result, Session, Value, bad, delete, get, id, json, num, + ok, req_targets, roots, string, targets, vector_clipboard, z_sorted, }; /// The copied form of the selection. @@ -12,6 +12,18 @@ pub fn copy_to_clipboard(s: &mut Session, cmd: &str, ids: &[NodeId]) -> Result<( return Err(EngineError::Disabled(cmd.into(), "pages can't be copied; use page.duplicate".into())); } let (nodes, images, bounds) = copied(&ds.doc, &layers); + store_clipboard(s, cmd, nodes, images, bounds) +} + +/// Make `nodes` (the copied layers, each root's transform in page space) the clipboard's layers. +pub(super) fn store_clipboard( + s: &mut Session, + cmd: &str, + nodes: Vec<(NodeId, Vec)>, + images: BTreeMap, + bounds: Option, +) -> Result<()> { + let ds = s.ds()?; let (source, source_path, uid) = (ds.doc.clone(), ds.path.clone(), ds.uid); s.clipboard.source = Some(source); s.clipboard.source_path = source_path; @@ -43,21 +55,26 @@ fn copied(doc: &Document, ids: &[NodeId]) -> Copied { if let Some(r) = sub.first_mut() { r.transform = world; } - for n in &sub { - for p in n.fills.iter().chain(n.strokes.iter()) { - if let figcraft_color::PaintKind::Image(img) = &p.kind - && let Some(d) = doc.images.get(&img.image) - { - images.insert(img.image.clone(), d.clone()); - } - } - } + collect_images(doc, &sub, &mut images); nodes.push((*i, sub)); } let bounds = doc.bounds_of(&ids); (nodes, images, bounds) } +/// The images the paints of `nodes` use, taken from `doc` into `images`. +pub(super) fn collect_images(doc: &Document, nodes: &[Node], images: &mut BTreeMap) { + for n in nodes { + for p in n.fills.iter().chain(n.strokes.iter()) { + if let figcraft_color::PaintKind::Image(img) = &p.kind + && let Some(d) = doc.images.get(&img.image) + { + images.insert(img.image.clone(), d.clone()); + } + } + } +} + /// The markers around the copied layers in the clipboard's HTML, spelt as that format spells them. pub const CLIP_OPEN: &str = "(figma)"; @@ -167,13 +184,32 @@ fn layers_missing_images(doc: &figcraft_doc::Document, ids: &[NodeId]) -> Vec bool { + get(p, "ids").is_some() || get(p, "id").is_some() +} + pub(super) fn copy(s: &mut Session, p: &Value) -> Result { + // In vector edit mode with points or segments selected, Copy takes just those (#1875). + if !names_layers(p) + && let Some(sel) = vector_clipboard::edit_selection(s) + && !sel.parts.is_empty() + { + return vector_clipboard::copy_selection(s, "edit.copy", sel); + } let ids = req_targets("edit.copy", s, p)?; copy_to_clipboard(s, "edit.copy", &ids)?; Ok(json!({"copied": s.clipboard.nodes.len()})) } pub(super) fn cut(s: &mut Session, p: &Value) -> Result { + // In vector edit mode with points or segments selected, Cut takes just those and stays in edit mode (#1875). + if !names_layers(p) + && let Some(sel) = vector_clipboard::edit_selection(s) + && sel.any + { + return vector_clipboard::cut_selection(s, sel); + } let ids = req_targets("edit.cut", s, p)?; copy_to_clipboard(s, "edit.cut", &ids)?; let doc = s.doc()?; @@ -238,6 +274,10 @@ pub fn paste_into(s: &mut Session, parent: NodeId, at: Option<(f64, f64)>) -> Re } pub(super) fn paste(s: &mut Session, p: &Value) -> Result { + // While editing a vector, the copied layers join its network (#1875); `parent` asks for layers. + if id(p, "parent").is_none() && s.ds()?.vector_edit.is_some() { + return vector_clipboard::paste_into_vector(s, p); + } let page = s.page()?; // Figma pastes into the selected frame (if one is selected), at the same position when it fits, // else in the frame's centre; otherwise in place on the page (or the viewport centre). diff --git a/crates/engine/src/cmd/edit/vector_clipboard.rs b/crates/engine/src/cmd/edit/vector_clipboard.rs new file mode 100644 index 000000000..d9efea269 --- /dev/null +++ b/crates/engine/src/cmd/edit/vector_clipboard.rs @@ -0,0 +1,274 @@ +//! Copy, cut and paste in vector edit mode (#1875). +//! +//! With points or segments selected, Copy and Cut take just those: a temporary vector holding the +//! selected segments (and the segments touching a selected point) goes on the ordinary layer +//! clipboard, kept at its place on the page, so a paste outside edit mode is a plain layer paste +//! in place. Cut then removes the selection the way Delete does and stays in edit mode. Paste +//! while editing adds the clipboard's layers to the edited vector's network, in place: a vector +//! with its segments, a shape or boolean with its outline. + +use figcraft_doc::{NodeKind, Region, VectorNetwork}; + +use super::clipboard::{collect_images, store_clipboard}; +use super::{Affine, BTreeMap, BTreeSet, Document, EngineError, Node, NodeId, Result, Session, Value, json, num}; +use crate::canvas::vectoredit::{self, EditPart}; + +/// The most segments a vector network takes through a paste. +const MAX_SEGMENTS: usize = 500_000; + +/// What the edited layers have selected. +pub(super) struct EditSelection { + /// Whether any edited layer has a point or a segment selected. + pub any: bool, + /// Each edited layer with something to copy, and the sub-network that is. + pub parts: Vec<(NodeId, VectorNetwork)>, +} + +/// The selection of the vector being edited (and the other layers edited with it), or `None` when +/// not in vector edit mode. +pub(super) fn edit_selection(s: &Session) -> Option { + let ds = s.ds().ok()?; + let ve = ds.vector_edit.as_ref()?; + let mut sel = EditSelection { any: false, parts: Vec::new() }; + for part in ve.parts() { + if part.vertices.is_empty() && part.segments.is_empty() { + continue; + } + sel.any = true; + let Some(net) = vectoredit::network(&ds.doc, part.id) else { continue }; + let active = part.id == ve.id; + // Points selected only through a selected region don't pull in the segments touching + // them: the region's own segments are the selection. + let vertices: Vec = part.vertices.iter().copied().filter(|v| !active || !ve.region_vertices.contains(v)).collect(); + let mut segments = part.segments.clone(); + if active { + segments.extend(ve.regions.iter().filter_map(|r| net.regions.get(*r)).flat_map(|r| r.loops.iter().flatten().copied())); + } + if let Some(sub) = sub_network(net, &vertices, &segments) { + sel.parts.push((part.id, sub)); + } + } + Some(sel) +} + +/// The part of `net` that is the segments `segments` and those touching a point of `vertices`, +/// with the points they join; `None` when there are none (a lone point with no segment draws +/// nothing). The regions whose every segment is kept stay regions. +fn sub_network(net: &VectorNetwork, vertices: &[usize], segments: &[usize]) -> Option { + let picked: BTreeSet = vertices.iter().copied().collect(); + let mut keep: BTreeSet = segments.iter().copied().filter(|i| *i < net.segments.len()).collect(); + for (i, sg) in net.segments.iter().enumerate() { + if picked.contains(&sg.a) || picked.contains(&sg.b) { + keep.insert(i); + } + } + let used: BTreeSet = keep.iter().filter_map(|i| net.segments.get(*i)).flat_map(|sg| [sg.a, sg.b]).collect(); + let vmap: BTreeMap = used.iter().enumerate().map(|(new, old)| (*old, new)).collect(); + let smap: BTreeMap = keep.iter().enumerate().map(|(new, old)| (*old, new)).collect(); + let mut out = VectorNetwork { + vertices: used.iter().filter_map(|v| net.vertices.get(*v).cloned()).collect(), + segments: keep + .iter() + .filter_map(|i| net.segments.get(*i)) + .filter_map(|sg| { + let mut sg = *sg; + sg.a = *vmap.get(&sg.a)?; + sg.b = *vmap.get(&sg.b)?; + Some(sg) + }) + .collect(), + regions: Vec::new(), + }; + if out.segments.is_empty() || out.segments.len() != keep.len() || out.vertices.len() != used.len() { + return None; + } + for r in &net.regions { + let loops: Option>> = r.loops.iter().map(|l| l.iter().map(|i| smap.get(i).copied()).collect::>>()).collect(); + if let Some(loops) = loops.filter(|l| !l.is_empty()) { + out.regions.push(Region { loops, ..r.clone() }); + } + } + Some(out) +} + +/// The clipboard's layer for edited vector `id` holding `sub`: it keeps the layer's look (fills, +/// strokes, effects, opacity, blend) and its place on the page. A variable width profile runs +/// along the whole path, so it stays only when every segment is copied. +fn clip_node(doc: &Document, id: NodeId, mut sub: VectorNetwork) -> Option { + let mut n = doc.node(id)?.clone(); + let whole = vectoredit::network(doc, id).is_some_and(|all| all.segments.len() == sub.segments.len()); + let b = sub.bounds().filter(|b| b.x0.is_finite() && b.y0.is_finite() && b.width().is_finite() && b.height().is_finite())?; + sub.translate(-b.x0, -b.y0); + n.transform = doc.world_transform(id) * Affine::translate((b.x0, b.y0)); + n.width = b.width(); + n.height = b.height(); + n.kind = NodeKind::Vector { network: sub }; + n.parent = None; + n.children.clear(); + n.name = "Vector".into(); + if !whole { + n.stroke.width_profile = None; + } + Some(n) +} + +/// Put the selection's sub-networks on the layer clipboard. Returns how many segments went. +fn copy_parts(s: &mut Session, cmd: &str, sel: &EditSelection) -> Result { + let doc = s.doc()?; + let mut nodes = Vec::new(); + let mut images = BTreeMap::new(); + let mut bounds: Option = None; + let mut segments = 0; + for (id, sub) in &sel.parts { + segments += sub.segments.len(); + let Some(n) = clip_node(doc, *id, sub.clone()) else { continue }; + let r = figcraft_geom::transform_rect_bbox(n.transform, n.local_rect()); + bounds = Some(bounds.map_or(r, |b| b.union(r))); + collect_images(doc, std::slice::from_ref(&n), &mut images); + nodes.push((*id, vec![n])); + } + if nodes.is_empty() { + return Err(EngineError::Disabled(cmd.into(), "the selection has nothing to copy".into())); + } + store_clipboard(s, cmd, nodes, images, bounds)?; + Ok(segments) +} + +/// Copy the selected segments (see [`edit_selection`]). +pub(super) fn copy_selection(s: &mut Session, cmd: &str, sel: EditSelection) -> Result { + let segments = copy_parts(s, cmd, &sel)?; + Ok(json!({"copied": s.clipboard.nodes.len(), "segments": segments})) +} + +/// Cut: copy the selected segments, then remove the selection as Delete does (the path splits in +/// the same layer and edit mode stays on). A selection that has no segment to copy (lone points +/// with nothing attached) is removed and the clipboard is left as it was. +pub(super) fn cut_selection(s: &mut Session, sel: EditSelection) -> Result { + let segments = if sel.parts.is_empty() { 0 } else { copy_parts(s, "edit.cut", &sel)? }; + let parts: Vec = vectoredit::editing(s)?.parts(); + vectoredit::delete_selection(s, parts, false)?; + Ok(json!({"cut": sel.parts.len(), "segments": segments})) +} + +/// The network of the outline of copied layer `n` in its own coordinates: a vector's segments, a +/// shape's or boolean's outline. `None` for the layers with no outline to add (text, images, +/// frames, groups, instances, …). `doc` is the file the layer was copied from. +fn outline_network(doc: &Document, n: &Node) -> Option { + let net = match &n.kind { + NodeKind::Vector { network } => network.clone(), + k if k.is_shape() || matches!(k, NodeKind::BooleanOp { .. }) => { + let (path, rule) = figcraft_render::node_outline(doc, n)?; + let mut net = VectorNetwork::from_path(&path); + if matches!(n.kind, NodeKind::Line) { + net.regions.clear(); + } + if rule == figcraft_render::FillRule::EvenOdd { + for r in &mut net.regions { + r.winding = figcraft_doc::WindingRule::EvenOdd; + } + } + net + } + _ => return None, + }; + (!net.segments.is_empty()).then_some(net) +} + +/// `net` moved by `m` (points, handles, the regions' paint frames and the points' radii). +fn placed(mut net: VectorNetwork, m: Affine) -> Option { + let c = m.as_coeffs(); + if !c.iter().all(|x| x.is_finite()) { + return None; + } + let linear = Affine::new([c[0], c[1], c[2], c[3], 0.0, 0.0]); + let scale = m.determinant().abs().sqrt(); + for v in &mut net.vertices { + let p = m * v.point(); + (v.x, v.y) = (p.x, p.y); + v.radius *= scale; + } + for sg in &mut net.segments { + let (ta, tb) = (linear * figcraft_geom::Point::new(sg.ta.0, sg.ta.1), linear * figcraft_geom::Point::new(sg.tb.0, sg.tb.1)); + sg.ta = (ta.x, ta.y); + sg.tb = (tb.x, tb.y); + } + for r in &mut net.regions { + if let Some(frame) = r.paint_space.as_mut() { + frame.transform = m * frame.transform; + } + } + let finite = net.vertices.iter().all(|v| v.x.is_finite() && v.y.is_finite()) + && net.segments.iter().all(|sg| [sg.ta.0, sg.ta.1, sg.tb.0, sg.tb.1].iter().all(|x| x.is_finite())); + finite.then_some(net) +} + +/// Paste while editing a vector: the clipboard's layers join its network in place (with `x`, `y`: +/// the copied top-left moved there), their points selected. Layers with no outline are skipped +/// (named in `skipped`); when none has one, nothing is pasted. +pub(super) fn paste_into_vector(s: &mut Session, p: &Value) -> Result { + const CMD: &str = "edit.paste"; + let clip = s.clipboard.clone(); + if clip.nodes.is_empty() { + return Err(EngineError::Disabled(CMD.into(), "the clipboard is empty".into())); + } + let target = vectoredit::editing(s)?.id; + let shift = match (num(p, "x"), num(p, "y"), clip.bounds) { + (Some(x), Some(y), Some(b)) => Affine::translate((x - b.x0, y - b.y0)), + _ => Affine::IDENTITY, + }; + let live = s.doc()?; + let source: &Document = clip.source.as_deref().unwrap_or(live); + let to_local = live.world_transform(target).inverse() * shift; + let mut pieces = Vec::new(); + let mut skipped: Vec = Vec::new(); + for (_, nodes) in &clip.nodes { + let Some(root) = nodes.first() else { continue }; + match outline_network(source, root).and_then(|net| placed(net, to_local * root.transform)) { + Some(net) => pieces.push(net), + None => skipped.push(root.name.clone()), + } + } + if pieces.is_empty() { + return Err(EngineError::Disabled( + CMD.into(), + "none of the copied layers has an outline to add to the vector (text, frames and groups have none)".into(), + )); + } + let have = vectoredit::network(live, target).map_or(0, |n| n.segments.len()); + if have.saturating_add(pieces.iter().map(|n| n.segments.len()).sum::()) > MAX_SEGMENTS { + return Err(EngineError::Disabled(CMD.into(), format!("a vector takes at most {MAX_SEGMENTS} segments"))); + } + let mut pasted: Vec = Vec::new(); + vectoredit::edit(s.doc_mut()?, target, |net| { + for piece in pieces { + let (vo, so) = (net.vertices.len(), net.segments.len()); + pasted.extend(vo..vo + piece.vertices.len()); + net.vertices.extend(piece.vertices); + net.segments.extend(piece.segments.into_iter().map(|mut sg| { + sg.a += vo; + sg.b += vo; + sg + })); + net.regions.extend(piece.regions.into_iter().map(|mut r| { + for i in r.loops.iter_mut().flatten() { + *i += so; + } + r + })); + } + })?; + let selected = pasted.clone(); + vectoredit::set_state(s, |ve| { + ve.clear_selection(); + ve.clear_regions(); + ve.vertices = selected; + ve.anchor = None; + ve.pen_out = None; + ve.width_point = None; + })?; + let mut out = json!({"ids": [], "edited": target, "vertices": pasted.len()}); + if !skipped.is_empty() { + out["skipped"] = json!(skipped); + } + Ok(out) +} diff --git a/crates/engine/src/cmd/edit/vector_clipboard_tests.rs b/crates/engine/src/cmd/edit/vector_clipboard_tests.rs new file mode 100644 index 000000000..012a110fe --- /dev/null +++ b/crates/engine/src/cmd/edit/vector_clipboard_tests.rs @@ -0,0 +1,324 @@ +//! Copy, cut and paste in vector edit mode (#1875), measured in Figma: Copy takes the selected +//! segments (a lone point: the segments touching it) and a paste outside is a new vector in place; +//! Cut removes them, splitting the path in the same layer; Paste while editing adds the clipboard's +//! segments or a copied layer's outline to the vector's network in place, selected. + +use serde_json::{Value, json}; + +use crate::{EngineError, Session, params}; +use figcraft_doc::{NodeId, NodeKind, VectorNetwork}; + +fn ex(s: &mut Session, c: &str, p: Value) -> Value { + s.execute(c, &p).unwrap_or_else(|e| panic!("{c}: {e}")) +} + +fn id_of(v: &Value) -> NodeId { + params::id_of(&v["id"]).unwrap() +} + +/// Open path A-B-C-D (three segments) with a look of its own, in edit mode. +fn path(s: &mut Session) -> NodeId { + let r = ex(s, "vector.create", json!({"points": [[100, 100], [200, 150], [300, 100], [400, 200]], "closed": false})); + let id = id_of(&r); + ex(s, "node.set", json!({"id": id, "props": {"strokeWeight": 7, "opacity": 0.5}})); + ex(s, "vector.edit.begin", json!({"id": id})); + id +} + +fn net(s: &Session, id: NodeId) -> VectorNetwork { + crate::vectoredit::network(s.doc().unwrap(), id).unwrap().clone() +} + +fn layers(s: &Session) -> Vec { + s.doc().unwrap().node(s.page().unwrap()).unwrap().children.clone() +} + +/// The network's points on the page, rounded, in vertex order. +fn page_points(s: &Session, id: NodeId) -> Vec<(i64, i64)> { + let w = s.doc().unwrap().world_transform(id); + net(s, id).vertices.iter().map(|v| w * v.point()).map(|p| (p.x.round() as i64, p.y.round() as i64)).collect() +} + +/// The number of separate paths a network is made of. +fn subpaths(n: &VectorNetwork) -> usize { + let mut group: Vec = (0..n.vertices.len()).collect(); + fn root(g: &[usize], mut i: usize) -> usize { + while g[i] != i { + i = g[i]; + } + i + } + for sg in &n.segments { + let (a, b) = (root(&group, sg.a), root(&group, sg.b)); + group[a] = b; + } + (0..n.vertices.len()).filter(|i| root(&group, *i) == *i && n.segments.iter().any(|sg| root(&group, sg.a) == *i)).count() +} + +fn select(s: &mut Session, vertices: &[usize], segments: &[usize]) { + ex(s, "vector.edit.select", json!({"vertices": vertices, "segments": segments})); +} + +fn leave(s: &mut Session) { + ex(s, "vector.edit.end", json!({})); + assert!(s.ds().unwrap().vector_edit.is_none()); +} + +fn world_rect(s: &Session, id: NodeId) -> (f64, f64, f64, f64) { + let b = s.doc().unwrap().world_bounds(id).unwrap(); + (b.x0, b.y0, b.width(), b.height()) +} + +#[test] +fn a_copied_segment_pastes_outside_as_a_new_vector_in_place() { + let mut s = Session::new(); + let id = path(&mut s); + select(&mut s, &[], &[1]); + let r = ex(&mut s, "edit.copy", json!({})); + assert_eq!(r["segments"], 1); + assert_eq!(net(&s, id).segments.len(), 3, "Copy changes nothing"); + leave(&mut s); + ex(&mut s, "edit.paste", json!({})); + let all = layers(&s); + assert_eq!(all.len(), 2); + let new = all[1]; + let n = net(&s, new); + assert_eq!((n.vertices.len(), n.segments.len()), (2, 1)); + assert_eq!(page_points(&s, new), vec![(200, 150), (300, 100)], "at the segment's own page position"); + assert_eq!(world_rect(&s, new), (200.0, 100.0, 100.0, 50.0)); + // The layer's look comes along (the width profile aside). + let node = s.doc().unwrap().node(new).unwrap(); + assert_eq!((node.stroke.weight, node.opacity), (7.0, 0.5)); + assert_eq!(s.selection(), vec![new]); +} + +#[test] +fn a_copied_point_takes_the_segments_touching_it() { + let mut s = Session::new(); + path(&mut s); + select(&mut s, &[1], &[]); + ex(&mut s, "edit.copy", json!({})); + leave(&mut s); + ex(&mut s, "edit.paste", json!({})); + let new = *layers(&s).last().unwrap(); + let n = net(&s, new); + assert_eq!((n.vertices.len(), n.segments.len()), (3, 2), "A-B and B-C"); + assert_eq!(page_points(&s, new), vec![(100, 100), (200, 150), (300, 100)]); +} + +#[test] +fn nothing_selected_still_copies_the_whole_layer() { + let mut s = Session::new(); + path(&mut s); + ex(&mut s, "edit.copy", json!({})); + leave(&mut s); + ex(&mut s, "edit.paste", json!({})); + let new = *layers(&s).last().unwrap(); + assert_eq!(net(&s, new).segments.len(), 3); +} + +#[test] +fn cut_removes_the_segment_in_the_same_layer_and_stays_in_edit_mode() { + let mut s = Session::new(); + let id = path(&mut s); + select(&mut s, &[], &[1]); + ex(&mut s, "edit.cut", json!({})); + assert_eq!(layers(&s), vec![id], "no new layer"); + let n = net(&s, id); + assert_eq!(n.segments.len(), 2); + assert_eq!(subpaths(&n), 2, "the path split in two"); + let ve = s.ds().unwrap().vector_edit.clone().expect("edit mode stays on"); + assert!(ve.segments.is_empty() && ve.vertices.is_empty()); + leave(&mut s); + ex(&mut s, "edit.paste", json!({})); + let all = layers(&s); + assert_eq!(all.len(), 2); + let new = all[1]; + assert_eq!(net(&s, new).segments.len(), 1); + assert_eq!(page_points(&s, new), vec![(200, 150), (300, 100)]); +} + +#[test] +fn cut_is_one_undo_step() { + let mut s = Session::new(); + let id = path(&mut s); + select(&mut s, &[], &[1]); + ex(&mut s, "edit.cut", json!({})); + assert_eq!(net(&s, id).segments.len(), 2); + s.undo().unwrap(); + assert_eq!(net(&s, id).segments.len(), 3); + assert_eq!(page_points(&s, id), vec![(100, 100), (200, 150), (300, 100), (400, 200)]); +} + +#[test] +fn a_cut_point_takes_its_segments_with_it() { + let mut s = Session::new(); + let id = path(&mut s); + select(&mut s, &[1], &[]); + ex(&mut s, "edit.cut", json!({})); + assert_eq!(net(&s, id).segments.len(), 1, "only C-D is left"); + leave(&mut s); + ex(&mut s, "edit.paste", json!({})); + let new = *layers(&s).last().unwrap(); + assert_eq!(net(&s, new).segments.len(), 2, "A-B and B-C"); +} + +#[test] +fn pasting_segments_while_editing_adds_them_to_the_same_network_in_place() { + let mut s = Session::new(); + let id = path(&mut s); + select(&mut s, &[], &[1]); + ex(&mut s, "edit.copy", json!({})); + let r = ex(&mut s, "edit.paste", json!({})); + assert_eq!(r["vertices"], 2); + assert_eq!(layers(&s), vec![id], "no new layer"); + let n = net(&s, id); + assert_eq!((n.vertices.len(), n.segments.len()), (6, 4)); + assert_eq!(page_points(&s, id)[4..], [(200, 150), (300, 100)], "on top of the original"); + let ve = s.ds().unwrap().vector_edit.clone().unwrap(); + assert_eq!(ve.vertices, vec![4, 5], "the pasted points are selected"); + assert!(ve.segments.is_empty()); + // One undo reverts it. + s.undo().unwrap(); + assert_eq!(net(&s, id).segments.len(), 3); + assert_eq!(net(&s, id).vertices.len(), 4); +} + +#[test] +fn pasting_at_a_point_moves_the_copied_top_left_there() { + let mut s = Session::new(); + let id = path(&mut s); + select(&mut s, &[], &[1]); + ex(&mut s, "edit.copy", json!({})); + ex(&mut s, "edit.paste", json!({"x": 0, "y": 0})); + assert_eq!(page_points(&s, id)[4..], [(0, 50), (100, 0)]); +} + +#[test] +fn pasting_a_rectangle_while_editing_adds_its_outline_in_the_vectors_coordinates() { + let mut s = Session::new(); + let rect = id_of(&ex(&mut s, "shape.rectangle", json!({"x": 500, "y": 300, "width": 60, "height": 40}))); + ex(&mut s, "select.set", json!({"ids": [rect]})); + ex(&mut s, "edit.copy", json!({})); + let id = path(&mut s); + let before = world_rect(&s, id); + ex(&mut s, "edit.paste", json!({})); + assert_eq!(layers(&s), vec![rect, id], "no new layer"); + let n = net(&s, id); + assert_eq!((n.vertices.len(), n.segments.len()), (8, 7), "four corners, four sides, joined to the path"); + let mut corners: Vec<(i64, i64)> = page_points(&s, id)[4..].to_vec(); + corners.sort_unstable(); + assert_eq!(corners, vec![(500, 300), (500, 340), (560, 300), (560, 340)]); + let ve = s.ds().unwrap().vector_edit.clone().unwrap(); + assert_eq!(ve.vertices, vec![4, 5, 6, 7]); + let after = world_rect(&s, id); + assert!(after.2 > before.2 && after.3 > before.3, "the vector's bounds grow: {before:?} to {after:?}"); + assert_eq!((after.0, after.1), (before.0, before.1)); + assert_eq!(after.0 + after.2, 560.0); + s.undo().unwrap(); + assert_eq!(net(&s, id).vertices.len(), 4); + assert_eq!(world_rect(&s, id), before); +} + +#[test] +fn a_rotated_vector_takes_pasted_points_in_its_own_coordinates() { + let mut s = Session::new(); + let id = path(&mut s); + ex(&mut s, "node.set", json!({"id": id, "props": {"rotation": 90}})); + select(&mut s, &[], &[1]); + ex(&mut s, "edit.copy", json!({})); + let before = page_points(&s, id); + assert_ne!(before[0], (100, 100), "the vector is rotated"); + ex(&mut s, "edit.paste", json!({})); + let after = page_points(&s, id); + assert_eq!(after[4..], before[1..3]); +} + +#[test] +fn layers_with_no_outline_are_skipped_and_named() { + let mut s = Session::new(); + let rect = id_of(&ex(&mut s, "shape.rectangle", json!({"x": 500, "y": 300, "width": 60, "height": 40}))); + let text = id_of(&ex(&mut s, "text.create", json!({"text": "hello", "x": 500, "y": 400}))); + let name = s.doc().unwrap().node(text).unwrap().name.clone(); + // Only text: nothing to add, and nothing changes. + ex(&mut s, "select.set", json!({"ids": [text]})); + ex(&mut s, "edit.copy", json!({})); + let id = path(&mut s); + let err = s.execute("edit.paste", &json!({})).unwrap_err(); + assert!(matches!(err, EngineError::Disabled(..)), "{err}"); + assert_eq!(net(&s, id).vertices.len(), 4); + // The rectangle joins, the text is named as skipped. + leave(&mut s); + ex(&mut s, "edit.copy", json!({"ids": [rect, text]})); + ex(&mut s, "vector.edit.begin", json!({"id": id})); + let r = ex(&mut s, "edit.paste", json!({})); + assert_eq!(r["skipped"], json!([name])); + assert_eq!(net(&s, id).vertices.len(), 8); +} + +#[test] +fn a_parent_still_pastes_layers_while_editing() { + let mut s = Session::new(); + let id = path(&mut s); + select(&mut s, &[], &[1]); + ex(&mut s, "edit.copy", json!({})); + let page = s.page().unwrap(); + ex(&mut s, "edit.paste", json!({"parent": page})); + assert_eq!(layers(&s).len(), 2); + assert_eq!(net(&s, id).segments.len(), 3); +} + +#[test] +fn an_empty_clipboard_refuses_to_paste_while_editing() { + let mut s = Session::new(); + path(&mut s); + assert!(matches!(s.execute("edit.paste", &json!({})), Err(EngineError::Disabled(..)))); +} + +#[test] +fn a_selected_face_copies_its_own_outline_with_the_fill() { + let mut s = Session::new(); + let r = ex(&mut s, "shape.rectangle", json!({"x": 100, "y": 100, "width": 80, "height": 60})); + let id = id_of(&r); + ex(&mut s, "vector.edit.begin", json!({"id": id})); + select(&mut s, &[], &[0, 1, 2, 3]); + ex(&mut s, "edit.copy", json!({})); + leave(&mut s); + ex(&mut s, "edit.paste", json!({})); + let new = *layers(&s).last().unwrap(); + let n = net(&s, new); + assert_eq!((n.segments.len(), n.regions.len()), (4, 1), "the closed shape stays filled"); + assert!(matches!(s.doc().unwrap().node(new).unwrap().kind, NodeKind::Vector { .. })); +} + +#[test] +fn copy_cut_and_paste_survive_junk_in_vector_edit_mode() { + let junk = [ + json!({}), + json!(null), + json!([1, 2]), + json!({"ids": ["x", -1, 99999]}), + json!({"id": "nope", "x": "NaN", "y": 1e308}), + json!({"parent": "nope", "x": -1e308, "y": "x"}), + json!({"x": 1e308, "y": 1e308}), + ]; + for cmd in ["edit.copy", "edit.cut", "edit.paste", "edit.pasteOver", "edit.pasteReplace"] { + for j in &junk { + let mut s = Session::new(); + path(&mut s); + select(&mut s, &[1], &[0]); + ex(&mut s, "text.create", json!({"text": "t"})); + if let Err(EngineError::Internal { cmd, msg }) = s.execute(cmd, j) { + panic!("{cmd} panicked on {j}: {msg}"); + } + // And after something was copied from the edit selection. + let mut s = Session::new(); + path(&mut s); + select(&mut s, &[2], &[]); + let _ = s.execute("edit.copy", &json!({})); + if let Err(EngineError::Internal { cmd, msg }) = s.execute(cmd, j) { + panic!("{cmd} panicked on {j}: {msg}"); + } + } + } +} diff --git a/crates/ui-egui/src/menus.rs b/crates/ui-egui/src/menus.rs index 98fd881d1..8ef67ef66 100644 --- a/crates/ui-egui/src/menus.rs +++ b/crates/ui-egui/src/menus.rs @@ -197,7 +197,15 @@ pub fn invoke(app: &mut FigApp, id: &str) { let ids = app.session.selection(); // For other apps: text layers' text, other layers as SVG; taken before a cut removes them. let doc = app.session.doc().ok(); - let mirror = doc.and_then(|d| text_layers_text(d, &ids).or_else(|| figcraft_svg_export(d, &ids))); + // Points or segments selected in vector edit mode copy just those: the whole vector's + // SVG would misdescribe them. + let partial = app + .session + .ds() + .ok() + .and_then(|d| d.vector_edit.as_ref()) + .is_some_and(|ve| ve.parts().iter().any(|p| !p.vertices.is_empty() || !p.segments.is_empty())); + let mirror = doc.filter(|_| !partial).and_then(|d| text_layers_text(d, &ids).or_else(|| figcraft_svg_export(d, &ids))); app.run(id, json!({})); // Mirror to the system clipboard (text or SVG, else a marker) and remember it, so a // later paste knows whether the clipboard still holds our layers. Control-channel diff --git a/crates/ui-egui/src/shortcuts.rs b/crates/ui-egui/src/shortcuts.rs index 26bdb60d2..48b61c39c 100644 --- a/crates/ui-egui/src/shortcuts.rs +++ b/crates/ui-egui/src/shortcuts.rs @@ -178,7 +178,7 @@ pub(crate) fn handle_input( let props = ctx.input(|i| i.modifiers.alt); crate::menus::invoke(app, if props { "edit.copyProperties" } else { "edit.copy" }); } - Event::Cut => cut(app), + Event::Cut => cut(app, ctx.input(|i| i.modifiers)), Event::Paste(text) if !paste.drop_text => crate::menus::paste(app, Some(text), None), Event::Key { key, physical_key, pressed: true, modifiers, repeat } if key_event(app, *key, *physical_key, *modifiers, *repeat, now, ctx) => @@ -192,13 +192,18 @@ pub(crate) fn handle_input( /// Cut: usually the layers. Windows sends Shift+Delete (remove the points and heal the path) /// as a cut command and never as a key, so in vector edit mode the selection is points: they are -/// removed, a heal joining the path through them. -fn cut(app: &mut FigApp) { +/// removed, a heal joining the path through them. Ctrl/Cmd+X is the real Cut: with points or +/// segments selected the engine copies them and removes them, staying in edit mode (#1875). +fn cut(app: &mut FigApp, modifiers: egui::Modifiers) { let Some(ve) = app.session.ds().ok().and_then(|d| d.vector_edit.clone()) else { crate::menus::invoke(app, "edit.cut"); return; }; - if ve.parts().iter().any(|p| !p.vertices.is_empty()) { + if modifiers.command { + if ve.parts().iter().any(|p| !p.vertices.is_empty() || !p.segments.is_empty()) { + crate::menus::invoke(app, "edit.cut"); + } + } else if ve.parts().iter().any(|p| !p.vertices.is_empty()) { app.run("vector.deleteHeal", json!({})); } else if ve.parts().iter().any(|p| !p.segments.is_empty()) { app.run("vector.edit.delete", json!({})); diff --git a/crates/ui-egui/src/vector_keys_tests.rs b/crates/ui-egui/src/vector_keys_tests.rs index dce51717d..9b3d0cb04 100644 --- a/crates/ui-egui/src/vector_keys_tests.rs +++ b/crates/ui-egui/src/vector_keys_tests.rs @@ -49,6 +49,18 @@ fn a_cut_command_in_edit_mode_takes_the_selected_points_not_the_layer() { assert_eq!(net(&u, path).vertices.len(), 2, "it takes the selected point"); } +#[test] +fn ctrl_x_on_selected_segments_puts_them_on_the_clipboard_and_keeps_the_layer() { + let mut u = Ui::new(Session::new()); + let path = abc(&mut u); + u.app.session.execute("vector.edit.select", &json!({"segments": [0]})).unwrap(); + u.frame_with(vec![Event::Cut], Modifiers::COMMAND); + assert!(u.app.session.doc().unwrap().node(path).is_some(), "Ctrl+X keeps the layer"); + assert_eq!(net(&u, path).segments.len(), 1, "the segment is gone"); + assert_eq!(u.app.session.clipboard.nodes.len(), 1, "and on the clipboard"); + assert!(u.app.session.ds().unwrap().vector_edit.is_some(), "edit mode stays on"); +} + #[test] fn a_cut_command_in_edit_mode_with_nothing_selected_keeps_the_layer() { let mut u = Ui::new(Session::new()); diff --git a/docs/ui-parity.md b/docs/ui-parity.md index aa0ef25bd..98816af28 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -1,6 +1,6 @@ # UI and interaction parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-04 · **Change:** minor (the left rail's and tab strip's icons are larger, 20 pt (#553); pick select: Tab while the keyboard selection box shows (or the chord again) puts a pink outline on a layer and the keys walk the layer tree from it, as Accessibility at Figma says (#1836); scrubbing a field faster or slower by the pointer's height, with a notice of the speed, as the help center's Scrub fields says (#1837); component rows in the Layers panel at AA contrast in the theme's component tint, with the rows inside a selected component in a tone of its row (#1903); Cmd/Ctrl-click on a padding field sets all four sides with the value typed, a documented auto layout shortcut; a fill per region of a vector: with regions selected in edit mode, the Fill section and the fill commands edit those regions' own fills, as Edit vector layers says (#1875); the Fill section of a text whose characters were coloured differently while editing shows mixed content, characters that all share fills the layer doesn't have show those, and a layer-level fill edit reaches every character (#1856); a number field scrubs when dragged with Alt held, as the help center's scrub section says, not only by its label; reuse visible layer selection roots (M8); ; with a shape or frame tool chosen and nothing selected, the arrows show a placement crosshair in the middle of the view and move it, and Enter places there, as Accessibility at Figma says (#1839); text direction per paragraph: Text ▸ Text direction forces a paragraph left to right or right to left, as Add right-to-left text says (#1830), with `text.direction`, `node.set textDirection`, the Type settings control once a right-to-left script is in the text, inspect, the CSS `direction` and the `.fig` lines' `sourceDirectionality`; the boolean operation menu in the Design panel leads each entry with an original icon drawn in code, a filled preview of the result (#2003); a press on the open gradient's handles or stops on the canvas keeps the colour picker open through the drag, as its own control (#1852); a click with the Bend tool on a sharp point curves it, its handles along the line between its neighbours, as Edit vector layers says (#1875); wrap style: Auto, Balance and Pretty on a text layer decide where its lines break, as Explore text properties says (#1827), with the Type settings control, `text.wrapStyle`, `node.set wrapStyle`, inspect and the CSS `text-wrap`; Backspace or Delete at the start of a list item keeps the item's indentation level, as the lists article says; max lines on auto-width text keep it auto width, hugging that many lines, as the text properties article says; superscript and subscript are synthesised where the font has no glyphs for them, from the standard glyphs shrunk and shifted by the font's OS/2 metrics, and a run mixing available and unavailable glyphs is synthesised whole, as Explore text properties says (#1828); Alt+Enter while editing text opens the link at the caret, as the accessibility page documents; Minimize, by its shortcut or the button by the file name, collapses the navigation bar and both sidebars as the help center says, with the right sidebar back while something is selected (#1835); the interface size keys of the help center's accessibility page: Cmd/Ctrl+Shift+Alt with =, - and 0 step the interface through the Preferences sizes and back to the system's size; Cmd/Ctrl+Alt+arrows rotate the selection a degree at a time, 15 with Shift, as the help center's accessibility page says; they resized before; the Layers panel answers Ctrl+1 as well as Alt+1 on Windows and Linux, the two keys the help center gives it; 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 keyboard's Menu key opens the context menu, as Shift+F10 does; the eyedropper with Cmd/Ctrl+Shift makes a colour style or variable of what it picks; sidebar number and text fields keep their text vertically centered when focused, including typography spacing; 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); 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); Preferences ▸ Scroll wheel zoom: a mouse wheel zooms the canvas about the pointer and Cmd/Ctrl+wheel scrolls (#1390); boolean operations refuse input past their caps, and a boolean group past them draws without its result (#1104); the selection and hover outlines of rounded rectangles and frames follow their corners (#1506); colour picker review fixes for text undo, fitted sidebars, moving controls and gradient variables; Corner smoothing: an original icon and the shared number-field drag gesture, preserving fractional baselines; guides snap to layers when dragged; Crop image: Object ▸ Crop image, the right-click menu and the image fill row enter crop mode (`image.crop`, #1464); the Design panel's sections on one grid — 16 / 8 margins, 88 + 8 + 88 + 8 + 24 columns, 24 pt rows, 4 pt between a row's buttons (#858); the toolbar on one 32 pt grid, without its Resources button (#1210); colour picker LCH and OKLCH models; an XML (Android Vector Drawable) export format; Context menus: the Menu key reaches egui 0.37 but is unbound (row done → partial); the Text on a path tool; board tool keys pinned; community fixes: the text box by dragging, the font picker keys, the pen path on leaving Design, a still canvas in vector edit mode, a scrolling pages list, colour emoji, readable new text in frames, system theme on first run; the Small caps sample in Type settings drawn from capitals; recent files as cards; vector edit mode: hovering, hatching, selecting and dragging filled regions; home screen: Templates tab, first-run templates and Getting started tips; number fields: scrub rates, arrow steps, arithmetic with brackets, relative edits of mixed values; outline mode's hidden layers and object bounds; Hide when publishing; cursors per tool and modifier; panel widths; dark pages for files made in the dark theme; drag threshold and double-clicks into text in groups; rotation origin on Alt+R and placing with Enter: no documented shortcut missing; keyboard shortcut parity suite and bindings; cursor chat and spotlight in live sessions; layers and assets panels behaviour suite and fixes; vector multi-edit and the vector edit tail; canvas navigation, guides and grids behaviour suite and fixes; shapes and vector behaviour suite and fixes; paint and effects behaviour suite and fixes; frames, groups, sections and masks behaviour suite and fixes; layers panel keyboard: F2 rename, Shift+F10 context menu, F8 box selection; selection and transform behaviour suite and fixes; Display P3: gamut warning and soft-proof (true P3 blocked upstream); several windows; boolean hit testing on the result, group drags, frame outlines and slices; outlines for the selection, mask outlines; arc fields, live boolean editing, shape builder on strokes, one-sided widths; fields select their text on focus; Typography spacing icons support scrubbing (#373); CSS colour names in hex fields; a rename selects the whole name, so typing replaces it; Escape or Enter after a pen path stays on the same vector (#760); IME composition kept on through idle frames of a text edit, candidates at the caret (#747); Selection colors for mixed selections and smart-selection spacing (#753); submenus with a hover delay and a safe triangle; the Actions palette's tabs, ranked search, highlight and recents; menu items that ask for a value; editor fixes from the community batches) · **Target:** Figma Design UI3 (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-04 · **Change:** minor (copy, cut and paste in vector edit mode act on the selected points and segments (#1875); the left rail's and tab strip's icons are larger, 20 pt (#553); pick select: Tab while the keyboard selection box shows (or the chord again) puts a pink outline on a layer and the keys walk the layer tree from it, as Accessibility at Figma says (#1836); scrubbing a field faster or slower by the pointer's height, with a notice of the speed, as the help center's Scrub fields says (#1837); component rows in the Layers panel at AA contrast in the theme's component tint, with the rows inside a selected component in a tone of its row (#1903); Cmd/Ctrl-click on a padding field sets all four sides with the value typed, a documented auto layout shortcut; a fill per region of a vector: with regions selected in edit mode, the Fill section and the fill commands edit those regions' own fills, as Edit vector layers says (#1875); the Fill section of a text whose characters were coloured differently while editing shows mixed content, characters that all share fills the layer doesn't have show those, and a layer-level fill edit reaches every character (#1856); a number field scrubs when dragged with Alt held, as the help center's scrub section says, not only by its label; reuse visible layer selection roots (M8); ; with a shape or frame tool chosen and nothing selected, the arrows show a placement crosshair in the middle of the view and move it, and Enter places there, as Accessibility at Figma says (#1839); text direction per paragraph: Text ▸ Text direction forces a paragraph left to right or right to left, as Add right-to-left text says (#1830), with `text.direction`, `node.set textDirection`, the Type settings control once a right-to-left script is in the text, inspect, the CSS `direction` and the `.fig` lines' `sourceDirectionality`; the boolean operation menu in the Design panel leads each entry with an original icon drawn in code, a filled preview of the result (#2003); a press on the open gradient's handles or stops on the canvas keeps the colour picker open through the drag, as its own control (#1852); a click with the Bend tool on a sharp point curves it, its handles along the line between its neighbours, as Edit vector layers says (#1875); wrap style: Auto, Balance and Pretty on a text layer decide where its lines break, as Explore text properties says (#1827), with the Type settings control, `text.wrapStyle`, `node.set wrapStyle`, inspect and the CSS `text-wrap`; Backspace or Delete at the start of a list item keeps the item's indentation level, as the lists article says; max lines on auto-width text keep it auto width, hugging that many lines, as the text properties article says; superscript and subscript are synthesised where the font has no glyphs for them, from the standard glyphs shrunk and shifted by the font's OS/2 metrics, and a run mixing available and unavailable glyphs is synthesised whole, as Explore text properties says (#1828); Alt+Enter while editing text opens the link at the caret, as the accessibility page documents; Minimize, by its shortcut or the button by the file name, collapses the navigation bar and both sidebars as the help center says, with the right sidebar back while something is selected (#1835); the interface size keys of the help center's accessibility page: Cmd/Ctrl+Shift+Alt with =, - and 0 step the interface through the Preferences sizes and back to the system's size; Cmd/Ctrl+Alt+arrows rotate the selection a degree at a time, 15 with Shift, as the help center's accessibility page says; they resized before; the Layers panel answers Ctrl+1 as well as Alt+1 on Windows and Linux, the two keys the help center gives it; 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 keyboard's Menu key opens the context menu, as Shift+F10 does; the eyedropper with Cmd/Ctrl+Shift makes a colour style or variable of what it picks; sidebar number and text fields keep their text vertically centered when focused, including typography spacing; 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); 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); Preferences ▸ Scroll wheel zoom: a mouse wheel zooms the canvas about the pointer and Cmd/Ctrl+wheel scrolls (#1390); boolean operations refuse input past their caps, and a boolean group past them draws without its result (#1104); the selection and hover outlines of rounded rectangles and frames follow their corners (#1506); colour picker review fixes for text undo, fitted sidebars, moving controls and gradient variables; Corner smoothing: an original icon and the shared number-field drag gesture, preserving fractional baselines; guides snap to layers when dragged; Crop image: Object ▸ Crop image, the right-click menu and the image fill row enter crop mode (`image.crop`, #1464); the Design panel's sections on one grid — 16 / 8 margins, 88 + 8 + 88 + 8 + 24 columns, 24 pt rows, 4 pt between a row's buttons (#858); the toolbar on one 32 pt grid, without its Resources button (#1210); colour picker LCH and OKLCH models; an XML (Android Vector Drawable) export format; Context menus: the Menu key reaches egui 0.37 but is unbound (row done → partial); the Text on a path tool; board tool keys pinned; community fixes: the text box by dragging, the font picker keys, the pen path on leaving Design, a still canvas in vector edit mode, a scrolling pages list, colour emoji, readable new text in frames, system theme on first run; the Small caps sample in Type settings drawn from capitals; recent files as cards; vector edit mode: hovering, hatching, selecting and dragging filled regions; home screen: Templates tab, first-run templates and Getting started tips; number fields: scrub rates, arrow steps, arithmetic with brackets, relative edits of mixed values; outline mode's hidden layers and object bounds; Hide when publishing; cursors per tool and modifier; panel widths; dark pages for files made in the dark theme; drag threshold and double-clicks into text in groups; rotation origin on Alt+R and placing with Enter: no documented shortcut missing; keyboard shortcut parity suite and bindings; cursor chat and spotlight in live sessions; layers and assets panels behaviour suite and fixes; vector multi-edit and the vector edit tail; canvas navigation, guides and grids behaviour suite and fixes; shapes and vector behaviour suite and fixes; paint and effects behaviour suite and fixes; frames, groups, sections and masks behaviour suite and fixes; layers panel keyboard: F2 rename, Shift+F10 context menu, F8 box selection; selection and transform behaviour suite and fixes; Display P3: gamut warning and soft-proof (true P3 blocked upstream); several windows; boolean hit testing on the result, group drags, frame outlines and slices; outlines for the selection, mask outlines; arc fields, live boolean editing, shape builder on strokes, one-sided widths; fields select their text on focus; Typography spacing icons support scrubbing (#373); CSS colour names in hex fields; a rename selects the whole name, so typing replaces it; Escape or Enter after a pen path stays on the same vector (#760); IME composition kept on through idle frames of a text edit, candidates at the caret (#747); Selection colors for mixed selections and smart-selection spacing (#753); submenus with a hover delay and a safe triangle; the Actions palette's tabs, ranked search, highlight and recents; menu items that ask for a value; editor fixes from the community batches) · **Target:** Figma Design UI3 (desktop app 126.10.7) Fine canvas control is what Figma users feel first: handles, snapping, nudging, modifier keys, drag behaviour, numeric precision. This checklist covers the tools, gestures and panels. Status: @@ -92,7 +92,7 @@ interaction feel not yet compared. | Rectangle, ellipse (arc handles and Design panel arc fields), polygon, star, line, arrow; Shift/Alt | done | Alt draws lines from the centre too (`shapes_behaviour_tests`) | | Corner radius handles (inside each corner of a rectangle or frame, a polygon's or star's top point; Alt: one corner), star ratio handle; Count and Ratio fields | done | handles hide under 48 px on screen; no count handle on the canvas (the Count field instead); corner smoothing rounds rectangles and frames only | | Pen: vector networks, branch, close, bend; pencil | done | pen pressure on Windows and from browser styluses only; outside edit mode the Pen closes on its first point, connects to its other points and continues a selected open path from an end point (`vector_multi_behaviour_tests`); Escape ends the path and keeps its layer in edit mode with the pen, so the next path joins the same vector and another Escape leaves edit mode (#760, `pen_end_tests`); Enter or a double-click ends the path (at the double-click's point, added once) and edits the vector with the Move tool, a double-click with the idle pen edits the layer under it, and in edit mode the pen's Enter or double-click takes the Move tool (#1430, `pen_vector_edit_tests`); switching from Design to Prototype or Inspect ends the path and returns to Move (#308) | -| Vector edit mode: bend, paint bucket, lasso, cut, eraser, transform box, point snapping, mirroring | done | a double-click a few pixels off a thin stroke enters edit mode (#646); entering edit mode and picking a region keep the canvas still (#322); a point dropped on another point merges with it, and dropping one end of an open path on the other closes it (a 2-point line's end just moves, #401); Flatten keeps open paths open (#377); paint bucket drags across areas; cut drags divide a shape into layers; delete and heal follows the curve; rounded points are drawn; Shift-click deselects a point at a corner of the box (`vector_behaviour_tests`); several vectors edited at once, Shift-click handles to drag them together, a cap and join per point, rounded points beside curves (`vector_multi_behaviour_tests`); filled regions with the Move tool: the area under the pointer is hatched ("/" lines in the selection colour, clipped by the area's own fill rule, holes left out, gone 3.5 px from a point or 2 px from a segment at any zoom), the line spacing follows octave folding (fitted to measurements at several zoom levels: 8 px at every power-of-two zoom, growing with the zoom and stepping back at √2 · 2ⁿ) and stays fixed to the shape when panning; a click selects the area and its points (moved with it but drawn unselected), Shift adds or removes an area, a press on a selected area drags the whole selection, no hover hatch during drags, a click on an empty spot (a hole) clears it and stays in edit mode; `vector.edit.select {regions}` (`regions_tests`, `vector_regions_tests`); a Bend click on a sharp point between two segments curves it (handles along the line between its neighbours, a third of the way to each, `ops::auto_smooth`), on a curved one sharpens it, a drag sets the handles by hand (#1875); with regions selected, the Fill section (its rows and the colour picker) and `fill.set`, `fill.add`, `fill.remove`, `fill.move` and `fill.paste` edit those regions' own fills, the layer's untouched, or the regions named by `regions: [index, ...]`; Copy fill takes the region's paint, the colour picker and its canvas gradient and crop handles edit it (an image from Upload from computer included; a file dropped on the picker goes to the canvas instead), what belongs to the layer (its fill style, a variable bound to its fill, the image crop button) stays off a region's rows, and `fill.pattern` sets the layer's fill (#1875). Not yet: areas of other layers edited at once | +| Vector edit mode: bend, paint bucket, lasso, cut, eraser, transform box, point snapping, mirroring | done | a double-click a few pixels off a thin stroke enters edit mode (#646); entering edit mode and picking a region keep the canvas still (#322); a point dropped on another point merges with it, and dropping one end of an open path on the other closes it (a 2-point line's end just moves, #401); Flatten keeps open paths open (#377); paint bucket drags across areas; cut drags divide a shape into layers; delete and heal follows the curve; rounded points are drawn; Shift-click deselects a point at a corner of the box (`vector_behaviour_tests`); several vectors edited at once, Shift-click handles to drag them together, a cap and join per point, rounded points beside curves (`vector_multi_behaviour_tests`); filled regions with the Move tool: the area under the pointer is hatched ("/" lines in the selection colour, clipped by the area's own fill rule, holes left out, gone 3.5 px from a point or 2 px from a segment at any zoom), the line spacing follows octave folding (fitted to measurements at several zoom levels: 8 px at every power-of-two zoom, growing with the zoom and stepping back at √2 · 2ⁿ) and stays fixed to the shape when panning; a click selects the area and its points (moved with it but drawn unselected), Shift adds or removes an area, a press on a selected area drags the whole selection, no hover hatch during drags, a click on an empty spot (a hole) clears it and stays in edit mode; `vector.edit.select {regions}` (`regions_tests`, `vector_regions_tests`); a Bend click on a sharp point between two segments curves it (handles along the line between its neighbours, a third of the way to each, `ops::auto_smooth`), on a curved one sharpens it, a drag sets the handles by hand (#1875); with regions selected, the Fill section (its rows and the colour picker) and `fill.set`, `fill.add`, `fill.remove`, `fill.move` and `fill.paste` edit those regions' own fills, the layer's untouched, or the regions named by `regions: [index, ...]`; Copy fill takes the region's paint, the colour picker and its canvas gradient and crop handles edit it (an image from Upload from computer included; a file dropped on the picker goes to the canvas instead), what belongs to the layer (its fill style, a variable bound to its fill, the image crop button) stays off a region's rows, and `fill.pattern` sets the layer's fill (#1875); Copy and Cut with points or segments selected take just those (a lone point: the segments touching it) as a vector with the layer's look, at their own place, so a paste outside edit mode is a new layer in place; Cut removes them as Delete does, the path splitting in the same layer with edit mode staying on; Paste while editing adds the clipboard's segments, or a copied shape's or boolean's outline, to the edited network in place with the new points selected, skipping layers with no outline (text, frames, groups; named in `skipped`) and refusing when none has one, as measured in Figma (`vector_clipboard_tests`, #1875). Not yet: areas of other layers edited at once | | Shape builder (Shift+M) on fills, strokes and open paths; variable width (Shift+W), one side with Alt | done | | | Boolean groups: clicked where the result is, double-click or Cmd/Ctrl-click into operands, live results while dragging or editing points, per-operand operations | done | a group past the path operations' caps (250 000 segments, 2 million possible crossings, 4 million segments swept over a fold) draws without its result, with a warning, and Flatten refuses it (#1104); the Design panel's Boolean groups menu leads Union, Subtract, Intersect and Exclude with their own icons, two offset squares with the result filled at reduced alpha (#2003) | | Text: point, auto height, fixed; caret, words, lines, IME | done | Backspace or Delete at the start of a list item takes its marker and keeps its level, the paragraph starting where the item's text did ("delete the counter, but keep the same level of indentation", Create bulleted and numbered lists; `text_tail_tests::list_keys_at_list_items`, text crate `behaviour_tests`); max lines on auto-width text keep it auto width, hugging up to that many lines and growing with its longest line ("Text resizing is set to auto height or auto width", Explore text properties; `text_behaviour_tests::max_lines_on_auto_width_text_keeps_auto_width_and_hugs_that_many_lines`); Alt+Enter while editing opens the link at the caret, web and mail links only (`text.openLink`; "press ⌥Option Return/Alt Enter to activate a focused link", Accessibility at Figma; `text_link_tests`); the font picker previews a family on the canvas while hovered (no undo step; Escape restores, #653) and Up/Down step through it (#352); a selection highlight after a line break starts at that line's start and an empty last line shows its mark (#665); carets step over whole emoji and accented letters; colour emoji draw from their colour tables (#300); IME composition replayed in tests as macOS sends it, not yet checked on a Mac (#747); CJK words by script run (no dictionary); vertical trim in Type settings; no spell check | @@ -187,6 +187,7 @@ in the table. `crates/ui-egui/src/shortcut_keys_tests.rs` drives the keys a look | Date | Change | Summary | |---|---|---| +| 2026-11-07 | minor | Vector edit mode, #1875, measured in Figma (web, real keys): Copy with segments selected takes only those (with just a point selected, the segments touching it) and a paste outside edit mode is a new vector layer in place; Cut removes them, the path splitting into subpaths in the same layer with edit mode staying on, and a paste outside gives a new layer with the cut segments; Paste while editing a vector adds the clipboard's segments, or a copied layer's outline, to the same network in place, selecting the pasted points, with no new layer and the bounds growing. FigCraft copied the whole layer, Cut left nothing to paste and Paste did nothing. `edit.copy`, `edit.cut` and `edit.paste` act so with no `ids`/`parent` given (Ctrl+X is the real Cut again; Shift+Delete still heals); the copy carries the layer's look (fills, strokes, effects, opacity, blend; the width profile only when every segment is copied); layers with no outline are skipped. Tests: `vector_clipboard_tests` | | 2026-11-02 | patch | Shortcuts: a Cmd/Ctrl-click on a padding field (the horizontal or vertical pair, or a side with Individual padding open) makes the value typed go to all four sides, in one undo step (Guide to auto layout, Keyboard shortcut guide); a plain click still edits that axis or side alone. A documented gesture row: 134 documented, 133 bound. Test: `padding_individual_tests` | | 2026-11-01 | patch | Number fields: dragging the field itself with Alt held scrubs it ("You can also hover the input field itself and hold down the modifier key: Mac: ⌥ Option Windows: Alt", Adjust alignment, rotation, position, and dimensions), with the resize cursor and the label's rates (Alt is the enabler there, so it isn't the fine rate); a click with Alt doesn't open the editor. Found by a documentation audit of the ui-parity rows. Test: `field_tests::alt_held_over_a_field_scrubs_it`. Counts unchanged | | 2026-11-02 | patch | M6, #1839: with a shape or frame tool chosen and nothing selected, the arrows show a placement crosshair in the middle of the view and move it by the nudge amounts (`tool.crosshair`), Enter places the object there (`tool.place`), Escape or a tool change takes it away; the canvas draws the crosshair and `ui.inspect` reports it (`tool.crosshair`), the Keyboard shortcuts panel lists the gesture ("Use the arrow keys to activate the crosshair cursor...", Accessibility at Figma). The board Shapes tool places on it too (its 160 px shape centred, as the tool centres a press), and the view pans by the overshoot when the crosshair is nudged past its edge. Tests: `place_crosshair_tests`, `shortcut_keys_tests::arrows_show_and_move_the_placement_crosshair_with_a_shape_tool`. | From a285fd293b8a31b6583228f5a4654841d8158723 Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Sun, 8 Nov 2026 00:11:49 -0500 Subject: [PATCH 018/101] Selection: Escape clears the selection instead of stepping out to the parent, as in Figma Measured in Figma: with a layer inside a group inside a frame selected (from the canvas, from the Layers panel, or after Tab), one Escape selects nothing; FigCraft selected the parent first. Escape still leaves text and vector editing, ends gestures and the pen first. Three tests updated to the measured rule (selection_behaviour, devfocus, proto_editor); the rest of the suites pass. Co-Authored-By: Claude Sonnet 5.5 Model-Effort: Opus 5.5 drove; Opus 5.5 briefed; Sonnet 5.5 wrote at low --- crates/engine/src/canvas/tools/keys.rs | 20 ++++--------------- crates/engine/src/devfocus_tests.rs | 6 +++--- .../engine/src/selection_behaviour_tests.rs | 8 +++----- crates/ui-egui/src/proto_editor_tests.rs | 12 ++++------- docs/ui-parity.md | 2 ++ 5 files changed, 16 insertions(+), 32 deletions(-) diff --git a/crates/engine/src/canvas/tools/keys.rs b/crates/engine/src/canvas/tools/keys.rs index 2b56aecd3..870565207 100644 --- a/crates/engine/src/canvas/tools/keys.rs +++ b/crates/engine/src/canvas/tools/keys.rs @@ -1,4 +1,4 @@ -use super::{Document, Gesture, Node, NodeId, Overlay, Point, PointerEvent, PointerKind, Result, Session, ShapeHandle, ToolId, json, textedit}; +use super::{Document, Gesture, NodeId, Overlay, Point, PointerEvent, PointerKind, Result, Session, ShapeHandle, ToolId, json, textedit}; impl Session { /// Keys the current mode handles before menu shortcuts (vector edit mode's tools and point @@ -146,21 +146,9 @@ impl Session { self.ds_mut()?.focus = None; return Ok(()); } - // Escape selects the parent, then nothing. - let doc = self.doc()?; - let parents: Vec = - sel.iter().filter_map(|i| doc.node(*i).and_then(|n| n.parent)).filter(|p| !doc.node(*p).is_some_and(Node::is_page)).collect(); - if !parents.is_empty() { - let mut uniq = Vec::new(); - for p in parents { - if !uniq.contains(&p) { - uniq.push(p); - } - } - self.set_selection(uniq); - } else { - self.set_selection(vec![]); - } + // Escape clears the selection whatever its nesting (measured in Figma: it never selects the + // parent). + self.set_selection(vec![]); Ok(()) } diff --git a/crates/engine/src/devfocus_tests.rs b/crates/engine/src/devfocus_tests.rs index 0801746de..f36af7ee6 100644 --- a/crates/engine/src/devfocus_tests.rs +++ b/crates/engine/src/devfocus_tests.rs @@ -84,12 +84,12 @@ fn only_the_focused_frame_is_hit_and_escape_leaves() { click(&mut s, 75.0, 75.0); assert_eq!(s.selection(), vec![in_a], "the layer on top of it isn't hit either"); assert_ne!(s.selection(), vec![over]); - // Escape: selection up to the frame, then out of the focus view. + // Escape: the selection goes, then out of the focus view. s.escape().unwrap(); - assert_eq!(s.selection(), vec![a]); + assert!(s.selection().is_empty(), "Escape selects nothing, not the parent frame"); assert_eq!(focused(&s), Some(a)); s.escape().unwrap(); - assert_eq!(focused(&s), None, "Escape with the frame selected leaves"); + assert_eq!(focused(&s), None, "Escape with nothing selected leaves"); click(&mut s, 350.0, 100.0); assert_eq!(s.selection(), vec![b], "everything is hit again"); } diff --git a/crates/engine/src/selection_behaviour_tests.rs b/crates/engine/src/selection_behaviour_tests.rs index c58527286..b3289c6c3 100644 --- a/crates/engine/src/selection_behaviour_tests.rs +++ b/crates/engine/src/selection_behaviour_tests.rs @@ -271,14 +271,12 @@ fn keyboard_selection() { ex(&mut s, cmd, json!({})); assert_eq!(sorted(s.selection()), sorted(after), "{why}"); } - // Esc steps out to the parent, then deselects. + // Esc clears the selection at once, whatever the nesting (measured in Figma). ex(&mut s, "select.set", json!({"ids": [k.a]})); s.escape().unwrap(); - assert_eq!(s.selection(), vec![k.g], "Esc selects the parent"); + assert_eq!(s.selection(), Vec::::new(), "Esc from a nested layer selects nothing, not the parent"); s.escape().unwrap(); - assert_eq!(s.selection(), vec![k.f]); - s.escape().unwrap(); - assert_eq!(s.selection(), Vec::::new(), "Esc on a top-level layer deselects"); + assert_eq!(s.selection(), Vec::::new()); } #[test] diff --git a/crates/ui-egui/src/proto_editor_tests.rs b/crates/ui-egui/src/proto_editor_tests.rs index b16894425..45fbe4d65 100644 --- a/crates/ui-egui/src/proto_editor_tests.rs +++ b/crates/ui-egui/src/proto_editor_tests.rs @@ -328,8 +328,8 @@ fn edit_delete_from_the_menu_removes_the_open_interaction_not_the_layer() { } #[test] -fn escape_closes_prototype_editor_without_deselecting_layer() { - let (s, a, _b, btn) = setup(); +fn escape_closes_prototype_editor_and_the_next_deselects() { + let (s, _a, _b, btn) = setup(); let mut u = Ui::new(s); u.app.ui.right_tab = crate::RightTab::Prototype; u.run("select.set", json!({"ids": [btn]})); @@ -344,13 +344,9 @@ fn escape_closes_prototype_editor_without_deselecting_layer() { assert_eq!(crate::proto_panel::editor(&u.ctx), None); assert_eq!(u.app.session.selection(), vec![btn], "layer remains selected"); - // Second Escape steps out to parent frame. + // Second Escape clears the selection, not stepping out to the parent frame. u.key(pos2(100.0, 100.0), egui::Key::Escape); - assert_eq!(u.app.session.selection(), vec![a], "steps out to parent frame"); - - // Third Escape deselects all. - u.key(pos2(100.0, 100.0), egui::Key::Escape); - assert!(u.app.session.selection().is_empty(), "selection cleared on third escape"); + assert!(u.app.session.selection().is_empty(), "the second Escape deselects"); } /// After a click in the Pages list, Delete that removes an interaction ends the list's hold on the diff --git a/docs/ui-parity.md b/docs/ui-parity.md index aa0ef25bd..e48e8b0ef 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -59,6 +59,7 @@ interaction feel not yet compared. | Click, Shift-click, marquee, Shift-marquee toggle | done | Shift-drag on a selected layer moves the selection, kept to one axis (#498); a marquee selects what it touches; from a top-level frame's background, the layers inside it; locked and hidden layers are skipped (`selection_behaviour_tests`) | | Deep select (Cmd/Ctrl-click, Cmd/Ctrl-marquee) | done | | | Select layer menu (every layer under the click) | done | | +| Escape with layers selected | done | clears the selection at once, whatever the nesting; it never selects the parent. Measured in the Figma web app (2026-11-08) with a rectangle in a group in a frame, selected from the canvas (a double-click into the group), from the Layers panel, and after Tab moved the selection to its sibling: one Escape selects nothing, a second leaves nothing selected. Escape still leaves text and vector editing, ends gestures and the pen first, and ends the focus view once nothing or the focused frame is selected (`selection_behaviour_tests`, `devfocus_tests`) | | Enter / Shift+Enter (children / parent), Tab / Shift+Tab (siblings) | done | Tab renames the next layer while renaming | | Resize handles: Shift keeps proportions, Alt from centre, constraints-aware | done | Alt shrinks too; past an edge flips (several layers mirror); groups and mixed rotations scale each layer along its own axes, keeping rotation and flip (no skew: children turned off a right angle are approximate); Cmd/Ctrl ignores a frame's constraints (`transform_behaviour_tests`) | | Rotate just outside a corner; Shift in 15° steps | done | rotated handle box when layers share a rotation | @@ -186,6 +187,7 @@ in the table. `crates/ui-egui/src/shortcut_keys_tests.rs` drives the keys a look ## Revision history | Date | Change | Summary | +| 2026-11-08 | patch | Selection: Escape with layers selected clears the selection instead of stepping out to the parent first. Measured in the Figma web app with a rectangle in a group in a frame, selected from the canvas, from the Layers panel and after Tab: one Escape selects nothing. Editing, gestures and the pen still end first | |---|---|---| | 2026-11-02 | patch | Shortcuts: a Cmd/Ctrl-click on a padding field (the horizontal or vertical pair, or a side with Individual padding open) makes the value typed go to all four sides, in one undo step (Guide to auto layout, Keyboard shortcut guide); a plain click still edits that axis or side alone. A documented gesture row: 134 documented, 133 bound. Test: `padding_individual_tests` | | 2026-11-01 | patch | Number fields: dragging the field itself with Alt held scrubs it ("You can also hover the input field itself and hold down the modifier key: Mac: ⌥ Option Windows: Alt", Adjust alignment, rotation, position, and dimensions), with the resize cursor and the label's rates (Alt is the enabler there, so it isn't the fine rate); a click with Alt doesn't open the editor. Found by a documentation audit of the ui-parity rows. Test: `field_tests::alt_held_over_a_field_scrubs_it`. Counts unchanged | From 476daeab8ea7ecc2174336d932f53deec30226bc Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Sun, 8 Nov 2026 00:23:51 -0500 Subject: [PATCH 019/101] Tests: paste lands in place, at the view's centre, or in a selected frame's centre, as measured in Figma Co-Authored-By: Claude Sonnet 5.5 Model-Effort: Opus 5.5 drove; Opus 5.5 briefed; Sonnet 5.5 wrote at low --- crates/engine/src/design_paste_tests.rs | 63 +++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/crates/engine/src/design_paste_tests.rs b/crates/engine/src/design_paste_tests.rs index 52dc42305..497ce2f33 100644 --- a/crates/engine/src/design_paste_tests.rs +++ b/crates/engine/src/design_paste_tests.rs @@ -106,3 +106,66 @@ fn other_content_is_refused_without_changes() { assert_eq!(s.doc().unwrap().nodes().count(), before); assert!(s.clipboard.nodes.is_empty()); } + +// The next four pin the paste-placement rules measured in Figma's web app on 2026-11-08 (a +// synthetic file): in place when the original is in view, at the view's centre when it is off +// screen, in a selected frame's centre when the frame is elsewhere, and in place inside a selected +// frame that contains the original. + +fn copied_rect(s: &mut Session) -> NodeId { + let r = id(&s.execute("shape.rectangle", &json!({"x": 100, "y": 100, "width": 50, "height": 50})).unwrap()); + s.execute("edit.copy", &json!({"ids": [r]})).unwrap(); + r +} + +fn pasted(s: &mut Session) -> NodeId { + let r = s.execute("edit.paste", &json!({})).unwrap(); + params::id_of(&r["ids"][0]).unwrap() +} + +#[test] +fn paste_with_the_original_in_view_lands_in_place_above_it() { + let mut s = Session::new(); + let page = s.page().unwrap(); + let r = copied_rect(&mut s); + s.execute("view.set", &json!({"zoom": 1, "cx": 125, "cy": 125})).unwrap(); + let c = pasted(&mut s); + let b = s.doc().unwrap().world_bounds(c).unwrap(); + assert_eq!((b.x0, b.y0), (100.0, 100.0)); + assert_eq!(s.selection(), [c]); + assert_eq!(s.doc().unwrap().node(page).unwrap().children, [r, c]); +} + +#[test] +fn paste_with_the_original_off_screen_lands_at_the_view_centre() { + let mut s = Session::new(); + copied_rect(&mut s); + s.execute("view.set", &json!({"zoom": 1, "cx": 5000, "cy": 3000})).unwrap(); + let c = pasted(&mut s); + let b = s.doc().unwrap().world_bounds(c).unwrap(); + assert_eq!((b.center().x, b.center().y), (5000.0, 3000.0)); +} + +#[test] +fn paste_into_a_selected_far_frame_lands_at_its_centre() { + let mut s = Session::new(); + copied_rect(&mut s); + let f = id(&s.execute("frame.create", &json!({"x": 2000, "y": 1000, "width": 300, "height": 300})).unwrap()); + s.execute("select.set", &json!({"ids": [f]})).unwrap(); + let c = pasted(&mut s); + assert_eq!(s.doc().unwrap().node(c).unwrap().parent, Some(f)); + let b = s.doc().unwrap().world_bounds(c).unwrap(); + assert_eq!((b.center().x, b.center().y), (2150.0, 1150.0)); +} + +#[test] +fn paste_into_a_selected_frame_holding_the_original_keeps_its_place() { + let mut s = Session::new(); + copied_rect(&mut s); + let f = id(&s.execute("frame.create", &json!({"x": 0, "y": 0, "width": 500, "height": 500})).unwrap()); + s.execute("select.set", &json!({"ids": [f]})).unwrap(); + let c = pasted(&mut s); + assert_eq!(s.doc().unwrap().node(c).unwrap().parent, Some(f)); + let b = s.doc().unwrap().world_bounds(c).unwrap(); + assert_eq!((b.x0, b.y0), (100.0, 100.0)); +} From bceb5476e0d9d170155dfff32107e6ec366a698e Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Sun, 8 Nov 2026 00:31:58 -0500 Subject: [PATCH 020/101] Docs: the new history row below the table's separator (#2107 review) Co-Authored-By: Claude Opus 5.5 Model-Effort: Opus 5.5 drove and wrote --- docs/ui-parity.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ui-parity.md b/docs/ui-parity.md index e48e8b0ef..70d495bd0 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -187,8 +187,8 @@ in the table. `crates/ui-egui/src/shortcut_keys_tests.rs` drives the keys a look ## Revision history | Date | Change | Summary | -| 2026-11-08 | patch | Selection: Escape with layers selected clears the selection instead of stepping out to the parent first. Measured in the Figma web app with a rectangle in a group in a frame, selected from the canvas, from the Layers panel and after Tab: one Escape selects nothing. Editing, gestures and the pen still end first | |---|---|---| +| 2026-11-08 | patch | Selection: Escape with layers selected clears the selection instead of stepping out to the parent first. Measured in the Figma web app with a rectangle in a group in a frame, selected from the canvas, from the Layers panel and after Tab: one Escape selects nothing. Editing, gestures and the pen still end first | | 2026-11-02 | patch | Shortcuts: a Cmd/Ctrl-click on a padding field (the horizontal or vertical pair, or a side with Individual padding open) makes the value typed go to all four sides, in one undo step (Guide to auto layout, Keyboard shortcut guide); a plain click still edits that axis or side alone. A documented gesture row: 134 documented, 133 bound. Test: `padding_individual_tests` | | 2026-11-01 | patch | Number fields: dragging the field itself with Alt held scrubs it ("You can also hover the input field itself and hold down the modifier key: Mac: ⌥ Option Windows: Alt", Adjust alignment, rotation, position, and dimensions), with the resize cursor and the label's rates (Alt is the enabler there, so it isn't the fine rate); a click with Alt doesn't open the editor. Found by a documentation audit of the ui-parity rows. Test: `field_tests::alt_held_over_a_field_scrubs_it`. Counts unchanged | | 2026-11-02 | patch | M6, #1839: with a shape or frame tool chosen and nothing selected, the arrows show a placement crosshair in the middle of the view and move it by the nudge amounts (`tool.crosshair`), Enter places the object there (`tool.place`), Escape or a tool change takes it away; the canvas draws the crosshair and `ui.inspect` reports it (`tool.crosshair`), the Keyboard shortcuts panel lists the gesture ("Use the arrow keys to activate the crosshair cursor...", Accessibility at Figma). The board Shapes tool places on it too (its 160 px shape centred, as the tool centres a press), and the view pans by the overshoot when the crosshair is nudged past its edge. Tests: `place_crosshair_tests`, `shortcut_keys_tests::arrows_show_and_move_the_placement_crosshair_with_a_shape_tool`. | From ad701088a27b69be2cb22c5d2f51055d56bed966 Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Sun, 8 Nov 2026 00:38:49 -0500 Subject: [PATCH 021/101] Vector edit: Cut deletes exactly what it copies for a selected region (#2105 review) Co-Authored-By: Claude Sonnet 5.5 Model-Effort: Opus 5.5 drove; Opus 5.5 briefed; Sonnet 5.5 wrote at medium --- .../engine/src/cmd/edit/vector_clipboard.rs | 11 +++++--- .../src/cmd/edit/vector_clipboard_tests.rs | 25 +++++++++++++++++++ docs/ui-parity.md | 4 +-- 3 files changed, 34 insertions(+), 6 deletions(-) diff --git a/crates/engine/src/cmd/edit/vector_clipboard.rs b/crates/engine/src/cmd/edit/vector_clipboard.rs index d9efea269..1a600f119 100644 --- a/crates/engine/src/cmd/edit/vector_clipboard.rs +++ b/crates/engine/src/cmd/edit/vector_clipboard.rs @@ -22,6 +22,8 @@ pub(super) struct EditSelection { pub any: bool, /// Each edited layer with something to copy, and the sub-network that is. pub parts: Vec<(NodeId, VectorNetwork)>, + /// What Cut removes, per edited layer: the same points and segments the copy was built from. + pub delete: Vec, } /// The selection of the vector being edited (and the other layers edited with it), or `None` when @@ -29,7 +31,7 @@ pub(super) struct EditSelection { pub(super) fn edit_selection(s: &Session) -> Option { let ds = s.ds().ok()?; let ve = ds.vector_edit.as_ref()?; - let mut sel = EditSelection { any: false, parts: Vec::new() }; + let mut sel = EditSelection { any: false, parts: Vec::new(), delete: Vec::new() }; for part in ve.parts() { if part.vertices.is_empty() && part.segments.is_empty() { continue; @@ -44,6 +46,7 @@ pub(super) fn edit_selection(s: &Session) -> Option { if active { segments.extend(ve.regions.iter().filter_map(|r| net.regions.get(*r)).flat_map(|r| r.loops.iter().flatten().copied())); } + sel.delete.push(EditPart { id: part.id, vertices: vertices.clone(), segments: segments.clone() }); if let Some(sub) = sub_network(net, &vertices, &segments) { sel.parts.push((part.id, sub)); } @@ -144,10 +147,10 @@ pub(super) fn copy_selection(s: &mut Session, cmd: &str, sel: EditSelection) -> /// the same layer and edit mode stays on). A selection that has no segment to copy (lone points /// with nothing attached) is removed and the clipboard is left as it was. pub(super) fn cut_selection(s: &mut Session, sel: EditSelection) -> Result { + let cut = sel.parts.len(); let segments = if sel.parts.is_empty() { 0 } else { copy_parts(s, "edit.cut", &sel)? }; - let parts: Vec = vectoredit::editing(s)?.parts(); - vectoredit::delete_selection(s, parts, false)?; - Ok(json!({"cut": sel.parts.len(), "segments": segments})) + vectoredit::delete_selection(s, sel.delete, false)?; + Ok(json!({"cut": cut, "segments": segments})) } /// The network of the outline of copied layer `n` in its own coordinates: a vector's segments, a diff --git a/crates/engine/src/cmd/edit/vector_clipboard_tests.rs b/crates/engine/src/cmd/edit/vector_clipboard_tests.rs index 012a110fe..4490a21f2 100644 --- a/crates/engine/src/cmd/edit/vector_clipboard_tests.rs +++ b/crates/engine/src/cmd/edit/vector_clipboard_tests.rs @@ -322,3 +322,28 @@ fn copy_cut_and_paste_survive_junk_in_vector_edit_mode() { } } } + +#[test] +fn cutting_a_selected_region_deletes_exactly_the_segments_it_copies_and_keeps_a_tail() { + let mut s = Session::new(); + let r = ex(&mut s, "vector.create", json!({"points": [[100, 100], [200, 100], [150, 200]], "closed": true})); + let id = id_of(&r); + // A tail: one open segment from the first corner to a new point. + crate::vectoredit::edit(s.doc_mut().unwrap(), id, |n| { + n.vertices.push(figcraft_doc::Vertex::new(20.0, 20.0)); + let tail = n.vertices.len() - 1; + crate::vectoredit::ops::connect(n, 0, tail, (0.0, 0.0), (0.0, 0.0)); + }) + .unwrap(); + assert_eq!((net(&s, id).segments.len(), net(&s, id).regions.len()), (4, 1)); + ex(&mut s, "vector.edit.begin", json!({"id": id})); + ex(&mut s, "vector.edit.select", json!({"regions": [0]})); + ex(&mut s, "edit.cut", json!({})); + let n = net(&s, id); + assert_eq!(n.segments.len(), 1, "only the tail is left"); + assert!(n.regions.is_empty()); + leave(&mut s); + ex(&mut s, "edit.paste", json!({})); + let new = *layers(&s).last().unwrap(); + assert_eq!(net(&s, new).segments.len(), 3, "the copy holds the region's three segments, not the tail"); +} diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 98816af28..930f41cb6 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -1,6 +1,6 @@ # UI and interaction parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-04 · **Change:** minor (copy, cut and paste in vector edit mode act on the selected points and segments (#1875); the left rail's and tab strip's icons are larger, 20 pt (#553); pick select: Tab while the keyboard selection box shows (or the chord again) puts a pink outline on a layer and the keys walk the layer tree from it, as Accessibility at Figma says (#1836); scrubbing a field faster or slower by the pointer's height, with a notice of the speed, as the help center's Scrub fields says (#1837); component rows in the Layers panel at AA contrast in the theme's component tint, with the rows inside a selected component in a tone of its row (#1903); Cmd/Ctrl-click on a padding field sets all four sides with the value typed, a documented auto layout shortcut; a fill per region of a vector: with regions selected in edit mode, the Fill section and the fill commands edit those regions' own fills, as Edit vector layers says (#1875); the Fill section of a text whose characters were coloured differently while editing shows mixed content, characters that all share fills the layer doesn't have show those, and a layer-level fill edit reaches every character (#1856); a number field scrubs when dragged with Alt held, as the help center's scrub section says, not only by its label; reuse visible layer selection roots (M8); ; with a shape or frame tool chosen and nothing selected, the arrows show a placement crosshair in the middle of the view and move it, and Enter places there, as Accessibility at Figma says (#1839); text direction per paragraph: Text ▸ Text direction forces a paragraph left to right or right to left, as Add right-to-left text says (#1830), with `text.direction`, `node.set textDirection`, the Type settings control once a right-to-left script is in the text, inspect, the CSS `direction` and the `.fig` lines' `sourceDirectionality`; the boolean operation menu in the Design panel leads each entry with an original icon drawn in code, a filled preview of the result (#2003); a press on the open gradient's handles or stops on the canvas keeps the colour picker open through the drag, as its own control (#1852); a click with the Bend tool on a sharp point curves it, its handles along the line between its neighbours, as Edit vector layers says (#1875); wrap style: Auto, Balance and Pretty on a text layer decide where its lines break, as Explore text properties says (#1827), with the Type settings control, `text.wrapStyle`, `node.set wrapStyle`, inspect and the CSS `text-wrap`; Backspace or Delete at the start of a list item keeps the item's indentation level, as the lists article says; max lines on auto-width text keep it auto width, hugging that many lines, as the text properties article says; superscript and subscript are synthesised where the font has no glyphs for them, from the standard glyphs shrunk and shifted by the font's OS/2 metrics, and a run mixing available and unavailable glyphs is synthesised whole, as Explore text properties says (#1828); Alt+Enter while editing text opens the link at the caret, as the accessibility page documents; Minimize, by its shortcut or the button by the file name, collapses the navigation bar and both sidebars as the help center says, with the right sidebar back while something is selected (#1835); the interface size keys of the help center's accessibility page: Cmd/Ctrl+Shift+Alt with =, - and 0 step the interface through the Preferences sizes and back to the system's size; Cmd/Ctrl+Alt+arrows rotate the selection a degree at a time, 15 with Shift, as the help center's accessibility page says; they resized before; the Layers panel answers Ctrl+1 as well as Alt+1 on Windows and Linux, the two keys the help center gives it; 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 keyboard's Menu key opens the context menu, as Shift+F10 does; the eyedropper with Cmd/Ctrl+Shift makes a colour style or variable of what it picks; sidebar number and text fields keep their text vertically centered when focused, including typography spacing; 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); 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); Preferences ▸ Scroll wheel zoom: a mouse wheel zooms the canvas about the pointer and Cmd/Ctrl+wheel scrolls (#1390); boolean operations refuse input past their caps, and a boolean group past them draws without its result (#1104); the selection and hover outlines of rounded rectangles and frames follow their corners (#1506); colour picker review fixes for text undo, fitted sidebars, moving controls and gradient variables; Corner smoothing: an original icon and the shared number-field drag gesture, preserving fractional baselines; guides snap to layers when dragged; Crop image: Object ▸ Crop image, the right-click menu and the image fill row enter crop mode (`image.crop`, #1464); the Design panel's sections on one grid — 16 / 8 margins, 88 + 8 + 88 + 8 + 24 columns, 24 pt rows, 4 pt between a row's buttons (#858); the toolbar on one 32 pt grid, without its Resources button (#1210); colour picker LCH and OKLCH models; an XML (Android Vector Drawable) export format; Context menus: the Menu key reaches egui 0.37 but is unbound (row done → partial); the Text on a path tool; board tool keys pinned; community fixes: the text box by dragging, the font picker keys, the pen path on leaving Design, a still canvas in vector edit mode, a scrolling pages list, colour emoji, readable new text in frames, system theme on first run; the Small caps sample in Type settings drawn from capitals; recent files as cards; vector edit mode: hovering, hatching, selecting and dragging filled regions; home screen: Templates tab, first-run templates and Getting started tips; number fields: scrub rates, arrow steps, arithmetic with brackets, relative edits of mixed values; outline mode's hidden layers and object bounds; Hide when publishing; cursors per tool and modifier; panel widths; dark pages for files made in the dark theme; drag threshold and double-clicks into text in groups; rotation origin on Alt+R and placing with Enter: no documented shortcut missing; keyboard shortcut parity suite and bindings; cursor chat and spotlight in live sessions; layers and assets panels behaviour suite and fixes; vector multi-edit and the vector edit tail; canvas navigation, guides and grids behaviour suite and fixes; shapes and vector behaviour suite and fixes; paint and effects behaviour suite and fixes; frames, groups, sections and masks behaviour suite and fixes; layers panel keyboard: F2 rename, Shift+F10 context menu, F8 box selection; selection and transform behaviour suite and fixes; Display P3: gamut warning and soft-proof (true P3 blocked upstream); several windows; boolean hit testing on the result, group drags, frame outlines and slices; outlines for the selection, mask outlines; arc fields, live boolean editing, shape builder on strokes, one-sided widths; fields select their text on focus; Typography spacing icons support scrubbing (#373); CSS colour names in hex fields; a rename selects the whole name, so typing replaces it; Escape or Enter after a pen path stays on the same vector (#760); IME composition kept on through idle frames of a text edit, candidates at the caret (#747); Selection colors for mixed selections and smart-selection spacing (#753); submenus with a hover delay and a safe triangle; the Actions palette's tabs, ranked search, highlight and recents; menu items that ask for a value; editor fixes from the community batches) · **Target:** Figma Design UI3 (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-08 · **Change:** minor (copy, cut and paste in vector edit mode act on the selected points and segments (#1875); the left rail's and tab strip's icons are larger, 20 pt (#553); pick select: Tab while the keyboard selection box shows (or the chord again) puts a pink outline on a layer and the keys walk the layer tree from it, as Accessibility at Figma says (#1836); scrubbing a field faster or slower by the pointer's height, with a notice of the speed, as the help center's Scrub fields says (#1837); component rows in the Layers panel at AA contrast in the theme's component tint, with the rows inside a selected component in a tone of its row (#1903); Cmd/Ctrl-click on a padding field sets all four sides with the value typed, a documented auto layout shortcut; a fill per region of a vector: with regions selected in edit mode, the Fill section and the fill commands edit those regions' own fills, as Edit vector layers says (#1875); the Fill section of a text whose characters were coloured differently while editing shows mixed content, characters that all share fills the layer doesn't have show those, and a layer-level fill edit reaches every character (#1856); a number field scrubs when dragged with Alt held, as the help center's scrub section says, not only by its label; reuse visible layer selection roots (M8); ; with a shape or frame tool chosen and nothing selected, the arrows show a placement crosshair in the middle of the view and move it, and Enter places there, as Accessibility at Figma says (#1839); text direction per paragraph: Text ▸ Text direction forces a paragraph left to right or right to left, as Add right-to-left text says (#1830), with `text.direction`, `node.set textDirection`, the Type settings control once a right-to-left script is in the text, inspect, the CSS `direction` and the `.fig` lines' `sourceDirectionality`; the boolean operation menu in the Design panel leads each entry with an original icon drawn in code, a filled preview of the result (#2003); a press on the open gradient's handles or stops on the canvas keeps the colour picker open through the drag, as its own control (#1852); a click with the Bend tool on a sharp point curves it, its handles along the line between its neighbours, as Edit vector layers says (#1875); wrap style: Auto, Balance and Pretty on a text layer decide where its lines break, as Explore text properties says (#1827), with the Type settings control, `text.wrapStyle`, `node.set wrapStyle`, inspect and the CSS `text-wrap`; Backspace or Delete at the start of a list item keeps the item's indentation level, as the lists article says; max lines on auto-width text keep it auto width, hugging that many lines, as the text properties article says; superscript and subscript are synthesised where the font has no glyphs for them, from the standard glyphs shrunk and shifted by the font's OS/2 metrics, and a run mixing available and unavailable glyphs is synthesised whole, as Explore text properties says (#1828); Alt+Enter while editing text opens the link at the caret, as the accessibility page documents; Minimize, by its shortcut or the button by the file name, collapses the navigation bar and both sidebars as the help center says, with the right sidebar back while something is selected (#1835); the interface size keys of the help center's accessibility page: Cmd/Ctrl+Shift+Alt with =, - and 0 step the interface through the Preferences sizes and back to the system's size; Cmd/Ctrl+Alt+arrows rotate the selection a degree at a time, 15 with Shift, as the help center's accessibility page says; they resized before; the Layers panel answers Ctrl+1 as well as Alt+1 on Windows and Linux, the two keys the help center gives it; 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 keyboard's Menu key opens the context menu, as Shift+F10 does; the eyedropper with Cmd/Ctrl+Shift makes a colour style or variable of what it picks; sidebar number and text fields keep their text vertically centered when focused, including typography spacing; 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); 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); Preferences ▸ Scroll wheel zoom: a mouse wheel zooms the canvas about the pointer and Cmd/Ctrl+wheel scrolls (#1390); boolean operations refuse input past their caps, and a boolean group past them draws without its result (#1104); the selection and hover outlines of rounded rectangles and frames follow their corners (#1506); colour picker review fixes for text undo, fitted sidebars, moving controls and gradient variables; Corner smoothing: an original icon and the shared number-field drag gesture, preserving fractional baselines; guides snap to layers when dragged; Crop image: Object ▸ Crop image, the right-click menu and the image fill row enter crop mode (`image.crop`, #1464); the Design panel's sections on one grid — 16 / 8 margins, 88 + 8 + 88 + 8 + 24 columns, 24 pt rows, 4 pt between a row's buttons (#858); the toolbar on one 32 pt grid, without its Resources button (#1210); colour picker LCH and OKLCH models; an XML (Android Vector Drawable) export format; Context menus: the Menu key reaches egui 0.37 but is unbound (row done → partial); the Text on a path tool; board tool keys pinned; community fixes: the text box by dragging, the font picker keys, the pen path on leaving Design, a still canvas in vector edit mode, a scrolling pages list, colour emoji, readable new text in frames, system theme on first run; the Small caps sample in Type settings drawn from capitals; recent files as cards; vector edit mode: hovering, hatching, selecting and dragging filled regions; home screen: Templates tab, first-run templates and Getting started tips; number fields: scrub rates, arrow steps, arithmetic with brackets, relative edits of mixed values; outline mode's hidden layers and object bounds; Hide when publishing; cursors per tool and modifier; panel widths; dark pages for files made in the dark theme; drag threshold and double-clicks into text in groups; rotation origin on Alt+R and placing with Enter: no documented shortcut missing; keyboard shortcut parity suite and bindings; cursor chat and spotlight in live sessions; layers and assets panels behaviour suite and fixes; vector multi-edit and the vector edit tail; canvas navigation, guides and grids behaviour suite and fixes; shapes and vector behaviour suite and fixes; paint and effects behaviour suite and fixes; frames, groups, sections and masks behaviour suite and fixes; layers panel keyboard: F2 rename, Shift+F10 context menu, F8 box selection; selection and transform behaviour suite and fixes; Display P3: gamut warning and soft-proof (true P3 blocked upstream); several windows; boolean hit testing on the result, group drags, frame outlines and slices; outlines for the selection, mask outlines; arc fields, live boolean editing, shape builder on strokes, one-sided widths; fields select their text on focus; Typography spacing icons support scrubbing (#373); CSS colour names in hex fields; a rename selects the whole name, so typing replaces it; Escape or Enter after a pen path stays on the same vector (#760); IME composition kept on through idle frames of a text edit, candidates at the caret (#747); Selection colors for mixed selections and smart-selection spacing (#753); submenus with a hover delay and a safe triangle; the Actions palette's tabs, ranked search, highlight and recents; menu items that ask for a value; editor fixes from the community batches) · **Target:** Figma Design UI3 (desktop app 126.10.7) Fine canvas control is what Figma users feel first: handles, snapping, nudging, modifier keys, drag behaviour, numeric precision. This checklist covers the tools, gestures and panels. Status: @@ -187,7 +187,7 @@ in the table. `crates/ui-egui/src/shortcut_keys_tests.rs` drives the keys a look | Date | Change | Summary | |---|---|---| -| 2026-11-07 | minor | Vector edit mode, #1875, measured in Figma (web, real keys): Copy with segments selected takes only those (with just a point selected, the segments touching it) and a paste outside edit mode is a new vector layer in place; Cut removes them, the path splitting into subpaths in the same layer with edit mode staying on, and a paste outside gives a new layer with the cut segments; Paste while editing a vector adds the clipboard's segments, or a copied layer's outline, to the same network in place, selecting the pasted points, with no new layer and the bounds growing. FigCraft copied the whole layer, Cut left nothing to paste and Paste did nothing. `edit.copy`, `edit.cut` and `edit.paste` act so with no `ids`/`parent` given (Ctrl+X is the real Cut again; Shift+Delete still heals); the copy carries the layer's look (fills, strokes, effects, opacity, blend; the width profile only when every segment is copied); layers with no outline are skipped. Tests: `vector_clipboard_tests` | +| 2026-11-08 | minor | Vector edit mode, #1875, measured in Figma (web, real keys): Copy with segments selected takes only those (with just a point selected, the segments touching it) and a paste outside edit mode is a new vector layer in place; Cut removes them, the path splitting into subpaths in the same layer with edit mode staying on, and a paste outside gives a new layer with the cut segments; Paste while editing a vector adds the clipboard's segments, or a copied layer's outline, to the same network in place, selecting the pasted points, with no new layer and the bounds growing. FigCraft copied the whole layer, Cut left nothing to paste and Paste did nothing. `edit.copy`, `edit.cut` and `edit.paste` act so with no `ids`/`parent` given (Ctrl+X is the real Cut again; Shift+Delete still heals); the copy carries the layer's look (fills, strokes, effects, opacity, blend; the width profile only when every segment is copied); layers with no outline are skipped. Tests: `vector_clipboard_tests` | | 2026-11-02 | patch | Shortcuts: a Cmd/Ctrl-click on a padding field (the horizontal or vertical pair, or a side with Individual padding open) makes the value typed go to all four sides, in one undo step (Guide to auto layout, Keyboard shortcut guide); a plain click still edits that axis or side alone. A documented gesture row: 134 documented, 133 bound. Test: `padding_individual_tests` | | 2026-11-01 | patch | Number fields: dragging the field itself with Alt held scrubs it ("You can also hover the input field itself and hold down the modifier key: Mac: ⌥ Option Windows: Alt", Adjust alignment, rotation, position, and dimensions), with the resize cursor and the label's rates (Alt is the enabler there, so it isn't the fine rate); a click with Alt doesn't open the editor. Found by a documentation audit of the ui-parity rows. Test: `field_tests::alt_held_over_a_field_scrubs_it`. Counts unchanged | | 2026-11-02 | patch | M6, #1839: with a shape or frame tool chosen and nothing selected, the arrows show a placement crosshair in the middle of the view and move it by the nudge amounts (`tool.crosshair`), Enter places the object there (`tool.place`), Escape or a tool change takes it away; the canvas draws the crosshair and `ui.inspect` reports it (`tool.crosshair`), the Keyboard shortcuts panel lists the gesture ("Use the arrow keys to activate the crosshair cursor...", Accessibility at Figma). The board Shapes tool places on it too (its 160 px shape centred, as the tool centres a press), and the view pans by the overshoot when the crosshair is nudged past its edge. Tests: `place_crosshair_tests`, `shortcut_keys_tests::arrows_show_and_move_the_placement_crosshair_with_a_shape_tool`. | From db1bec08c87626d1c0f7fd161119693330984040 Mon Sep 17 00:00:00 2001 From: NetterSilver <133535268+Silvertree2010@users.noreply.github.com> Date: Sun, 8 Nov 2026 06:31:13 +0000 Subject: [PATCH 022/101] Reject invalid layer ids in file.export and file.exportLayers Found while testing crates/engine/src/cmd/file/export.rs:89 (export; same pattern at :332 in export_layers) Co-Authored-By: Claude Haiku 5.5 Co-Authored-By: Claude Sonnet 5.5 --- crates/engine/src/cmd/file/export.rs | 17 ++++++++++++++--- crates/engine/src/export_behaviour_tests.rs | 14 ++++++++++++++ 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/crates/engine/src/cmd/file/export.rs b/crates/engine/src/cmd/file/export.rs index 542ee246c..de426ba89 100644 --- a/crates/engine/src/cmd/file/export.rs +++ b/crates/engine/src/cmd/file/export.rs @@ -1,7 +1,7 @@ use super::load::{ext, write}; use super::save::thumbnail; use super::*; -use crate::params::f64_of; +use crate::params::{f64_of, req_targets}; /// Encode `ids` (or the page) in `format` at `scale`. pub fn export_bytes(doc: &Document, ids: &[NodeId], format: ExportFormat, scale: f64) -> Result> { @@ -86,7 +86,7 @@ pub(super) fn export(s: &mut Session, p: &Value) -> Result { _ => {} } let doc = s.doc()?; - let mut ids = targets(s, p); + let mut ids = export_targets(cmd, s, p)?; if ids.is_empty() { ids = doc.get(s.page()?)?.children.clone(); } @@ -325,11 +325,22 @@ pub fn exportable_layers(doc: &Document, page: NodeId) -> Vec { doc.subtree(page).into_iter().skip(1).filter(|i| doc.node(*i).is_some_and(|n| !n.exports.is_empty())).collect() } +/// Named layers (`ids` / `id`), checked like other commands; empty when none are named, so the +/// caller can fall back to its default instead of silently dropping a bad id. +fn export_targets(cmd: &str, s: &Session, p: &Value) -> Result> { + let named = match get(p, "ids") { + Some(Value::Array(a)) if !a.is_empty() => true, + Some(Value::Array(_) | Value::Null) | None => get(p, "id").is_some_and(|v| !v.is_null()), + Some(_) => true, + }; + if named { req_targets(cmd, s, p) } else { Ok(targets(s, p)) } +} + pub(super) fn export_layers(s: &mut Session, p: &Value) -> Result { let cmd = "file.exportLayers"; let doc = s.doc()?; let assets = boolean(p, "assets").unwrap_or(false); - let mut ids = targets(s, p); + let mut ids = export_targets(cmd, s, p)?; if ids.is_empty() { ids = if assets { vec![s.page()?] } else { exportable_layers(doc, s.page()?) }; } diff --git a/crates/engine/src/export_behaviour_tests.rs b/crates/engine/src/export_behaviour_tests.rs index 1cd836784..492fbf881 100644 --- a/crates/engine/src/export_behaviour_tests.rs +++ b/crates/engine/src/export_behaviour_tests.rs @@ -384,3 +384,17 @@ fn copy_as_png_svg_and_code() { let css = crate::codegen::code_for(doc, a, crate::codegen::CodeLang::Css); assert!(css.contains("background: #FF0000;"), "Copy as CSS is the layer's CSS from Inspect"); } + +#[test] +fn export_rejects_an_invalid_layer_id_instead_of_exporting_the_page() { + let mut s = Session::new(); + let r = rect(&mut s, 0.0, 0.0, 10.0, 10.0, "#ff0000", None); + ex(&mut s, "export.add", json!({"ids": [r]})); + for cmd in ["file.export", "file.exportLayers"] { + for p in [json!({"ids": ["abc"], "format": "svg"}), json!({"id": "abc", "format": "svg"}), json!({"ids": [], "id": "abc", "format": "svg"})] { + let res = s.execute(cmd, &p); + assert!(res.is_err(), "{cmd} {p} exported for an invalid id: {res:?}"); + } + } + assert!(s.execute("file.export", &json!({"format": "svg"})).is_ok()); +} From ebd463fa5f4172a549839604691ffd38eebff949 Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Sun, 8 Nov 2026 01:31:31 -0500 Subject: [PATCH 023/101] Tests: the comment says which paste cases were measured and which pins FigCraft's own branch (#2108 review) Co-Authored-By: Claude Opus 5.5 Model-Effort: Opus 5.5 drove and wrote --- crates/engine/src/design_paste_tests.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/engine/src/design_paste_tests.rs b/crates/engine/src/design_paste_tests.rs index 497ce2f33..6823645ed 100644 --- a/crates/engine/src/design_paste_tests.rs +++ b/crates/engine/src/design_paste_tests.rs @@ -107,10 +107,11 @@ fn other_content_is_refused_without_changes() { assert!(s.clipboard.nodes.is_empty()); } -// The next four pin the paste-placement rules measured in Figma's web app on 2026-11-08 (a +// The next three pin the paste-placement rules measured in Figma's web app on 2026-11-08 (a // synthetic file): in place when the original is in view, at the view's centre when it is off -// screen, in a selected frame's centre when the frame is elsewhere, and in place inside a selected -// frame that contains the original. +// screen, and in a selected frame's centre when the frame is elsewhere. The fourth pins +// FigCraft's own branch for a selected frame that contains the original (in place inside it), +// which was not measured. fn copied_rect(s: &mut Session) -> NodeId { let r = id(&s.execute("shape.rectangle", &json!({"x": 100, "y": 100, "width": 50, "height": 50})).unwrap()); From 87ce9612e6f2225ab1d288fe06edc89caf052475 Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Sun, 8 Nov 2026 01:44:23 -0500 Subject: [PATCH 024/101] Vector edit clipboard: Cut and Copy with only lone points are refused; one x/y refused; the system clipboard gets the partial copy; specs match (#2105 review) Cut with nothing to copy (only points that touch no segment) is Disabled and changes nothing, as Copy now is (Copy used to fall through to the whole layer); paste borrows the clipboard instead of cloning it; a partial copy or cut mirrors its SVG to the system clipboard; x without y (or y without x) is refused; the junk test asserts refusals change nothing and accepted results are finite; the edit.copy, edit.cut and edit.paste specs state the behaviour and the mode-specific paste response. Co-Authored-By: Claude Sonnet 5.5 Model-Effort: Opus 5.5 drove; Opus 5.5 briefed; Sonnet 5.5 wrote at medium --- crates/engine/src/cmd/edit.rs | 7 +- crates/engine/src/cmd/edit/clipboard.rs | 4 +- .../engine/src/cmd/edit/vector_clipboard.rs | 40 +++++- .../src/cmd/edit/vector_clipboard_tests.rs | 121 ++++++++++++++++-- crates/ui-egui/src/menus.rs | 7 +- 5 files changed, 152 insertions(+), 27 deletions(-) diff --git a/crates/engine/src/cmd/edit.rs b/crates/engine/src/cmd/edit.rs index 19a7d7011..c03721af4 100644 --- a/crates/engine/src/cmd/edit.rs +++ b/crates/engine/src/cmd/edit.rs @@ -18,6 +18,7 @@ mod props; pub(crate) use props::{edit_region_fills, fill_regions}; mod select; mod vector_clipboard; +pub use vector_clipboard::clipboard_svg; #[cfg(test)] mod vector_clipboard_tests; @@ -123,21 +124,21 @@ pub fn specs() -> Vec { spec!( "edit.copy", "Copy", - "{ids?} in vector edit mode with points or segments selected (and no ids): just those, the segments touching a selected point, as a new vector with the edited layer's look", + "{ids?} in vector edit mode with points or segments selected (and no ids): just those, the segments touching a selected point, as a temporary vector on the clipboard (one per edited layer) with the edited layer's look, kept at its place on the page; points that touch no segment have nothing to copy, so Copy with only those is refused (Disabled). Returns {copied, segments}", false, copy ), spec!( "edit.cut", "Cut", - "{ids?} in vector edit mode with points or segments selected (and no ids): copies them as Copy does, then removes them as Delete does; the path splits in the same layer and edit mode stays on", + "{ids?} in vector edit mode with points or segments selected (and no ids): copies them as Copy does, then removes them as Delete does; the path splits in the same layer and edit mode stays on. Returns {cut (layers), segments}. With only lone points (nothing to copy) it is refused (Disabled) and changes nothing, as Copy is; Delete removes lone points", true, cut ), spec!( "edit.paste", "Paste", - "{parent?, x?, y? (page coordinates of the pasted top-left)} in vector edit mode (and no parent): the copied vectors' segments and shapes' outlines join the edited vector's network in place, selected, and the layers that have no outline (text, frames, groups) are skipped (`skipped`); a copied main component pastes as an instance of it within its file (cut ones, and pastes into other files, keep the component)", + "{parent?, x?, y? (page coordinates of the pasted top-left; give both or neither, one alone is refused)} in vector edit mode (and no parent): the copied vectors' segments and the outlines of shapes, booleans and lines join the edited vector's network (at x/y when given, else in place), their points selected, as one undo step; layers with no outline (text, images, instances, frames, groups) are skipped and named in `skipped` (present only when some were), and when none has an outline the paste is refused (Disabled), as it is past 500,000 segments in one vector. Returns {ids: [] (always empty: no layer is created), edited (the vector's id), vertices (points added), skipped?}, unlike a paste outside edit mode, which returns the new layers' `ids`; a copied main component pastes as an instance of it within its file (cut ones, and pastes into other files, keep the component)", true, paste ), diff --git a/crates/engine/src/cmd/edit/clipboard.rs b/crates/engine/src/cmd/edit/clipboard.rs index da5089419..a04bfcb5c 100644 --- a/crates/engine/src/cmd/edit/clipboard.rs +++ b/crates/engine/src/cmd/edit/clipboard.rs @@ -193,8 +193,9 @@ pub(super) fn copy(s: &mut Session, p: &Value) -> Result { // In vector edit mode with points or segments selected, Copy takes just those (#1875). if !names_layers(p) && let Some(sel) = vector_clipboard::edit_selection(s) - && !sel.parts.is_empty() + && sel.any { + // Only lone points selected: nothing to copy, and not the whole layer either. return vector_clipboard::copy_selection(s, "edit.copy", sel); } let ids = req_targets("edit.copy", s, p)?; @@ -208,6 +209,7 @@ pub(super) fn cut(s: &mut Session, p: &Value) -> Result { && let Some(sel) = vector_clipboard::edit_selection(s) && sel.any { + // Lone points with nothing to copy: `cut_selection` refuses, as Copy does. return vector_clipboard::cut_selection(s, sel); } let ids = req_targets("edit.cut", s, p)?; diff --git a/crates/engine/src/cmd/edit/vector_clipboard.rs b/crates/engine/src/cmd/edit/vector_clipboard.rs index 1a600f119..72c60bf02 100644 --- a/crates/engine/src/cmd/edit/vector_clipboard.rs +++ b/crates/engine/src/cmd/edit/vector_clipboard.rs @@ -7,6 +7,7 @@ //! while editing adds the clipboard's layers to the edited vector's network, in place: a vector //! with its segments, a shape or boolean with its outline. +use crate::bad; use figcraft_doc::{NodeKind, Region, VectorNetwork}; use super::clipboard::{collect_images, store_clipboard}; @@ -144,15 +145,37 @@ pub(super) fn copy_selection(s: &mut Session, cmd: &str, sel: EditSelection) -> } /// Cut: copy the selected segments, then remove the selection as Delete does (the path splits in -/// the same layer and edit mode stays on). A selection that has no segment to copy (lone points -/// with nothing attached) is removed and the clipboard is left as it was. +/// the same layer and edit mode stays on). Cut is Copy plus Delete, so it is refused exactly where +/// Copy is: a selection with nothing to copy (only lone points that touch no segment) is +/// `Disabled` and changes nothing, clipboard included. Delete removes such points. pub(super) fn cut_selection(s: &mut Session, sel: EditSelection) -> Result { + if sel.parts.is_empty() { + return Err(EngineError::Disabled("edit.cut".into(), "the selection has nothing to copy (Delete removes lone points)".into())); + } let cut = sel.parts.len(); - let segments = if sel.parts.is_empty() { 0 } else { copy_parts(s, "edit.cut", &sel)? }; + let segments = copy_parts(s, "edit.cut", &sel)?; vectoredit::delete_selection(s, sel.delete, false)?; Ok(json!({"cut": cut, "segments": segments})) } +/// The SVG of the layers a partial vector-edit copy or cut put on the clipboard, for the system +/// clipboard: they are temporary layers that live only in the clipboard, so they are placed in a +/// scratch document to export. `None` when the clipboard holds none or the export fails. +pub fn clipboard_svg(s: &Session) -> Option { + let mut scratch = Document::new("Clipboard"); + let page = scratch.current_page?; + for (k, v) in &s.clipboard.images { + scratch.images.insert(k.clone(), v.clone()); + } + let mut ids = Vec::new(); + for (root, nodes) in &s.clipboard.nodes { + let map: BTreeMap = nodes.iter().map(|n| (n.id, scratch.alloc_id())).collect(); + ids.push(scratch.paste_nodes(nodes, &map, *root, page, None).ok()?); + } + let bytes = crate::cmd::file::export_bytes(&scratch, &ids, figcraft_doc::ExportFormat::Svg, 1.0).ok()?; + String::from_utf8(bytes).ok() +} + /// The network of the outline of copied layer `n` in its own coordinates: a vector's segments, a /// shape's or boolean's outline. `None` for the layers with no outline to add (text, images, /// frames, groups, instances, …). `doc` is the file the layer was copied from. @@ -210,16 +233,18 @@ fn placed(mut net: VectorNetwork, m: Affine) -> Option { /// (named in `skipped`); when none has one, nothing is pasted. pub(super) fn paste_into_vector(s: &mut Session, p: &Value) -> Result { const CMD: &str = "edit.paste"; - let clip = s.clipboard.clone(); - if clip.nodes.is_empty() { + if s.clipboard.nodes.is_empty() { return Err(EngineError::Disabled(CMD.into(), "the clipboard is empty".into())); } let target = vectoredit::editing(s)?.id; - let shift = match (num(p, "x"), num(p, "y"), clip.bounds) { + let shift = match (num(p, "x"), num(p, "y"), s.clipboard.bounds) { (Some(x), Some(y), Some(b)) => Affine::translate((x - b.x0, y - b.y0)), - _ => Affine::IDENTITY, + (None, None, _) | (Some(_), Some(_), None) => Affine::IDENTITY, + _ => return Err(bad(CMD, "give both x and y, or neither")), }; let live = s.doc()?; + // Borrow the clipboard (it holds the source document and the images) to build the pieces. + let clip = &s.clipboard; let source: &Document = clip.source.as_deref().unwrap_or(live); let to_local = live.world_transform(target).inverse() * shift; let mut pieces = Vec::new(); @@ -269,6 +294,7 @@ pub(super) fn paste_into_vector(s: &mut Session, p: &Value) -> Result { ve.pen_out = None; ve.width_point = None; })?; + // `ids` stays empty: no layer is created, the pasted outlines joined layer `edited`. let mut out = json!({"ids": [], "edited": target, "vertices": pasted.len()}); if !skipped.is_empty() { out["skipped"] = json!(skipped); diff --git a/crates/engine/src/cmd/edit/vector_clipboard_tests.rs b/crates/engine/src/cmd/edit/vector_clipboard_tests.rs index 4490a21f2..e737c11d6 100644 --- a/crates/engine/src/cmd/edit/vector_clipboard_tests.rs +++ b/crates/engine/src/cmd/edit/vector_clipboard_tests.rs @@ -291,6 +291,19 @@ fn a_selected_face_copies_its_own_outline_with_the_fill() { assert!(matches!(s.doc().unwrap().node(new).unwrap().kind, NodeKind::Vector { .. })); } +/// Everything junk must not change when a command is refused: the vector, the layers, the edit +/// selection and what the clipboard holds. +fn state(s: &Session, id: NodeId) -> String { + let ve = s.ds().unwrap().vector_edit.clone(); + let clip: Vec = s.clipboard.nodes.iter().flat_map(|(_, n)| n).map(|n| format!("{:?}", n.kind)).collect(); + format!("{:?}|{:?}|{:?}|{:?}|{}", net(s, id), layers(s), ve.map(|v| (v.vertices, v.segments)), clip, s.clipboard.layers_generation) +} + +fn finite(n: &VectorNetwork) -> bool { + n.vertices.iter().all(|v| v.x.is_finite() && v.y.is_finite()) + && n.segments.iter().all(|sg| [sg.ta.0, sg.ta.1, sg.tb.0, sg.tb.1].iter().all(|x| x.is_finite())) +} + #[test] fn copy_cut_and_paste_survive_junk_in_vector_edit_mode() { let junk = [ @@ -301,28 +314,108 @@ fn copy_cut_and_paste_survive_junk_in_vector_edit_mode() { json!({"id": "nope", "x": "NaN", "y": 1e308}), json!({"parent": "nope", "x": -1e308, "y": "x"}), json!({"x": 1e308, "y": 1e308}), + json!({"x": 1e308}), ]; for cmd in ["edit.copy", "edit.cut", "edit.paste", "edit.pasteOver", "edit.pasteReplace"] { for j in &junk { - let mut s = Session::new(); - path(&mut s); - select(&mut s, &[1], &[0]); - ex(&mut s, "text.create", json!({"text": "t"})); - if let Err(EngineError::Internal { cmd, msg }) = s.execute(cmd, j) { - panic!("{cmd} panicked on {j}: {msg}"); - } - // And after something was copied from the edit selection. - let mut s = Session::new(); - path(&mut s); - select(&mut s, &[2], &[]); - let _ = s.execute("edit.copy", &json!({})); - if let Err(EngineError::Internal { cmd, msg }) = s.execute(cmd, j) { - panic!("{cmd} panicked on {j}: {msg}"); + // Both a selection with a text layer next to it, and after a copy from the selection. + for copied in [false, true] { + let mut s = Session::new(); + let id = path(&mut s); + if copied { + select(&mut s, &[2], &[]); + let _ = s.execute("edit.copy", &json!({})); + } else { + select(&mut s, &[1], &[0]); + ex(&mut s, "text.create", json!({"text": "t"})); + ex(&mut s, "vector.edit.begin", json!({"id": id})); + select(&mut s, &[1], &[0]); + } + let before = state(&s, id); + match s.execute(cmd, j) { + Err(EngineError::Internal { cmd, msg }) => panic!("{cmd} panicked on {j}: {msg}"), + Err(_) => { + if cmd != "edit.pasteOver" && cmd != "edit.pasteReplace" { + assert_eq!(state(&s, id), before, "{cmd} {j} was refused but changed something"); + } + } + // Accepted: whatever it made has finite coordinates. + Ok(_) => { + if let Some(n) = crate::vectoredit::network(s.doc().unwrap(), id) { + assert!(finite(n), "{cmd} {j} left non-finite coordinates"); + } + } + } } } } } +#[test] +fn a_huge_paste_position_is_refused_or_stays_finite() { + let mut s = Session::new(); + let id = path(&mut s); + select(&mut s, &[], &[0]); + ex(&mut s, "edit.copy", json!({})); + let before = state(&s, id); + match s.execute("edit.paste", &json!({"x": 1e308, "y": 1e308})) { + Err(e) => { + assert!(!matches!(e, EngineError::Internal { .. }), "{e}"); + assert_eq!(state(&s, id), before, "a refused paste changed something"); + } + // It is accepted here: 1e308 plus a few hundred is still finite, so the points are too. + Ok(_) => assert!(finite(&net(&s, id)), "the points are finite"), + } +} + +#[test] +fn cut_with_only_lone_points_is_refused_like_copy_and_changes_nothing() { + let mut s = Session::new(); + let id = path(&mut s); + // A point no segment touches. + crate::vectoredit::edit(s.doc_mut().unwrap(), id, |n| n.vertices.push(figcraft_doc::Vertex::new(50.0, 50.0))).unwrap(); + // Something on the clipboard first, then only the lone point selected. + select(&mut s, &[0], &[]); + ex(&mut s, "edit.copy", json!({})); + select(&mut s, &[4], &[]); + let before = state(&s, id); + for cmd in ["edit.copy", "edit.cut"] { + let err = s.execute(cmd, &json!({})).expect_err(cmd); + assert!(matches!(err, EngineError::Disabled(..)), "{cmd}: {err}"); + assert_eq!(state(&s, id), before, "{cmd} changed something"); + } + // Delete is the way to remove it. + ex(&mut s, "vector.edit.delete", json!({})); + assert_eq!(net(&s, id).vertices.len(), 4); +} + +#[test] +fn only_one_of_x_and_y_is_refused_and_pastes_nothing() { + let mut s = Session::new(); + let id = path(&mut s); + select(&mut s, &[], &[0]); + ex(&mut s, "edit.copy", json!({})); + let before = state(&s, id); + for p in [json!({"x": 10}), json!({"y": 10})] { + let err = s.execute("edit.paste", &p).expect_err("one coordinate"); + assert!(err.to_string().contains("give both x and y, or neither"), "{err}"); + assert_eq!(state(&s, id), before); + } + ex(&mut s, "edit.paste", json!({"x": 10, "y": 10})); +} + +#[test] +fn a_partial_copy_has_an_svg_for_the_system_clipboard() { + let mut s = Session::new(); + let r = ex(&mut s, "shape.rectangle", json!({"x": 100, "y": 100, "width": 80, "height": 60})); + assert!(crate::cmd::edit::clipboard_svg(&s).is_none(), "nothing copied yet"); + ex(&mut s, "vector.edit.begin", json!({"id": id_of(&r)})); + select(&mut s, &[], &[0, 1, 2, 3]); + ex(&mut s, "edit.copy", json!({})); + let svg = crate::cmd::edit::clipboard_svg(&s).expect("svg"); + assert!(svg.contains(" Date: Sun, 8 Nov 2026 01:47:50 -0500 Subject: [PATCH 025/101] Components: the component button shows its menu arrow, Create component set is offered only where it works; tests for every refusal (#2095 review) Co-Authored-By: Claude Sonnet 5.5 Model-Effort: Opus 5.5 drove; Opus 5.5 briefed; Sonnet 5.5 wrote at medium --- crates/engine/src/cmd/component.rs | 2 +- crates/engine/src/cmd/component/variants.rs | 41 ++++++--- .../engine/src/components_behaviour_tests.rs | 90 +++++++++++++++++++ .../ui-egui/src/create_multiple_menu_tests.rs | 29 ++++++ crates/ui-egui/src/panels/right.rs | 37 +++++--- 5 files changed, 175 insertions(+), 24 deletions(-) diff --git a/crates/engine/src/cmd/component.rs b/crates/engine/src/cmd/component.rs index 06e6bf166..f68fac714 100644 --- a/crates/engine/src/cmd/component.rs +++ b/crates/engine/src/cmd/component.rs @@ -25,7 +25,7 @@ pub(crate) use instance::{swap_at, swap_instance}; use props::{add_prop, bind_prop, delete_prop, edit_prop, set_props}; pub(crate) use props::{apply_prop_bindings, check_prop_binding, describe_props}; use variants::{add_variant, combine, create_set}; -pub use variants::{can_add_variant, can_combine_variants}; +pub use variants::{can_add_variant, can_combine_variants, can_create_set}; /// `component.hideWhenPublishing`: the leading `.` of the names of this file's components and /// sets (those `ids` are or are in), put on or taken off. diff --git a/crates/engine/src/cmd/component/variants.rs b/crates/engine/src/cmd/component/variants.rs index cfba5accf..96de6ba3a 100644 --- a/crates/engine/src/cmd/component/variants.rs +++ b/crates/engine/src/cmd/component/variants.rs @@ -94,6 +94,32 @@ pub(super) fn combine(s: &mut Session, p: &Value) -> Result { Ok(json!({"id": set})) } +/// Why `ids` (distinct) can't each become a component of a new set (`component.createSet`), or +/// `None` when they can: layers inside an instance, library copies, instances, components and +/// component sets, and a layer inside another one of `ids`. +fn create_set_refusal(doc: &Document, ids: &[NodeId]) -> Option<&'static str> { + if ids.iter().any(|i| inside_instance(doc, *i)) { + Some("layers inside an instance can't become components") + } else if ids.iter().any(|i| doc.is_remote(*i)) { + Some(crate::library::READ_ONLY) + } else if ids.iter().any(|i| { + doc.node(*i).is_some_and(|n| matches!(n.kind, NodeKind::Instance { .. } | NodeKind::Component { .. } | NodeKind::ComponentSet { .. })) + }) { + Some("select layers that aren't components, component sets or instances") + } else if roots(doc, ids).len() != ids.len() { + Some("a layer can't be in a set with one inside it") + } else { + None + } +} + +/// Whether "Create component set" is on offer for `ids`: at least one layer that +/// [`create_set_refusal`] lets through. +pub fn can_create_set(doc: &Document, ids: &[NodeId]) -> bool { + let distinct: Vec = ids.iter().copied().collect::>().into_iter().collect(); + !distinct.is_empty() && distinct.iter().all(|i| doc.contains(*i)) && create_set_refusal(doc, &distinct).is_none() +} + /// `component.createSet`: each target becomes a component (as `component.createMultiple` makes /// them) and all are wrapped in place in a component set, 20 px around, named as Figma names them: /// variants "Property 1=" in left-to-right order (a name holding `=` is kept); layers @@ -104,19 +130,8 @@ pub(super) fn create_set(s: &mut Session, p: &Value) -> Result { let mut seen = BTreeSet::new(); let ids: Vec = req_targets(cmd, s, p)?.into_iter().filter(|i| seen.insert(*i)).collect(); let doc = s.doc()?; - if ids.iter().any(|i| inside_instance(doc, *i)) { - return Err(EngineError::Disabled(cmd.into(), "layers inside an instance can't become components".into())); - } - if ids.iter().any(|i| doc.is_remote(*i)) { - return Err(EngineError::Disabled(cmd.into(), crate::library::READ_ONLY.into())); - } - if ids.iter().any(|i| { - doc.node(*i).is_some_and(|n| matches!(n.kind, NodeKind::Instance { .. } | NodeKind::Component { .. } | NodeKind::ComponentSet { .. })) - }) { - return Err(EngineError::Disabled(cmd.into(), "select layers that aren't components, component sets or instances".into())); - } - if roots(doc, &ids).len() != ids.len() { - return Err(EngineError::Disabled(cmd.into(), "a layer can't be in a set with one inside it".into())); + if let Some(why) = create_set_refusal(doc, &ids) { + return Err(EngineError::Disabled(cmd.into(), why.into())); } let mut made = Vec::new(); for i in roots(doc, &ids) { diff --git a/crates/engine/src/components_behaviour_tests.rs b/crates/engine/src/components_behaviour_tests.rs index 510fb2e74..3565a3165 100644 --- a/crates/engine/src/components_behaviour_tests.rs +++ b/crates/engine/src/components_behaviour_tests.rs @@ -1153,3 +1153,93 @@ fn create_set_refuses_a_target_inside_another_target_and_leaves_the_document_alo assert!(matches!(doc.node(frames[0]).unwrap().kind, NodeKind::Frame)); assert!(matches!(doc.node(frames[1]).unwrap().kind, NodeKind::Frame)); } + +/// Every node's id, parent, name and kind, to compare a document before and after a refused command. +fn snapshot(s: &Session) -> Vec { + s.doc().unwrap().nodes().map(|n| format!("{:?}|{:?}|{}|{:?}", n.id, n.parent, n.name, n.kind)).collect() +} + +/// A refused `component.createSet`: `Disabled`, no undo step, the document and the selection as they were. +fn assert_create_set_refused(s: &mut Session, ids: &[NodeId]) { + let (before, undo, selection) = (snapshot(s), undo_len(s), s.selection()); + let e = s.execute("component.createSet", &json!({"ids": ids})).unwrap_err(); + assert!(matches!(e, crate::EngineError::Disabled(..)), "{e:?}"); + assert_eq!(undo_len(s), undo, "no undo step"); + assert_eq!(snapshot(s), before, "the document is unchanged"); + assert_eq!(s.selection(), selection, "the selection is unchanged"); +} + +/// Nothing to wrap is refused before anything is created. +#[test] +fn create_set_refuses_no_layers_and_leaves_the_document_alone() { + let mut s = Session::new(); + named_frames(&mut s, &["A"], false); + s.execute("select.set", &json!({"ids": []})).unwrap(); + assert_create_set_refused(&mut s, &[]); +} + +/// One layer is allowed: a set of one variant, as many layers would make. +#[test] +fn create_set_with_one_layer_makes_a_one_variant_set() { + let mut s = Session::new(); + let frames = named_frames(&mut s, &["Solo"], false); + let before = undo_len(&s); + let out = s.execute("component.createSet", &json!({"ids": frames})).unwrap(); + assert_eq!(undo_len(&s), before + 1, "one undo step"); + let set = id_of(&out["id"]).unwrap(); + let doc = s.doc().unwrap(); + assert_eq!(doc.node(set).unwrap().children.len(), 1); + assert_eq!(names_by_x(&s, set), ["Property 1=Default"], "a lone layer shares its name with itself"); + assert!(matches!(doc.node(doc.node(set).unwrap().children[0]).unwrap().kind, NodeKind::Component { .. })); + s.undo().unwrap(); + assert!(matches!(s.doc().unwrap().node(frames[0]).unwrap().kind, NodeKind::Frame)); +} + +/// Each refusal branch of `create_set`, with `can_create_set` agreeing with it. +#[test] +fn create_set_refuses_every_ineligible_selection_and_leaves_the_document_alone() { + use crate::cmd::component::can_create_set; + let mut s = Session::new(); + let frames = named_frames(&mut s, &["A", "B", "C"], false); + let comp = id_of(&s.execute("component.create", &json!({"ids": [frames[0]]})).unwrap()["id"]).unwrap(); + let inst = id_of(&s.execute("instance.create", &json!({"component": comp})).unwrap()["id"]).unwrap(); + let set_frames = named_frames(&mut s, &["V1", "V2"], false); + let set = id_of(&s.execute("component.createSet", &json!({"ids": set_frames})).unwrap()["id"]).unwrap(); + // A layer inside the instance (its copy of the card's content). + let in_inst = s.doc().unwrap().node(inst).unwrap().children.first().copied(); + // A library copy. + let remote = { + let doc = s.doc_mut().unwrap(); + let store = doc.ensure_library_store(); + let remote = doc.alloc_id(); + doc.insert(Node::new(remote, NodeKind::Frame, "Remote", 10.0, 10.0), store, None).unwrap(); + remote + }; + let ok = frames[1]; + assert!(can_create_set(s.doc().unwrap(), &[ok, frames[2]])); + assert!(!can_create_set(s.doc().unwrap(), &[])); + let mut cases = vec![("instance", inst), ("library copy", remote), ("component", comp), ("component set", set)]; + if let Some(i) = in_inst { + cases.push(("inside an instance", i)); + } + for (what, bad) in cases { + assert!(!can_create_set(s.doc().unwrap(), &[ok, bad]), "{what}: not offered"); + assert_create_set_refused(&mut s, &[ok, bad]); + assert_create_set_refused(&mut s, &[bad]); + } +} + +/// A command that fails leaves no trace: the checks before the creation loop catch every +/// refusal the loop's own commands could hit, and `Session::execute` restores the document, the +/// selection and the undo stack on any error, so no half-made components can survive. +#[test] +fn a_failing_create_set_leaves_no_components_behind() { + let mut s = Session::new(); + let frames = named_frames(&mut s, &["A", "B"], false); + let (before, undo, selection) = (snapshot(&s), undo_len(&s), s.selection()); + let e = s.execute("component.createSet", &json!({"ids": [frames[0], NodeId(u64::MAX)]})); + assert!(e.is_err()); + assert_eq!(undo_len(&s), undo); + assert_eq!(snapshot(&s), before); + assert_eq!(s.selection(), selection); +} diff --git a/crates/ui-egui/src/create_multiple_menu_tests.rs b/crates/ui-egui/src/create_multiple_menu_tests.rs index 409b67e54..60d22a993 100644 --- a/crates/ui-egui/src/create_multiple_menu_tests.rs +++ b/crates/ui-egui/src/create_multiple_menu_tests.rs @@ -134,3 +134,32 @@ fn the_third_entry_creates_one_component_set() { let doc = u.app.session.doc().unwrap(); assert!(ids.iter().all(|i| matches!(doc.node(*i).map(|n| &n.kind), Some(NodeKind::Frame))), "one undo reverts it all"); } + +/// The component button's width in the Design panel: wider with a dropdown chevron beside the icon. +fn button_width(u: &mut Ui) -> f32 { + let all = nodes(u); + let button = all.iter().find(|n| n.label().is_some_and(|l| l.starts_with("Create component"))).expect("the Design panel's component button"); + bounds(button).width() +} + +#[test] +fn the_dropdown_chevron_is_there_only_for_several_layers() { + let (mut one, _) = frames(1); + let (mut two, _) = frames(2); + let (single, several) = (button_width(&mut one), button_width(&mut two)); + assert_eq!(single, 24.0, "one layer: the plain icon button"); + assert_eq!(several, 34.0, "several layers: room for the chevron"); +} + +#[test] +fn create_component_set_is_offered_only_where_it_works() { + let (mut u, ids) = frames(3); + // Make the first a component: the set can't take it, so the entry is left out. + u.app.session.execute("component.create", &json!({"ids": [ids[0]]})).unwrap(); + u.app.session.execute("select.set", &json!({"ids": ids})).unwrap(); + u.frame(vec![]); + click_button(&mut u); + let all = nodes(&mut u); + assert!(all.iter().any(|n| n.label() == Some("Create multiple components")), "the menu is open"); + assert!(all.iter().all(|n| n.label() != Some("Create component set")), "left out for a selection with a component"); +} diff --git a/crates/ui-egui/src/panels/right.rs b/crates/ui-egui/src/panels/right.rs index 55b36ebf5..4d7ce1b19 100644 --- a/crates/ui-egui/src/panels/right.rs +++ b/crates/ui-egui/src/panels/right.rs @@ -494,7 +494,10 @@ fn header(app: &mut FigApp, ui: &mut Ui, doc: &Document, sel: &[NodeId]) { // Layers in boolean groups, or one boolean group: the operation they use (checked in the menu). let current = figcraft_engine::booleans::shown_op(doc, sel); for (icon, label, cmd) in actions.into_iter().rev() { - let br = Rect::from_min_size(pos2(x - 24.0, r.center().y - 12.0), vec2(24.0, 24.0)); + // With several layers the component button is a dropdown: a small chevron sits beside its icon. + let dropdown = cmd == "component.create" && sel.len() > 1; + let bw = if dropdown { 34.0 } else { 24.0 }; + let br = Rect::from_min_size(pos2(x - bw, r.center().y - 12.0), vec2(bw, 24.0)); let tip = if cmd == "bool.union" { label } else { crate::shortcuts::tip(label, cmd) }; let bresp = ui.interact(br, ui.scope_id().with(("qa", cmd)), Sense::click()).tip(tip); if bresp.hovered() { @@ -505,7 +508,11 @@ fn header(app: &mut FigApp, ui: &mut Ui, doc: &Document, sel: &[NodeId]) { ("bool.union", Some(op)) => crate::layers::op_icon(op), _ => icon, }; - icons::paint(ui.painter(), br.shrink(5.0), icon, t.icon); + let icon_rect = Rect::from_min_size(br.min, vec2(24.0, 24.0)).shrink(5.0); + icons::paint(ui.painter(), icon_rect, icon, t.icon); + if dropdown { + icons::paint(ui.painter(), Rect::from_center_size(pos2(br.max.x - 6.0, br.center().y), vec2(8.0, 8.0)), Icon::Chevron, t.icon_secondary); + } if cmd == "bool.union" { menu_popup(&bresp).width(180.0).show(|ui| { for (op, c) in [ @@ -532,14 +539,24 @@ fn header(app: &mut FigApp, ui: &mut Ui, doc: &Document, sel: &[NodeId]) { }); } else if cmd == "component.create" && sel.len() > 1 { // Several layers: the button opens a menu, as Figma's does (#2088). One layer keeps the plain click. - menu_popup(&bresp).width(220.0).show(|ui| { - let multiple = crate::i18n::command("component.createMultiple", "Create multiple components"); - let set = crate::i18n::command("component.createSet", "Create component set"); - for (c, label) in - [("component.create", tr("Create component")), ("component.createMultiple", &multiple), ("component.createSet", &set)] - { + let create = crate::i18n::command("component.create", "Create component"); + let multiple = crate::i18n::command("component.createMultiple", "Create multiple components"); + let set = crate::i18n::command("component.createSet", "Create component set"); + // Like the layers menu, leave out what the selection can't use. + let can_set = figcraft_engine::cmd::component::can_create_set(doc, sel); + let mut entries = vec![("component.create", &create), ("component.createMultiple", &multiple)]; + if can_set { + entries.push(("component.createSet", &set)); + } + // Wide enough for the longest translated label (the rows grow with it, the menu never clips). + let widest = entries + .iter() + .map(|(_, l)| ui.painter().layout_no_wrap(l.to_string(), regular(11.5), Color32::PLACEHOLDER).size().x) + .fold(0.0f32, f32::max); + menu_popup(&bresp).width(menu::menu_row_width(widest, 0.0).ceil().max(160.0)).show(|ui| { + for (c, label) in &entries { let key = crate::shortcuts::shortcut(c).unwrap_or(""); - if menu_icon_item(ui, None, None, label, key) { + if menu_item(ui, label, key) { app.run(c, json!({})); ui.close(); } @@ -548,7 +565,7 @@ fn header(app: &mut FigApp, ui: &mut Ui, doc: &Document, sel: &[NodeId]) { } else if bresp.clicked() { app.run(cmd, json!({})); } - x -= 26.0; + x -= bw + 2.0; } crate::component_panel::instance_section(app, ui, doc, sel); } From b6739cd04f7fad411112a1b70834b0b35646dd4a Mon Sep 17 00:00:00 2001 From: Janiz-zzz <267742026+Janiz-zzz@users.noreply.github.com> Date: Sun, 8 Nov 2026 12:33:55 +0200 Subject: [PATCH 026/101] i18n(fi): translate the 50 labels Finnish lacks; Past year - "Past year" was "Viimeinen vuosi" (the last calendar year); the filter means the last 12 months: "Viimeiset 12 kuukautta" (CodeRabbit on #1993). - 40 UI strings (pick select, field scrubbing, live session reconnect, text direction, padding, variable scopes), 7 command labels, 3 menu wordings. Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/locales/fi.toml | 52 +++++++++++++++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/locales/fi.toml b/crates/ui-egui/locales/fi.toml index 2f5db319a..d240a26b5 100644 --- a/crates/ui-egui/locales/fi.toml +++ b/crates/ui-egui/locales/fi.toml @@ -126,6 +126,7 @@ status = "draft — needs native review" "Another server, or one that needs its key. The usual server is set in Preferences." = "Toinen palvelin tai avainta tarvitseva palvelin. Tavallinen palvelin asetetaan asetuksissa." "Any status" = "Kaikki tilat" "Anyone on your network with this code can edit the file, while this app stays open." = "Kuka tahansa lähiverkossasi voi muokata tiedostoa tällä koodilla niin kauan kuin sovellus on auki." +"Anyone on your network with this code can look at the file, not change it, while this app stays open." = "Kuka tahansa verkossasi oleva voi tällä koodilla katsoa tiedostoa muttei muuttaa sitä, niin kauan kuin tämä sovellus on auki." "Anyone with the edit link can change the file; the view link only lets people look. The links carry their secrets: share them like passwords. `figcraft-server links` makes more and revokes them." = "Kuka tahansa muokkauslinkin saanut voi muuttaa tiedostoa. Katselulinkillä voi vain katsella. Linkit sisältävät salaiset tunnisteet: jaa niitä kuin salasanoja. `figcraft-server links` luo lisää linkkejä ja peruu niitä." "Anyone with this code can edit the file." = "Kuka tahansa tämän koodin saanut voi muokata tiedostoa." "Anyone with this code can look at the file, not change it." = "Kuka tahansa tämän koodin saanut voi katsella tiedostoa, mutta ei muuttaa sitä." @@ -160,6 +161,7 @@ status = "draft — needs native review" "Auto layout" = "Automaattinen asettelu" "Auto rows" = "Automaattiset rivit" "Auto width" = "Automaattinen leveys" +"Auto: by the first letter with a direction" = "Automaattinen: ensimmäisen suunnallisen kirjaimen mukaan" "Back" = "Takaisin" "Back to Ready for dev" = "Palauta kehitysvalmiiksi" "Back to Ready for dev: the next change compares with how it is now" = "Palauta kehitysvalmiiksi: seuraavaa muutosta verrataan nykyiseen tilaan" @@ -224,6 +226,7 @@ status = "draft — needs native review" "Changed {date}" = "Muutettu {date}" "CMYK colour" = "CMYK-väri" "CSS custom properties…" = "CSS:n mukautetut ominaisuudet…" +"Ctrl+click a padding field" = "Ctrl+napsauta sisämarginaalikenttää" "Dart constants for Flutter…" = "Dart-vakiot Flutterille…" "Calculated from other variables; it follows them" = "Lasketaan muista muuttujista ja seuraa niitä" "Can edit" = "Voi muokata" @@ -419,6 +422,7 @@ status = "draft — needs native review" "Delete the style (layers keep their values)" = "Poista tyyli (tasojen arvot säilyvät)" "Delete thread" = "Poista keskustelu" "Delete variable" = "Poista muuttuja" +"Delete {n} variables" = { one = "Poista {n} muuttuja", other = "Poista {n} muuttujaa" } "Delete “{name}”? This can't be undone." = "Poistetaanko ”{name}”? Tätä ei voi kumota." "Density" = "Tiheys" "Depth" = "Syvyys" @@ -450,6 +454,9 @@ status = "draft — needs native review" "Dimensions" = "Mitat" "Direction" = "Suunta" "Disconnect from code" = "Katkaise yhteys koodiin" +"Disconnected. Reconnecting…" = "Yhteys katkesi. Yhdistetään uudelleen…" +"Disconnected. Your edits stay here and sync when the connection returns. Reconnecting…" = "Yhteys katkesi. Muokkauksesi säilyvät täällä ja synkronoituvat, kun yhteys palaa. Yhdistetään uudelleen…" +"Dismiss" = "Ohita" "Dispersion" = "Hajonta" "Display name" = "Näyttönimi" "Dissolve" = "Häivytys" @@ -489,6 +496,7 @@ status = "draft — needs native review" "Edit dev resource" = "Muokkaa kehittäjäresurssia" "Edit link" = "Muokkaa linkkiä" "Edit link copied" = "Muokkauslinkki kopioitu" +"Edit padding on all sides" = "Muokkaa sisämarginaalia kaikilta sivuilta" "Edit style" = "Muokkaa tyyliä" "Edit variable" = "Muokkaa muuttujaa" "Edit with the builder" = "Muokkaa rakentimella" @@ -509,6 +517,7 @@ status = "draft — needs native review" "End vote" = "Lopeta äänestys" "Ends the session; everyone keeps their copy" = "Lopettaa istunnon. Kaikki säilyttävät oman kopionsa." "Enter" = "Enter" +"Enter / Shift+Enter" = "Enter / Shift+Enter" "Enter the address of a figcraft-server and press Browse to see the plugins it offers." = "Anna figcraft-server-palvelimen osoite ja näytä sen tarjoamat liitännäiset painamalla Selaa." "Enter to save · Esc to cancel" = "Tallenna Enterillä · peruuta Escillä" "Eraser" = "Pyyhekumi" @@ -784,6 +793,7 @@ status = "draft — needs native review" "Left padding" = "Vasen sisämarginaali" "Left side" = "Vasen puoli" "Left side width" = "Vasemman puolen leveys" +"Left to right" = "Vasemmalta oikealle" "Letter case" = "Kirjainkoko" "Letter spacing" = "Merkkiväli" "Libraries" = "Kirjastot" @@ -829,13 +839,36 @@ status = "draft — needs native review" "Main menu" = "Päävalikko" "Make a component" = "Luo komponentti" "Make slot" = "Luo sisältöpaikka" +"Move out of any group" = "Siirrä pois kaikista ryhmistä" +"Move to group {group}" = "Siirrä ryhmään {group}" +"Move up or down while dragging its label" = "Siirrä ylös tai alas vetämällä sen otsikkoa" "Nobody shares a file there now." = "Kukaan ei jaa siellä nyt tiedostoa." "New collection" = "Uusi kokoelma" +"Not connected: {reason}. Your work is still in this tab." = "Ei yhteyttä: {reason}. Työsi on yhä tässä välilehdessä." +"Nothing to pick: the page is empty" = "Ei mitään poimittavaa: sivu on tyhjä" "Pasted design layers" = "Liitetyt suunnittelutasot" "Pasted design layers; the clipboard didn't carry the images of: {layers}" = "Suunnittelutasot liitetty; leikepöydällä ei ollut näiden kuvia: {layers}" +"Pick select: Tab and Shift+Tab move between layers, Enter goes into one, Shift+Enter out, Space selects, Escape cancels" = "Poimintavalinta: Tab ja Shift+Tab siirtävät tasojen välillä, Enter siirtyy tason sisään, Shift+Enter ulos, välilyönti valitsee, Escape peruuttaa" +"Pick select: into a layer, out to its parent" = "Poimintavalinta: tason sisään, ulos sen ylätasoon" +"Pick select: next or previous layer" = "Poimintavalinta: seuraava tai edellinen taso" +"Pick select: select the picked layer" = "Poimintavalinta: valitse poimittu taso" "Remove these results from the file" = "Poista nämä tulokset tiedostosta" +"Retry now" = "Yritä nyt uudelleen" +"Right to left" = "Oikealta vasemmalle" +"Same as file ({profile})" = "Sama kuin tiedostossa ({profile})" +"Save a copy…" = "Tallenna kopio…" +"Scope: all supported properties" = "Käyttöalue: kaikki tuetut ominaisuudet" +"Scope: hidden from pickers" = "Käyttöalue: piilotettu valitsimista" +"Scope: only {scope}" = "Käyttöalue: vain {scope}" "Scroll wheel zoom" = "Zoomaus hiiren rullalla" +"Scrub a field faster (2x) or slower (1/2, 1/4)" = "Säädä kenttää vetämällä nopeammin (2x) tai hitaammin (1/2, 1/4)" +"Scrubbing at 1/2" = "Vetosäätö nopeudella 1/2" +"Scrubbing at 1/4" = "Vetosäätö nopeudella 1/4" +"Scrubbing at 1x" = "Vetosäätö nopeudella 1x" +"Scrubbing at 2x" = "Vetosäätö nopeudella 2x" +"Selection box: switch to pick select" = "Valintalaatikko: vaihda poimintavalintaan" "Shared by your team on {server}" = "Tiimisi jakama palvelimella {server}" +"Show and move the placement crosshair (its tool chosen, nothing selected)" = "Näytä ja siirrä sijoitusristikkoa (sen työkalu valittuna, ei valintaa)" "Slot name" = "Sisältöpaikan nimi" "Mar" = "maalisk." "Margin" = "Marginaali" @@ -977,7 +1010,10 @@ status = "draft — needs native review" "Check for updates…" = "Tarkista päivitykset…" "Not checked yet" = "Ei vielä tarkistettu" "Someone who left" = "Joku, joka lähti" +"Space" = "Välilyönti" +"Tab or Ctrl+Space again" = "Tab tai Ctrl+välilyönti uudelleen" "Take the results off the board; they stay in the file" = "Poista tulokset taululta; ne jäävät tiedostoon" +"Text direction" = "Tekstin suunta" "This file uses team libraries on servers you haven't used here. They aren't contacted until you check them." = "Tämä tiedosto käyttää tiimikirjastoja palvelimilla, joita et ole käyttänyt täällä. Niihin ei oteta yhteyttä ennen kuin tarkistat ne." "Not shared" = "Ei jaettu" "Note {n}" = "Huomautus {n}" @@ -1886,6 +1922,7 @@ status = "draft — needs native review" "{name} · published version {v}" = "{name} · julkaistu versio {v}" "{name} · version {v} on the server" = "{name} · versio {v} palvelimella" "{name} ×{n}" = "{name} ×{n}" +"{name}, disconnected from its live session" = "{name}, irrotettu live-istunnostaan" "{name}, in a live session" = "{name}, reaaliaikaisessa istunnossa" "{name}, online, open only to you" = "{name}, verkossa, vain sinun käytössäsi" "{name}, {kind}, {w} by {h}, selected" = "{name}, {kind}, {w} × {h}, valittu" @@ -1944,9 +1981,12 @@ status = "draft — needs native review" "← → ↑ ↓" = "← → ↑ ↓" "→, Space or N" = "→, Space or N" "↵" = "↵" +"↵ / ⇧↵" = "↵ / ⇧↵" "⇥ / ⇧⇥" = "⇥ / ⇧⇥" +"⇥ or ⌥ Space again" = "⇥ tai ⌥ välilyönti uudelleen" "⌘ arrows" = "⌘ arrows" "⌘ click" = "⌘ click" +"⌘ click a padding field" = "⌘-napsauta sisämarginaalikenttää" "⌘ scroll" = "⌘ scroll" "⌥ drag" = "⌥ drag" "1 year" = "1 vuosi" @@ -1968,7 +2008,7 @@ status = "draft — needs native review" "Hide UI" = "Piilota käyttöliittymä" "Past 30 days" = "Viimeiset 30 päivää" "Past 90 days" = "Viimeiset 90 päivää" -"Past year" = "Viimeinen vuosi" +"Past year" = "Viimeiset 12 kuukautta" "Nothing counted yet" = "Mitään ei ole vielä laskettu" "Rotate a degree (Shift: 15)" = "Kierrä asteen verran (Shift: 15)" "⌥⌘ ← ↑ → ↓" = "⌥⌘ ← ↑ → ↓" @@ -2057,6 +2097,7 @@ status = "draft — needs native review" "collab.openFile" = "Avaa verkkotiedosto" "collab.peers" = "Tämän tiedoston käyttäjät" "collab.publish" = "Julkaise palvelimelle" +"collab.reconnect" = "Yhdistä live-istuntoon uudelleen" "collab.recoverFile" = "Palauta verkkotiedosto" "collab.registerLinks" = "Avaa kutsulinkit FigCraftissa" "collab.removePerson" = "Poista istunnosta" @@ -2348,6 +2389,7 @@ status = "draft — needs native review" "selection.applyColorStyle" = "Käytä valinnan värityyliä" "selection.bindColorVariable" = "Käytä valinnan värimuuttujaa" "selection.colors" = "Valinnan värit" +"selection.createColorStyle" = "Luo valinnan värityyli" "selection.detachColor" = "Irrota valinnan väri" "selection.selectColor" = "Valitse tämänväriset tasot" "selection.setPaint" = "Muuta valinnan väriä" @@ -2392,6 +2434,10 @@ status = "draft — needs native review" "text.caseUpper" = "Isot kirjaimet" "text.create" = "Teksti" "text.decoration" = "Koristelu" +"text.direction" = "Tekstin suunta" +"text.directionAuto" = "Tekstin suunta: automaattinen" +"text.directionLtr" = "Tekstin suunta: vasemmalta oikealle" +"text.directionRtl" = "Tekstin suunta: oikealta vasemmalle" "text.edit.begin" = "Muokkaa tekstiä" "text.edit.caret" = "Aseta kohdistin" "text.edit.end" = "Lopeta tekstin muokkaus" @@ -2437,6 +2483,7 @@ status = "draft — needs native review" "tool.arrow" = "Nuoli" "tool.comment" = "Kommentti" "tool.connector" = "Yhdistin" +"tool.crosshair" = "Siirrä sijoitusristikkoa" "tool.ellipse" = "Ellipsi" "tool.eraser" = "Pyyhekumi" "tool.frame" = "Kehys" @@ -2647,6 +2694,9 @@ status = "draft — needs native review" "text.alignJustify" = "Tasaa tekstin molemmat reunat" "text.alignLeft" = "Tasaa teksti vasemmalle" "text.alignRight" = "Tasaa teksti oikealle" +"text.directionAuto" = "Automaattinen" +"text.directionLtr" = "Vasemmalta oikealle" +"text.directionRtl" = "Oikealta vasemmalle" "view.assets" = "Resurssit" "view.design" = "Suunnittelu" "view.layers" = "Tasot" From 10d97e2716a7b68724e95c3326425ab58f4681fe Mon Sep 17 00:00:00 2001 From: NetterSilver <133535268+Silvertree2010@users.noreply.github.com> Date: Sun, 8 Nov 2026 11:00:14 +0000 Subject: [PATCH 027/101] Reject negative or fractional index in node.reparent Found while testing crates/engine/src/cmd/edit/props.rs:248 (reparent, `index = num(p, "index").map(|i| i.max(0.0) as usize)`) Co-Authored-By: Claude Haiku 5.5 Co-Authored-By: Claude Sonnet 5.5 --- crates/engine/src/cmd/edit/props.rs | 2 +- crates/engine/src/panels_behaviour_tests.rs | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/crates/engine/src/cmd/edit/props.rs b/crates/engine/src/cmd/edit/props.rs index fb8a1c17f..e7f04d7a1 100644 --- a/crates/engine/src/cmd/edit/props.rs +++ b/crates/engine/src/cmd/edit/props.rs @@ -245,7 +245,7 @@ pub(super) fn stroke_brush(s: &mut Session, p: &Value) -> Result { pub(super) fn reparent(s: &mut Session, p: &Value) -> Result { let ids = req_targets("node.reparent", s, p)?; let parent = req_id("node.reparent", p, "parent")?; - let index = num(p, "index").map(|i| i.max(0.0) as usize); + let index = opt_index("node.reparent", p, "index")?; let doc = s.doc_mut()?; let ids = z_sorted(doc, &roots(doc, &ids)); // `index` is where the first moved layer ends up among the parent's children (bottom first), diff --git a/crates/engine/src/panels_behaviour_tests.rs b/crates/engine/src/panels_behaviour_tests.rs index 585fc3e08..60450dcbe 100644 --- a/crates/engine/src/panels_behaviour_tests.rs +++ b/crates/engine/src/panels_behaviour_tests.rs @@ -200,6 +200,22 @@ fn reparent_index_is_the_final_position_in_auto_layout_and_across_parents() { assert!(kids(&s, row).is_empty()); } +#[test] +fn reparent_rejects_a_negative_or_fractional_index() { + let mut s = Session::new(); + let frame = id(&ex(&mut s, "node.create", json!({"type": "frame", "name": "F"}))); + let rect = |s: &mut Session, n: &str, parent: NodeId| id(&ex(s, "node.create", json!({"type": "rectangle", "name": n, "parent": parent}))); + let (a, b) = (rect(&mut s, "a", frame), rect(&mut s, "b", frame)); + let free = id(&ex(&mut s, "node.create", json!({"type": "rectangle", "name": "free"}))); + for bad in [json!(-1), json!(1.5), json!("x")] { + let r = s.execute("node.reparent", &json!({"ids": [free], "parent": frame, "index": bad})); + assert!(r.is_err(), "index {bad} accepted"); + assert_eq!(kids(&s, frame), [a, b], "the tree is unchanged for index {bad}"); + } + ex(&mut s, "node.reparent", json!({"ids": [free], "parent": frame, "index": 0})); + assert_eq!(kids(&s, frame), [free, a, b]); +} + #[test] fn renaming_several_layers_by_the_documented_codes() { // Three layers named `names`, bottom to top; (names, params, new names, derivation). From 6222fce8d13289dc30f909df17b3ae3f913bfeb0 Mon Sep 17 00:00:00 2001 From: NetterSilver <133535268+Silvertree2010@users.noreply.github.com> Date: Sun, 8 Nov 2026 12:22:45 +0000 Subject: [PATCH 028/101] Reject signs and exponents in ExportSize::parse Found while testing crates/doc/src/props.rs:1394 (ExportSize::parse, `num.parse::()`) Co-Authored-By: Claude Haiku 5.5 Co-Authored-By: Claude Sonnet 5.5 --- crates/doc/src/props.rs | 4 ++++ crates/engine/src/import_export_tests.rs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/doc/src/props.rs b/crates/doc/src/props.rs index 99b9d9c39..15d557d88 100644 --- a/crates/doc/src/props.rs +++ b/crates/doc/src/props.rs @@ -1399,6 +1399,10 @@ impl ExportSize { Some((i, c)) if c.is_ascii_alphabetic() => (s.get(..i)?.trim(), Some(c)), _ => (s.as_str(), None), }; + // Plain decimal only: no sign, exponent, "inf" or "nan". + if !num.bytes().all(|b| b.is_ascii_digit() || b == b'.') { + return None; + } let value: f64 = num.parse().ok()?; match unit { None | Some('x') => ExportSize::Scale { value }, diff --git a/crates/engine/src/import_export_tests.rs b/crates/engine/src/import_export_tests.rs index 4acc86216..fdc8b29d4 100644 --- a/crates/engine/src/import_export_tests.rs +++ b/crates/engine/src/import_export_tests.rs @@ -283,7 +283,7 @@ fn export_sizes_parse_and_label() { assert_eq!(ExportSize::parse(text), Some(want), "{text}"); assert_eq!(ExportSize::parse(&want.label()), Some(want)); } - for bad in ["", "x", "0x", "-1x", "NaNx", "infx", "65x", "20000w", "2q", "2xx"] { + for bad in ["", "x", "0x", "-1x", "NaNx", "infx", "65x", "20000w", "2q", "2xx", "+2x", "+512w", "2e0x", "2E0x", "+0.5x"] { assert_eq!(ExportSize::parse(bad), None, "{bad}"); } let e = |size, suffix: &str, format| ExportSetting { size, suffix: suffix.into(), format, ..Default::default() }; From a6be897d3141f11f396cdf5a63a797463d69428b Mon Sep 17 00:00:00 2001 From: Giovanni Almeida Date: Sun, 8 Nov 2026 13:53:24 -0300 Subject: [PATCH 029/101] M6: a vector point without a corner radius of its own takes the layer's on .fig import (#2114) Figma rounds every point whose style doesn't set a corner radius with the layer's cornerRadius. The import read only the point's style, so those vectors came in sharp. Points now fall back to the layer's radius, at the scale of the layer that carries it (#2091), and the network cache keys on it. The export writes an explicit 0 for a sharp point on a rounded vector so it stays sharp. --- contributors/people.toml | 3 + crates/format/src/fig/export/shape.rs | 4 +- crates/format/src/fig/export_tests.rs | 19 ++++++ crates/format/src/fig/map.rs | 5 +- crates/format/src/fig/map/layer.rs | 7 ++- crates/format/src/fig/tail_tests.rs | 90 +++++++++++++++++++++++++++ 6 files changed, 123 insertions(+), 5 deletions(-) diff --git a/contributors/people.toml b/contributors/people.toml index c6924df5f..34f849ed7 100644 --- a/contributors/people.toml +++ b/contributors/people.toml @@ -115,3 +115,6 @@ display_name = "Hamza0101" [people.ashokram-si] real_name = "Ashok Ram" + +[people.GiovanniBot] +sync_github_name = true diff --git a/crates/format/src/fig/export/shape.rs b/crates/format/src/fig/export/shape.rs index ca5846cde..bfc2b0224 100644 --- a/crates/format/src/fig/export/shape.rs +++ b/crates/format/src/fig/export/shape.rs @@ -207,7 +207,9 @@ impl<'d> Exporter<'d> { .enumerate() .map(|(i, v)| { let mut st: Fields = Vec::new(); - if v.radius > 0.0 { + // A point without a radius of its own is drawn with the layer's, so a sharp + // point on a rounded layer says so. + if v.radius > 0.0 || n.corners.radii[0] > 0.0 { st.push(("cornerRadius", fl(v.radius))); } if let Some(m) = v.mirror { diff --git a/crates/format/src/fig/export_tests.rs b/crates/format/src/fig/export_tests.rs index 9651a1025..4fd533545 100644 --- a/crates/format/src/fig/export_tests.rs +++ b/crates/format/src/fig/export_tests.rs @@ -955,6 +955,25 @@ fn closed_vector_geometry_is_written_with_its_corner_smoothing() { assert_eq!(radii, vec![20.0, 0.0, 10.0, 0.0], "each point keeps its own radius"); } +#[test] +fn sharp_points_on_a_rounded_vector_stay_sharp() { + // A point without a radius takes the layer's when read, so a sharp point on a vector with a + // layer radius is written with its own zero. + let mut doc = Document::new("sharp point"); + let page = doc.first_page().unwrap(); + let mut network = VectorNetwork::from_points(&[(0.0, 0.0), (100.0, 0.0), (100.0, 100.0), (0.0, 100.0)].map(|(x, y)| Point::new(x, y)), true); + for (v, r) in network.vertices.iter_mut().zip([8.0, 0.0, 8.0, 0.0]) { + v.radius = r; + } + let id = doc.create(page, NodeKind::Vector { network }, "V", 0.0, 0.0, 100.0, 100.0).unwrap(); + doc.node_mut(id).unwrap().corners.radii = [8.0; 4]; + let (back, _) = round_trip(&doc, "sharp point"); + let v = back.nodes().find(|n| matches!(n.kind, NodeKind::Vector { .. })).unwrap(); + let NodeKind::Vector { network } = &v.kind else { panic!("vector") }; + let radii: Vec = network.vertices.iter().map(|x| x.radius).collect(); + assert_eq!(radii, vec![8.0, 0.0, 8.0, 0.0]); +} + #[test] fn the_written_schema_parses_and_round_trips() { let schema = Schema::parse(export::SCHEMA).unwrap(); diff --git a/crates/format/src/fig/map.rs b/crates/format/src/fig/map.rs index fd1b47575..aa0db5cf4 100644 --- a/crates/format/src/fig/map.rs +++ b/crates/format/src/fig/map.rs @@ -356,8 +356,9 @@ struct Mapper<'a> { /// holding it) name it by `vectorNetworkRef`. Kept out of the JSON, where a large file's /// networks took gigabytes. networks: Vec>, - /// Index in `networks` by its blob, position scale, style table and point-radius scale. - network_ids: HashMap<(usize, u64, u64, usize, u64), usize>, + /// Index in `networks` by its blob, position scale, style table, point-radius scale and the + /// layer's corner radius (which points without one of their own take). + network_ids: HashMap<(usize, u64, u64, usize, u64, u64), usize>, /// Region paint elements (paints and gradient stops) read so far: one budget for the whole /// file, since layers with region paints don't share their network. region_paint_elements: usize, diff --git a/crates/format/src/fig/map/layer.rs b/crates/format/src/fig/map/layer.rs index e3de96368..a69bb7d46 100644 --- a/crates/format/src/fig/map/layer.rs +++ b/crates/format/src/fig/map/layer.rs @@ -668,6 +668,8 @@ impl<'a> Mapper<'a> { size.zip(norm).filter(|(s, n)| s.is_finite() && *n > 1e-9).map_or(1.0, |(s, n)| s / n) }; let (sx, sy) = (scale("x"), scale("y")); + // A point whose style doesn't set a radius takes the layer's, as the editor draws it. + let layer_radius = v.len("cornerRadius"); let vertices: Vec = net .vertices .iter() @@ -676,7 +678,7 @@ impl<'a> Mapper<'a> { let st = style(p.style); // Point radii are lengths in this row's space, unlike the normalized positions. // An override/derived row already carries the instance's scale. - if let Some(r) = st.and_then(|s| num(s, "cornerRadius")).and_then(|r| scaled(r, radius_scale)).filter(|r| *r > 0.0) { + if let Some(r) = st.and_then(|s| num(s, "cornerRadius")).and_then(|r| scaled(r, radius_scale)).or(layer_radius).filter(|r| *r > 0.0) { out["radius"] = json!(r); } match st.and_then(|s| s.get("handleMirroring")).and_then(Kv::str) { @@ -793,7 +795,8 @@ impl<'a> Mapper<'a> { return true; } // A resized instance and a K-scaled one can have the same box but different radii. - let key = (blob_id, sx.to_bits(), sy.to_bits(), std::ptr::from_ref(vd) as usize, radius_scale.to_bits()); + let key = + (blob_id, sx.to_bits(), sy.to_bits(), std::ptr::from_ref(vd) as usize, radius_scale.to_bits(), layer_radius.unwrap_or(0.0).to_bits()); let id = match self.network_ids.get(&key) { Some(id) => *id, None => { diff --git a/crates/format/src/fig/tail_tests.rs b/crates/format/src/fig/tail_tests.rs index 176c95c9b..663d6002b 100644 --- a/crates/format/src/fig/tail_tests.rs +++ b/crates/format/src/fig/tail_tests.rs @@ -521,6 +521,96 @@ fn network_of<'d>(doc: &'d figcraft_doc::Document, name: &str) -> &'d figcraft_d } } +#[test] +fn vector_points_without_a_radius_of_their_own_take_the_layers() { + // A vector rounded from the layer's corner radius: the editor rounds every point whose + // style doesn't set a radius (no style, or one without `cornerRadius`) with the layer's, + // while a point's own radius, zero included, wins. + let mut message = tail_message(); + let Kv::Array(nodes) = field_mut(&mut message, "nodeChanges").unwrap() else { panic!() }; + let wave = nodes.iter_mut().find(|node| node.get("name").and_then(Kv::str) == Some("Wave")).unwrap(); + let Kv::Object(fields) = wave else { panic!() }; + fields.push(("cornerRadius", f(6.0))); + let vector_data = field_mut(wave, "vectorData").unwrap(); + let Kv::Array(styles) = field_mut(vector_data, "styleOverrideTable").unwrap() else { panic!() }; + let Kv::Object(sharp) = styles.get_mut(2).unwrap() else { panic!() }; + sharp.push(("cornerRadius", f(0.0))); + let (doc, _) = import(&canvas(&schema(), &message), "Rounded").unwrap(); + let radii: Vec = network_of(&doc, "Wave").vertices.iter().map(|v| v.radius).collect(); + assert_eq!(radii, [6.0, 4.0, 6.0, 0.0], "no style, own radius, style without one, own zero"); + // Without a layer radius, the points without one of their own stay sharp. + let (doc, _) = import(&tail_canvas(), "Tail").unwrap(); + let radii: Vec = network_of(&doc, "Wave").vertices.iter().map(|v| v.radius).collect(); + assert_eq!(radii, [0.0, 4.0, 0.0, 0.0]); +} + +#[test] +fn an_instance_that_rounds_a_vector_keeps_its_own_points() { + // An instance's copy shares its main's vector data; overriding the layer's radius must not + // reuse the main's network, nor hand the instance's to the main. + let mut message = tail_message(); + let Kv::Array(nodes) = field_mut(&mut message, "nodeChanges").unwrap() else { panic!() }; + let wave = nodes.iter_mut().find(|node| node.get("name").and_then(Kv::str) == Some("Wave")).unwrap(); + *field_mut(wave, "parentIndex").unwrap() = o(vec![("guid", g(50)), ("position", s("!"))]); + *field_mut(wave, "transform").unwrap() = at(0.0, 0.0); + let rounded = o(vec![("guidPath", o(vec![("guids", arr(vec![g(30)]))])), ("cornerRadius", f(6.0))]); + nodes.push(node(50, Some((1, "~")), "SYMBOL", "Mark", vec![("size", xy(200.0, 100.0)), ("transform", at(700.0, 0.0))])); + nodes.push(node( + 51, + Some((1, "~!")), + "INSTANCE", + "Rounded mark", + vec![ + ("size", xy(200.0, 100.0)), + ("transform", at(700.0, 400.0)), + ("symbolData", o(vec![("symbolID", g(50)), ("symbolOverrides", arr(vec![rounded]))])), + ], + )); + let (doc, _) = import(&canvas(&schema(), &message), "Instance").unwrap(); + let radii_under = |parent: &str| -> Vec { + let p = named(&doc, parent); + let wave = p.children.iter().map(|c| doc.node(*c).unwrap()).find(|n| n.name == "Wave").unwrap(); + let NodeKind::Vector { network } = &wave.kind else { panic!() }; + network.vertices.iter().map(|v| v.radius).collect() + }; + assert_eq!(radii_under("Mark"), [0.0, 4.0, 0.0, 0.0]); + assert_eq!(radii_under("Rounded mark"), [6.0, 4.0, 6.0, 6.0]); +} + +#[test] +fn a_scaled_instance_scales_its_vectors_point_radii() { + // Point radii are lengths: an instance scaled with the Scale tool draws its main's, from a + // point's own style or from the layer, times the factor (#2091). + let mut message = tail_message(); + let Kv::Array(nodes) = field_mut(&mut message, "nodeChanges").unwrap() else { panic!() }; + let wave = nodes.iter_mut().find(|node| node.get("name").and_then(Kv::str) == Some("Wave")).unwrap(); + *field_mut(wave, "parentIndex").unwrap() = o(vec![("guid", g(50)), ("position", s("!"))]); + *field_mut(wave, "transform").unwrap() = at(0.0, 0.0); + let Kv::Object(fields) = wave else { panic!() }; + fields.push(("cornerRadius", f(3.0))); + nodes.push(node(50, Some((1, "~")), "SYMBOL", "Mark", vec![("size", xy(200.0, 100.0)), ("transform", at(700.0, 0.0))])); + nodes.push(node( + 51, + Some((1, "~!")), + "INSTANCE", + "Big mark", + vec![ + ("size", xy(400.0, 200.0)), + ("transform", at(700.0, 400.0)), + ("symbolData", o(vec![("symbolID", g(50)), ("uniformScaleFactor", f(2.0))])), + ], + )); + let (doc, _) = import(&canvas(&schema(), &message), "Scaled").unwrap(); + let radii_under = |parent: &str| -> Vec { + let p = named(&doc, parent); + let wave = p.children.iter().map(|c| doc.node(*c).unwrap()).find(|n| n.name == "Wave").unwrap(); + let NodeKind::Vector { network } = &wave.kind else { panic!() }; + network.vertices.iter().map(|v| v.radius).collect() + }; + assert_eq!(radii_under("Mark"), [3.0, 4.0, 3.0, 3.0]); + assert_eq!(radii_under("Big mark"), [6.0, 8.0, 6.0, 6.0]); +} + #[test] fn vectors_import_as_editable_networks() { let (doc, warnings) = import(&tail_canvas(), "Tail").unwrap(); From a6d9b74df9b1d52e1c15ecc6f5e43a9694ac55ce Mon Sep 17 00:00:00 2001 From: impulsado <72570835+impulsado@users.noreply.github.com> Date: Sun, 8 Nov 2026 18:23:08 +0100 Subject: [PATCH 030/101] M3: resolve inherited slot properties by their defining component --- crates/engine/src/assets/components/sync.rs | 23 +++- crates/engine/src/slot_tests.rs | 119 ++++++++++++++++++++ 2 files changed, 137 insertions(+), 5 deletions(-) diff --git a/crates/engine/src/assets/components/sync.rs b/crates/engine/src/assets/components/sync.rs index 7b34c33c2..17836b111 100644 --- a/crates/engine/src/assets/components/sync.rs +++ b/crates/engine/src/assets/components/sync.rs @@ -34,7 +34,7 @@ pub(super) fn sync_instance_depth(doc: &mut Document, inst: NodeId, depth: usize let nid = doc.alloc_id(); map.insert(s, nid); } - let Copies { nodes: new_nodes, nested, mut remeasure } = copy_layers(doc, inst, &src, &map, &old, &edited, eff_props); + let Copies { nodes: new_nodes, nested, mut remeasure } = copy_layers(doc, inst, component, &src, &map, &old, &edited, eff_props); for n in new_nodes { let (id, parent) = (n.id, n.parent); if insert_linked(doc, n).is_err() @@ -132,6 +132,7 @@ struct Copies { fn copy_layers( doc: &Document, inst: NodeId, + component: NodeId, src: &[NodeId], map: &BTreeMap, old: &BTreeMap>, @@ -139,7 +140,7 @@ fn copy_layers( props: BTreeMap, ) -> Copies { let mut enclosing: BTreeMap> = BTreeMap::from([(inst, vec![inst])]); - let mut inst_props: BTreeMap> = BTreeMap::from([(inst, props)]); + let mut inst_props: BTreeMap)> = BTreeMap::from([(inst, (component, props))]); let mut out = Copies { nodes: Vec::new(), nested: Vec::new(), remeasure: Vec::new() }; for s in src { let Some(orig) = doc.node(*s) else { continue }; @@ -169,7 +170,7 @@ fn copy_layers( let enc = enclosing.get(&parent).cloned().unwrap_or_default(); apply_enclosing_props(doc, &mut n, orig, &enc, &inst_props); if let NodeKind::Instance { component: c, props } = &n.kind { - inst_props.insert(nid, props.clone()); + inst_props.insert(nid, (*c, props.clone())); let mut e = enc; e.push(nid); enclosing.insert(nid, e); @@ -253,14 +254,26 @@ fn rebuild_nested(doc: &mut Document, nested: Vec, old: &BTreeMap>) { +fn apply_enclosing_props( + doc: &Document, + n: &mut Node, + orig: &Node, + enc: &[NodeId], + inst_props: &BTreeMap)>, +) { let mut chain: Vec<&Node> = vec![orig]; while chain.len() < enc.len() { let Some(next) = chain.last().and_then(|c| c.source).and_then(|x| doc.node(x)) else { break }; chain.push(next); } for (j, level) in chain.iter().enumerate().rev() { - let Some(props) = enc.get(j).and_then(|e| inst_props.get(e)) else { continue }; + if level.prop_refs.is_empty() { + continue; + } + let Some(owner) = owning_component(doc, level.id) else { continue }; + // Instance-owned slot content skips a source hop through the slot's component. Match + // the binding's defining component, not the position in the enclosing instance chain. + let Some((_, props)) = enc.iter().rev().filter_map(|e| inst_props.get(e)).find(|(component, _)| *component == owner) else { continue }; for (field, prop) in &level.prop_refs { let g = field_group(field); if n.overrides.contains(g) || (j > 0 && orig.overrides.contains(g)) { diff --git a/crates/engine/src/slot_tests.rs b/crates/engine/src/slot_tests.rs index 01a5db08e..a3f9c868a 100644 --- a/crates/engine/src/slot_tests.rs +++ b/crates/engine/src/slot_tests.rs @@ -376,6 +376,125 @@ fn slots_of_nested_instances_fill_from_the_outer_main_and_its_instances() { assert_eq!(fill(&s, *kids(&s, nslot).first().unwrap()), "CCCCCC", "content no longer follows the Card main"); } +/// Wrap a component instance in another main, keeping the nested instance addressable. +fn slot_text_wrapper(s: &mut Session, component: NodeId, name: &str) -> (NodeId, NodeId) { + let frame = idv(&ex(s, "frame.create", json!({"width": 300, "height": 200, "name": name}))); + let nested = idv(&ex(s, "instance.create", json!({"component": component, "parent": frame}))); + (idv(&ex(s, "component.create", json!({"ids": [frame]}))), nested) +} + +/// Content.Label binds Text; Composition holds Base, whose Body uses default or own Content. +/// Returns (Content main, Label, Base main, Composition main, nested Content instance). +fn slot_text_composition(s: &mut Session, own: bool) -> (NodeId, NodeId, NodeId, NodeId, NodeId) { + let frame = idv(&ex(s, "frame.create", json!({"width": 100, "height": 40, "name": "Content"}))); + let label = idv(&ex(s, "text.create", json!({"text": "Default", "parent": frame, "props": {"name": "Label"}}))); + let content = idv(&ex(s, "component.create", json!({"ids": [frame]}))); + ex(s, "component.addProperty", json!({"id": content, "name": "Text", "type": "text", "default": "Default", "layer": label})); + let frame = idv(&ex(s, "frame.create", json!({"width": 200, "height": 100, "name": "Base"}))); + let body = idv(&ex(s, "frame.create", json!({"width": 180, "height": 80, "name": "Body", "parent": frame}))); + let default = (!own).then(|| idv(&ex(s, "instance.create", json!({"component": content, "parent": body})))); + let base = idv(&ex(s, "component.create", json!({"ids": [frame]}))); + ex(s, "component.makeSlot", json!({"id": body})); + let (composition, nested_base) = slot_text_wrapper(s, base, "Composition"); + let nested_content = if let Some(default) = default { + copy_of(s, nested_base, default) + } else { + idv(&ex(s, "instance.slotInsert", json!({"id": nested_base, "slot": "Body", "component": content}))) + }; + (content, label, base, composition, nested_content) +} + +fn assert_slot_text(s: &mut Session, instance: NodeId, expected: &str) { + let label = kids(s, instance)[0]; + let characters = node(s, label).kind.text().unwrap().characters.clone(); + let html = ex(s, "inspect.code", json!({"id": instance, "language": "html"}))["code"].as_str().unwrap().to_string(); + assert_eq!(characters, expected, "slot Label characters; HTML: {html}"); + assert!(html.contains(&format!(">{expected}

")), "slot Label HTML: {html}"); +} + +fn assert_local_slot_text(s: &mut Session, instance: NodeId, expected: &str) { + assert!(matches!(&node(s, instance).kind, NodeKind::Instance { props, .. } if props.get("Text") == Some(&json!(expected)))); + let properties = props_of(s, instance); + assert_eq!(properties.iter().find(|p| p["name"] == "Text").unwrap()["value"], expected); +} + +#[test] +fn slot_text_properties_stay_local_in_default_and_own_content() { + for own in [false, true] { + let mut s = Session::new(); + let (content, label, _base, composition, main_content) = slot_text_composition(&mut s, own); + let a = idv(&ex(&mut s, "instance.create", json!({"component": composition, "x": 400}))); + let b = idv(&ex(&mut s, "instance.create", json!({"component": composition, "x": 800}))); + let ac = copy_of(&s, a, main_content); + let bc = copy_of(&s, b, main_content); + ex(&mut s, "instance.setProperties", json!({"ids": [ac], "properties": {"Text": "Custom"}})); + assert_local_slot_text(&mut s, ac, "Custom"); + assert_slot_text(&mut s, ac, "Custom"); + assert_slot_text(&mut s, bc, "Default"); + assert_slot_text(&mut s, main_content, "Default"); + assert_eq!(node(&s, label).kind.text().unwrap().characters, "Default"); + // Main property edits propagate without replacing another instance's local value. + ex(&mut s, "instance.setProperties", json!({"ids": [main_content], "properties": {"Text": "Main value"}})); + assert_slot_text(&mut s, ac, "Custom"); + assert_slot_text(&mut s, bc, "Main value"); + assert_slot_text(&mut s, main_content, "Main value"); + ex(&mut s, "component.editProperty", json!({"id": content, "name": "Text", "default": "New default"})); + assert_slot_text(&mut s, ac, "Custom"); + assert_slot_text(&mut s, bc, "Main value"); + healthy(&s); + } +} + +#[test] +fn slot_text_properties_do_not_read_an_unbound_base_property() { + let mut s = Session::new(); + let (_content, _label, base, composition, main_content) = slot_text_composition(&mut s, true); + ex(&mut s, "component.addProperty", json!({"id": base, "name": "Text", "type": "text", "default": "Wrong owner"})); + let i = idv(&ex(&mut s, "instance.create", json!({"component": composition, "x": 400}))); + let nested = copy_of(&s, i, main_content); + assert_slot_text(&mut s, nested, "Default"); + ex(&mut s, "instance.setProperties", json!({"ids": [nested], "properties": {"Text": "Custom"}})); + assert_local_slot_text(&mut s, nested, "Custom"); + assert_slot_text(&mut s, nested, "Custom"); + assert_slot_text(&mut s, main_content, "Default"); + healthy(&s); +} + +#[test] +fn slot_text_properties_survive_inherited_own_content_and_persistence() { + let mut s = Session::new(); + let (_content, _label, _base, composition, main_content) = slot_text_composition(&mut s, true); + let (outer, inherited) = slot_text_wrapper(&mut s, composition, "Outer composition"); + let inherited_content = copy_of(&s, inherited, main_content); + let a = idv(&ex(&mut s, "instance.create", json!({"component": outer, "x": 400}))); + let b = idv(&ex(&mut s, "instance.create", json!({"component": outer, "x": 800}))); + let ac = copy_of(&s, a, inherited_content); + let bc = copy_of(&s, b, inherited_content); + ex(&mut s, "instance.setProperties", json!({"ids": [ac], "properties": {"Text": "Custom"}})); + assert_local_slot_text(&mut s, ac, "Custom"); + let bytes = figcraft_format::save_bytes(s.doc().unwrap(), None).unwrap(); + let (back, _) = figcraft_format::load_bytes(&bytes).unwrap(); + let mut s = Session::with_document(back); + assert_local_slot_text(&mut s, ac, "Custom"); + assert_slot_text(&mut s, ac, "Custom"); + assert_slot_text(&mut s, bc, "Default"); + assert_slot_text(&mut s, inherited_content, "Default"); + assert_slot_text(&mut s, main_content, "Default"); + // Explicit characters override the bound property, even after a main update. + let alabel = kids(&s, ac)[0]; + ex(&mut s, "text.set", json!({"id": alabel, "characters": "Explicit"})); + ex(&mut s, "instance.setProperties", json!({"ids": [ac], "properties": {"Text": "Later"}})); + ex(&mut s, "instance.setProperties", json!({"ids": [main_content], "properties": {"Text": "Main value"}})); + assert_local_slot_text(&mut s, ac, "Later"); + assert_slot_text(&mut s, ac, "Explicit"); + assert_slot_text(&mut s, bc, "Main value"); + ex(&mut s, "component.resetOverride", json!({"id": alabel, "group": "characters"})); + assert_slot_text(&mut s, ac, "Later"); + s.undo().unwrap(); + assert_slot_text(&mut s, ac, "Explicit"); + healthy(&s); +} + /// Random slot edits, main edits and resets keep every instance mirroring its main. #[test] fn random_slot_edits_keep_instances_consistent() { From 0ff3a3682ea8b2e2df68fab3156c2c99d4b8c442 Mon Sep 17 00:00:00 2001 From: NetterSilver <133535268+Silvertree2010@users.noreply.github.com> Date: Sun, 8 Nov 2026 19:22:04 +0000 Subject: [PATCH 031/101] Reject negative and fractional index in file.openRecent Found while testing crates/engine/src/cmd/file/open.rs:33 (open_recent, `.nth(i.max(0.0) as usize)`) Co-Authored-By: Claude Haiku 5.5 Co-Authored-By: Claude Sonnet 5.5 --- crates/engine/src/cmd/file/open.rs | 5 ++++- crates/engine/src/menu_gaps_tests.rs | 17 +++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/crates/engine/src/cmd/file/open.rs b/crates/engine/src/cmd/file/open.rs index e4c3e0fb7..b6e154c35 100644 --- a/crates/engine/src/cmd/file/open.rs +++ b/crates/engine/src/cmd/file/open.rs @@ -31,7 +31,10 @@ pub(super) fn open_recent(s: &mut Session, p: &Value) -> Result { Some(path) } (None, Some(i)) => { - Some(s.prefs.recent_files.iter().filter(|r| listed(r)).nth(i.max(0.0) as usize).cloned().ok_or_else(|| bad(CMD, "no such recent file"))?) + if !(i >= 0.0 && i.fract() == 0.0) { + return Err(bad(CMD, "no such recent file")); + } + Some(s.prefs.recent_files.iter().filter(|r| listed(r)).nth(i as usize).cloned().ok_or_else(|| bad(CMD, "no such recent file"))?) } _ => None, }; diff --git a/crates/engine/src/menu_gaps_tests.rs b/crates/engine/src/menu_gaps_tests.rs index 057c5119a..fa32f5d8f 100644 --- a/crates/engine/src/menu_gaps_tests.rs +++ b/crates/engine/src/menu_gaps_tests.rs @@ -84,3 +84,20 @@ fn outlined_layers_draw_as_outlines_and_the_rest_normally() { assert_eq!(outlined.pixel(20, 20).unwrap(), empty, "only its outline"); assert_eq!(outlined.pixel(80, 20).unwrap(), plain.pixel(80, 20).unwrap(), "the other layer draws normally"); } + +#[test] +fn open_recent_rejects_negative_and_fractional_index() { + let dir = std::env::temp_dir().join(format!("figcraft-recent-bad-{}", std::process::id())); + std::fs::create_dir_all(&dir).unwrap(); + let a = dir.join("a.figcraft").to_string_lossy().to_string(); + let b = dir.join("b.figcraft").to_string_lossy().to_string(); + let mut s = Session::new(); + s.execute("file.save", &json!({"path": a})).unwrap(); + s.execute("file.saveAs", &json!({"path": b})).unwrap(); + let recent = s.prefs.recent_files.clone(); + for i in [json!(-1), json!(1.5), json!(-0.5)] { + assert!(s.execute("file.openRecent", &json!({"index": i})).is_err(), "index {i} must be an error"); + } + assert_eq!(s.prefs.recent_files, recent); + let _ = std::fs::remove_dir_all(&dir); +} From 9c2c2cb74eb3a960dc3f36ab55bd7e603a1e2601 Mon Sep 17 00:00:00 2001 From: Davit Matchakhelidze Date: Mon, 9 Nov 2026 00:59:12 +0400 Subject: [PATCH 032/101] i18n(ka): place the new rows next to their English keys (review) --- crates/ui-egui/locales/ka.toml | 228 ++++++++++++++++----------------- 1 file changed, 114 insertions(+), 114 deletions(-) diff --git a/crates/ui-egui/locales/ka.toml b/crates/ui-egui/locales/ka.toml index 8a4a70475..80b99a957 100644 --- a/crates/ui-egui/locales/ka.toml +++ b/crates/ui-egui/locales/ka.toml @@ -16,7 +16,10 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "({n} warnings: some entries were skipped)" = { one = "(გაფრთხილება: {n}; ზოგი ჩანაწერი გამოტოვებულია)", other = "(გაფრთხილება: {n}; ზოგი ჩანაწერი გამოტოვებულია)" } "+ Create variable" = "+ ცვლადის შექმნა" ".fig (experimental)" = ".fig (ექსპერიმენტული)" +"1 year" = "1 წელი" "1…9, 0" = "1…9, 0" +"30 days" = "30 დღე" +"90 days" = "90 დღე" "@{login}: {prs} PRs, {commits} commits, +{added} / −{deleted} lines (Δ {delta}), +{bin_added} / −{bin_deleted} binary assets, {first} – {last}" = "@{login}: PR: {prs}, კომიტი: {commits}, +{added} / −{deleted} სტრიქონი (Δ {delta}), +{bin_added} / −{bin_deleted} ბინარული რესურსი, {first} – {last}" "A collection of this file with these modes and variables: override their values per mode and add variables of its own" = "ამ ფაილის კოლექცია ამ რეჟიმებითა და ცვლადებით: შეცვალეთ მათი მნიშვნელობები თითოეული რეჟიმისთვის და დაამატეთ საკუთარი ცვლადები" "A .figcraft file with this name already exists. Choose its full name to confirm replacement." = "ამ სახელით .figcraft ფაილი უკვე არსებობს. ჩანაცვლების დასადასტურებლად აირჩიეთ მისი სრული სახელი." @@ -105,13 +108,14 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "All supported properties" = "ყველა მხარდაჭერილი თვისება" "All the fonts this file uses are installed" = "ამ ფაილის ყველა შრიფტი დაინსტალირებულია" "All variables" = "ყველა ცვლადი" +"Allow and download" = "დაშვება და ჩამოტვირთვა" +"Allow downloading fonts?" = "დაიშვას შრიფტების ჩამოტვირთვა?" "Along the bottom" = "ქვედა კიდის გასწვრივ" "Along the left" = "მარცხენა კიდის გასწვრივ" "Along the right" = "მარჯვენა კიდის გასწვრივ" "Along the top" = "ზედა კიდის გასწვრივ" "Alpha" = "ალფა" "Alphabetical" = "ანბანის მიხედვით" -"Alt+double-click an edge of an auto layout child" = "Alt+ორმაგი დაწკაპუნება ავტოგანლაგების შვილობილი ელემენტის კიდეზე" "Alt+drag" = "Alt+გადათრევა" "An analytics screen on a grid: figures, charts drawn from vectors and a table" = "ანალიტიკა ბადეზე: ციფრები, დიაგრამები და ცხრილი" "An earlier vote" = "ადრინდელი კენჭისყრა" @@ -160,7 +164,6 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "Auto layout" = "ავტოგანლაგება" "Auto rows" = "ავტომატური სტრიქონები" "Auto width" = "ავტომატური სიგანე" -"Auto: by the first letter with a direction" = "ავტომატური: მიმართულების მქონე პირველი ასოს მიხედვით" "Back to the FigCraft server" = "FigCraft-ის სერვერზე დაბრუნება" "Back to the font's value" = "შრიფტის მნიშვნელობაზე დაბრუნება" "Back" = "უკან" @@ -189,6 +192,7 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "Blend mode" = "შერევის რეჟიმი" "Blue" = "ლურჯი" "Blur" = "გაბუნდოვნება" +"Board grid" = "დაფის ბადე" "Boolean" = "ლოგიკური" "Boolean groups" = "ლოგიკური ოპერაციების ჯგუფები" "Both directions" = "ორივე მიმართულება" @@ -220,6 +224,7 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "Bulleted list" = "ბურთულებიანი სია" "C or Shift+C" = "C ან Shift+C" "C or ⇧C" = "C ან ⇧C" +"Changed {date}" = "შეცვლილია: {date}" "CMYK colour" = "CMYK ფერი" "Can view" = "შეუძლია ნახვა" "Can comment" = "შეუძლია კომენტარი" @@ -237,6 +242,8 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "Connector" = "შემაერთებელი" "Convert to frame" = "ჩარჩოდ გარდაქმნა" "Convert to section" = "სექციად გარდაქმნა" +"Copy browser link" = "ბრაუზერის ბმულის კოპირება" +"Couldn't reach {server} for its team list." = "{server}-იდან გუნდის სიის მიღება ვერ მოხერხდა." "CSS custom properties…" = "CSS-ის მორგებული თვისებები…" "Can edit" = "შეუძლია რედაქტირება" "Can't read this library: {e}" = "ამ ბიბლიოთეკის წაკითხვა ვერ მოხერხდა: {e}" @@ -341,7 +348,6 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "Copy as PNG" = "კოპირება როგორც PNG" "Copy as SVG" = "კოპირება როგორც SVG" "Copy code" = "კოდის კოპირება" -"Copy for AI" = "კოპირება AI-სთვის" "Copy link" = "ბმულის კოპირება" "Copy the {label}" = "კოპირება: {label}" "Copy {value}" = "კოპირება: {value}" @@ -368,11 +374,12 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "Create style from the selected text" = "სტილის შექმნა მონიშნული ტექსტიდან" "Created" = "შექმნილია" "Crop" = "ჩამოჭრა" +"Crop image" = "გამოსახულების ჩამოჭრა" "Crop marks" = "ჭრის ნიშნები" -"Ctrl+Alt+← ↑ → ↓" = "Ctrl+Alt+← ↑ → ↓" "Ctrl+arrows" = "Ctrl+ისრები" "Ctrl+click" = "Ctrl+დაწკაპუნება" "Ctrl+click a padding field" = "Ctrl+დაწკაპუნება შიდა დაშორების ველზე" +"⌘ click a padding field" = "⌘ დაწკაპუნება შიდა დაშორების ველზე" "Ctrl+scroll" = "Ctrl+გადახვევა" "Current name" = "მიმდინარე სახელი" "Current version" = "მიმდინარე ვერსია" @@ -392,53 +399,40 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "Decoration style" = "გაფორმების სტილი" "Decoration" = "გაფორმება" "Deep select" = "ღრმა მონიშვნა" +"Scrub a field faster (2x) or slower (1/2, 1/4)" = "ველის მნიშვნელობის გადათრევით ცვლა უფრო სწრაფად (2x) ან ნელა (1/2, 1/4)" +"Move up or down while dragging its label" = "ზემოთ ან ქვემოთ გადაადგილება მისი იარლიყის გადათრევისას" +"Scrubbing at 2x" = "გადათრევით ცვლა: 2x" +"Scrubbing at 1x" = "გადათრევით ცვლა: 1x" +"Scrubbing at 1/2" = "გადათრევით ცვლა: 1/2" +"Scrubbing at 1/4" = "გადათრევით ცვლა: 1/4" "Delete {n} variables" = { one = "ცვლადის წაშლა: {n}", other = "ცვლადის წაშლა: {n}" } -"Disconnected. Reconnecting…" = "კავშირი გაწყდა. ხელახლა დაკავშირება…" -"Disconnected. Your edits stay here and sync when the connection returns. Reconnecting…" = "კავშირი გაწყდა. თქვენი ცვლილებები აქ რჩება და სინქრონიზდება, როცა კავშირი აღდგება. ხელახლა დაკავშირება…" -"Dismiss" = "უგულებელყოფა" -"Double-click an edge of an auto layout frame" = "ორმაგი დაწკაპუნება ავტოგანლაგების ჩარჩოს კიდეზე" -"Edit padding on all sides" = "შიდა დაშორების რედაქტირება ყველა მხარეს" -"Enter / Shift+Enter" = "Enter / Shift+Enter" -"Expand the interface" = "ინტერფეისის გაშლა" -"Hide UI" = "ინტერფეისის დამალვა" -"Left to right" = "მარცხნიდან მარჯვნივ" "Move out of any group" = "ჯგუფიდან გამოტანა" "Move to group {group}" = "ჯგუფში გადატანა: {group}" -"Move up or down while dragging its label" = "ზემოთ ან ქვემოთ გადაადგილება მისი იარლიყის გადათრევისას" -"Not connected: {reason}. Your work is still in this tab." = "კავშირი არ არის: {reason}. თქვენი ნამუშევარი ისევ ამ ჩანართშია." -"Nothing to pick: the page is empty" = "ასარჩევი არაფერია: გვერდი ცარიელია" -"Pick select: Tab and Shift+Tab move between layers, Enter goes into one, Shift+Enter out, Space selects, Escape cancels" = "შრის არჩევა: Tab და Shift+Tab შრეებს შორის გადაადგილდება, Enter შრეში შედის, Shift+Enter გამოდის, Space მონიშნავს, Escape გააუქმებს" -"Pick select: into a layer, out to its parent" = "შრის არჩევა: შრეში შესვლა, მშობელზე გასვლა" -"Pick select: next or previous layer" = "შრის არჩევა: შემდეგი ან წინა შრე" -"Pick select: select the picked layer" = "შრის არჩევა: არჩეული შრის მონიშვნა" -"Remove all auto layout" = "ყველა ავტოგანლაგების მოხსნა" -"Retry now" = "ახლავე ხელახლა ცდა" -"Right to left" = "მარჯვნიდან მარცხნივ" -"Rotate a degree (Shift: 15)" = "ერთი გრადუსით შემობრუნება (Shift: 15)" -"Same as file ({profile})" = "როგორც ფაილში ({profile})" -"Save a copy…" = "ასლის შენახვა…" "Scope: all supported properties" = "არე: ყველა მხარდაჭერილი თვისება" "Scope: hidden from pickers" = "არე: ამომრჩევებში დამალული" "Scope: only {scope}" = "არე: მხოლოდ {scope}" -"Scrub a field faster (2x) or slower (1/2, 1/4)" = "ველის მნიშვნელობის გადათრევით ცვლა უფრო სწრაფად (2x) ან ნელა (1/2, 1/4)" -"Scrubbing at 1/2" = "გადათრევით ცვლა: 1/2" -"Scrubbing at 1/4" = "გადათრევით ცვლა: 1/4" -"Scrubbing at 1x" = "გადათრევით ცვლა: 1x" -"Scrubbing at 2x" = "გადათრევით ცვლა: 2x" -"Selection box: switch to pick select" = "მონიშვნის ჩარჩო: შრის არჩევაზე გადართვა" -"Set fill container" = "ზომა: კონტეინერის შევსება" -"Set hug contents" = "ზომა: შიგთავსზე მორგება" -"Show and move the placement crosshair (its tool chosen, nothing selected)" = "განთავსების ჯვრის ჩვენება და გადაადგილება (არჩეული ხელსაწყოთი, როცა არაფერია მონიშნული)" -"Space" = "Space" -"Tab or Ctrl+Space again" = "Tab ან ხელახლა Ctrl+Space" -"Text direction" = "ტექსტის მიმართულება" -"The bars are hidden. {shortcut} shows them again" = "ზოლები დამალულია. {shortcut} ისევ აჩვენებს მათ" +"Disconnected. Reconnecting…" = "კავშირი გაწყდა. ხელახლა დაკავშირება…" +"Disconnected. Your edits stay here and sync when the connection returns. Reconnecting…" = "კავშირი გაწყდა. თქვენი ცვლილებები აქ რჩება და სინქრონიზდება, როცა კავშირი აღდგება. ხელახლა დაკავშირება…" +"Dismiss" = "უგულებელყოფა" +"Not connected: {reason}. Your work is still in this tab." = "კავშირი არ არის: {reason}. თქვენი ნამუშევარი ისევ ამ ჩანართშია." +"Retry now" = "ახლავე ხელახლა ცდა" +"Save a copy…" = "ასლის შენახვა…" "Wrap style" = "გადატანის სტილი" +"Text direction" = "ტექსტის მიმართულება" +"Auto: by the first letter with a direction" = "ავტომატური: მიმართულების მქონე პირველი ასოს მიხედვით" +"Left to right" = "მარცხნიდან მარჯვნივ" +"Right to left" = "მარჯვნიდან მარცხნივ" "Balance" = "დაბალანსებული" "Pretty" = "მოწესრიგებული" "Auto: as many words as fit on each line" = "ავტომატური: თითო სტრიქონში იმდენი სიტყვა, რამდენიც ეტევა" "Balance: every line close to the same length" = "დაბალანსებული: ყველა სტრიქონი დაახლოებით ერთი სიგრძისაა" "Pretty: full lines, no one word alone on the last" = "მოწესრიგებული: სავსე სტრიქონები, ბოლო სტრიქონზე ერთი სიტყვა მარტო არ რჩება" +"Set hug contents" = "ზომა: შიგთავსზე მორგება" +"Set fill container" = "ზომა: კონტეინერის შევსება" +"Double-click an edge of an auto layout frame" = "ორმაგი დაწკაპუნება ავტოგანლაგების ჩარჩოს კიდეზე" +"{name}, disconnected from its live session" = "{name}, ცოცხალ სესიასთან კავშირი გაწყვეტილია" +"⌥ double-click an edge of an auto layout child" = "⌥ ორმაგი დაწკაპუნება ავტოგანლაგების შვილობილი ელემენტის კიდეზე" +"Alt+double-click an edge of an auto layout child" = "Alt+ორმაგი დაწკაპუნება ავტოგანლაგების შვილობილი ელემენტის კიდეზე" "Default" = "ნაგულისხმევი" "Default content" = "ნაგულისხმევი შიგთავსი" "Default value (the top-left variant)" = "ნაგულისხმევი მნიშვნელობა (ზედა მარცხენა ვარიანტი)" @@ -468,6 +462,7 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "Desktop" = "დესკტოპი" "Destination" = "დანიშნულება" "Detach alias" = "ალიასის გამოყოფა" +"Detach calculation" = "გამოთვლის გამოყოფა" "Detach instance" = "ინსტანსის გამოყოფა" "Detach property" = "თვისების გამოყოფა" "Detach style" = "სტილის გამოყოფა" @@ -499,6 +494,8 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "Dots" = "წერტილები" "Dotted" = "პუნქტირი" "Down" = "ქვემოთ" +"Download" = "ჩამოტვირთვა" +"Downloading… {percent}%" = "ჩამოტვირთვა… {percent}%" "Drafts" = "მონახაზები" "Drag the stroke to add a width point" = "გადაათრიეთ კონტური სიგანის წერტილის დასამატებლად" "Draw" = "ხატვა" @@ -508,6 +505,7 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "Drop to import" = "ჩააგდეთ იმპორტისთვის" "Drop to open" = "ჩააგდეთ გასახსნელად" "Drop shadow" = "ჩრდილი" +"Drop to use this image" = "ჩააგდეთ ამ გამოსახულების გამოსაყენებლად" "Dual-licensed MIT OR Apache-2.0. Made by the ArtCraft team and community." = "ორმაგი ლიცენზია: MIT OR Apache-2.0. შექმნილია ArtCraft-ის გუნდისა და საზოგადოების მიერ." "Duo" = "დუო" "Duplicate" = "დუბლირება" @@ -521,6 +519,7 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "Edit dev resource" = "დეველოპერის რესურსის რედაქტირება" "Edit link" = "რედაქტირების ბმული" "Edit link copied" = "რედაქტირების ბმული დაკოპირდა" +"Edit padding on all sides" = "შიდა დაშორების რედაქტირება ყველა მხარეს" "Edit style" = "სტილის რედაქტირება" "Edit variable" = "ცვლადის რედაქტირება" "Edit with the builder" = "კონსტრუქტორით რედაქტირება" @@ -548,6 +547,7 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "Essential" = "ძირითადი" "Every conflict has a choice." = "ყველა კონფლიქტს არჩევანი აქვს." "Every top-level frame already starts a flow" = "ყველა ზედა დონის ჩარჩო უკვე იწყებს ნაკადს" +"Everyone who reaches this server can open these files while they are shared." = "ამ სერვერთან წვდომის მქონე ყველას შეუძლია ამ ფაილების გახსნა, სანამ ისინი გაზიარებულია." "Exact opacity (4 then 5: 45%)" = "ზუსტი გაუმჭვირვალობა (4, შემდეგ 5: 45%)" "Exclude" = "გამორიცხვა" "Excluded" = "გამორიცხული" @@ -556,6 +556,7 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "Exclusion" = "გამორიცხვა" "Exit focus view (Esc)" = "ფოკუსის ხედიდან გასვლა (Esc)" "Expand" = "გაშლა" +"Expand the interface" = "ინტერფეისის გაშლა" "Export" = "ექსპორტირება" "Export all" = "ყველაფრის ექსპორტირება" "Export frames and layers as PNG, JPG, SVG or PDF" = "ჩარჩოები და შრეები PNG, JPG, SVG ან PDF ფორმატში" @@ -582,6 +583,7 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "Fetching from the server…" = "სერვერიდან მიღება…" "FigCraft couldn't open its window: {error}" = "FigCraft-მა ფანჯრის გახსნა ვერ შეძლო: {error}" "FigCraft doesn't support every feature of these files yet. The notes list what was left out or changed in the imported copy; the original file is unchanged." = "FigCraft ჯერ ამ ფაილების ყველა შესაძლებლობას არ უჭერს მხარს. შენიშვნებში ჩამოთვლილია, რა გამოტოვდა ან შეიცვალა იმპორტირებულ ასლში; ორიგინალი ფაილი უცვლელია." +"FigCraft stopped because of an internal error." = "FigCraft-ის მუშაობა შიდა შეცდომის გამო შეწყდა." "File" = "ფაილი" "File name" = "ფაილის სახელი" "File not found" = "ფაილი ვერ მოიძებნა" @@ -638,6 +640,7 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "Frame selection" = "მონიშნულის ჩარჩოში მოქცევა" "Frame tools" = "ჩარჩოს ხელსაწყოები" "Frames" = "ჩარჩოები" +"Free fonts come from Google Fonts and Noto, through jsDelivr and GitHub. Each file is checked against the font index before it is installed into the font folder the Craft apps share. Nothing is downloaded until you allow it." = "უფასო შრიფტები Google Fonts-იდან და Noto-დან მოდის, jsDelivr-ისა და GitHub-ის გავლით. თითოეული ფაილი შრიფტების ინდექსთან მოწმდება, სანამ Craft-აპების საერთო შრიფტების საქაღალდეში დაინსტალირდება. სანამ არ დაუშვებთ, არაფერი ჩამოიტვირთება." "From the library \"{name}\": read-only" = "ბიბლიოთეკიდან „{name}“: მხოლოდ წასაკითხად" "From {name}" = "წყარო: {name}" "From {server}" = "წყარო: {server}" @@ -653,6 +656,7 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "Go to {name}" = "{name}-ზე გადასვლა" "Grab bag" = "სხვადასხვა" "Gradient" = "გრადიენტი" +"Graph paper" = "მილიმეტრიანი ქაღალდი" "Gray" = "ნაცრისფერი" "Green" = "მწვანე" "Greyscale components and two example screens to sketch a flow with" = "ნაცრისფერი კომპონენტები ნაკადის ჩანახატისთვის" @@ -675,6 +679,7 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "Help page" = "დახმარების გვერდი" "Here: {names}" = "აქ: {names}" "Hidden" = "დამალული" +"Hide UI" = "ინტერფეისის დამალვა" "Hide contents" = "შიგთავსის დამალვა" "Hide from publishing" = "გამოქვეყნებისას დამალვა" "Hide section contents" = "სექციის შიგთავსის დამალვა" @@ -766,6 +771,7 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "Join with a code" = "კოდით შეერთება" "Joined" = "შეერთებულია" "Joined {file}" = "შეერთებულია: {file}" +"Joining live session…" = "ცოცხალ სესიასთან შეერთება…" "Joining…" = "შეერთება…" "Join|stroke" = "შეერთება" "Jul" = "ივლ" @@ -827,6 +833,8 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "Lines deleted" = "წაშლილი სტრიქონები" "Link" = "ბმული" "Link copied" = "ბმული დაკოპირდა" +"Link copied: it opens the file in FigCraft" = "ბმული დაკოპირდა: ის ფაილს FigCraft-ში ხსნის" +"Link copied: it opens the file in the browser" = "ბმული დაკოპირდა: ის ფაილს ბრაუზერში ხსნის" "Link docs, code or tickets for developers." = "მიაბით დოკუმენტაცია, კოდი ან ტიკეტები დეველოპერებისთვის." "Link frames on the Prototype tab, then present the flow" = "დააკავშირეთ ჩარჩოები და წარადგინეთ ნაკადი" "Link this component to its code component: instances then show your real snippet with their values." = "დააკავშირეთ ეს კომპონენტი მის კოდის კომპონენტთან: ინსტანსები მაშინ თქვენს რეალურ ფრაგმენტს აჩვენებს მათი მნიშვნელობებით." @@ -849,10 +857,15 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "Make a component" = "შექმენით კომპონენტი" "Make slot" = "სლოტად გადაქცევა" "New collection" = "ახალი კოლექცია" +"Nobody shares a file there now." = "იქ ახლა არავინ აზიარებს ფაილს." +"Past 30 days" = "ბოლო 30 დღე" +"Past 90 days" = "ბოლო 90 დღე" +"Past year" = "ბოლო წელი" "Pasted design layers" = "ჩასმული დიზაინის ფენები" "Pasted design layers; the clipboard didn't carry the images of: {layers}" = "დიზაინის ფენები ჩაისვა; ბუფერში არ იყო შემდეგის სურათები: {layers}" "Remove these results from the file" = "ამ შედეგების ფაილიდან წაშლა" "Scroll wheel zoom" = "მასშტაბირება გადახვევის ბორბლით" +"Shared by your team on {server}" = "თქვენი გუნდის მიერ {server}-ზე გაზიარებული" "Slot name" = "სლოტის სახელი" "Mar" = "მარ" "Margin" = "ველი" @@ -987,15 +1000,18 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "Not bound" = "მიბმული არ არის" "Not in a live session" = "ცოცხალ სესიაში არ ხართ" "Not in this font" = "ამ შრიფტში არ არის" +"Not now" = "ახლა არა" "Not properties, kept as written: {names}" = "არ არის თვისებები, დარჩა დაწერილი სახით: {names}" "Not read yet" = "ჯერ არ არის წაკითხული" "Check for updates" = "განახლებების შემოწმება" "Not checked yet" = "ჯერ არ არის შემოწმებული" "Someone who left" = "ვინც წავიდა" "Take the results off the board; they stay in the file" = "შედეგების დაფიდან მოხსნა; ფაილში დარჩება" +"Upload from computer" = "კომპიუტერიდან ატვირთვა" "This file uses team libraries on servers you haven't used here. They aren't contacted until you check them." = "ეს ფაილი იყენებს გუნდის ბიბლიოთეკებს სერვერებზე, რომლებიც აქ არ გამოგიყენებიათ. მათ არ დავუკავშირდებით, სანამ არ შეამოწმებთ." "Not shared" = "არ არის გაზიარებული" "Note {n}" = "შენიშვნა {n}" +"Nothing counted yet" = "ჯერ არაფერი დათვლილა" "Nothing changed since this version." = "ამ ვერსიის შემდეგ არაფერი შეცვლილა." "Nothing changed since this was marked ready for dev." = "მას შემდეგ, რაც მზად დეველოპერისთვის მოინიშნა, არაფერი შეცვლილა." "Nothing here yet. Set a frame's status to list it." = "აქ ჯერ არაფერია. ჩარჩოს სიაში გამოსაჩენად მიანიჭეთ სტატუსი." @@ -1004,6 +1020,9 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "Nov" = "ნოე" "Now" = "ახლა" "Nudge (Shift: big nudge)" = "მცირედ გადაწევა (Shift: დიდი ბიჯით)" +"Rotate a degree (Shift: 15)" = "ერთი გრადუსით შემობრუნება (Shift: 15)" +"⌥⌘ ← ↑ → ↓" = "⌥⌘ ← ↑ → ↓" +"Ctrl+Alt+← ↑ → ↓" = "Ctrl+Alt+← ↑ → ↓" "Nudge amount" = "მცირედ გადაწევის ბიჯი" "Number" = "რიცხვი" "Number ↑" = "რიცხვი ↑" @@ -1080,6 +1099,7 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "Pages: {pages}" = "გვერდი: {pages}" "Paint bucket" = "საღებავის ვედრო" "Pan the canvas" = "ტილოს გადაადგილება" +"Show and move the placement crosshair (its tool chosen, nothing selected)" = "განთავსების ჯვრის ჩვენება და გადაადგილება (არჩეული ხელსაწყოთი, როცა არაფერია მონიშნული)" "Pan with nothing selected (Shift: farther)" = "გადაადგილება, როცა არაფერია მონიშნული (Shift: უფრო შორს)" "Panels" = "პანელები" "Paper" = "ქაღალდი" @@ -1189,9 +1209,13 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "Regular expression" = "რეგულარული გამოსახულება" "Relative to" = "მიმართ" "Relative to your system's display scaling (100% is the system's own size). Document zoom is separate." = "სისტემის ეკრანის მასშტაბირებასთან მიმართებით (100% სისტემის საკუთარი ზომაა). დოკუმენტის მასშტაბი ცალკე რეგულირდება." +"Reload the page to get back the unsaved files the browser had room for." = "განაახლეთ გვერდი, რომ დაიბრუნოთ ის შეუნახავი ფაილები, რომლებიც ბრაუზერში დაეტია." +"Reload the page to get your unsaved files back." = "განაახლეთ გვერდი, რომ შეუნახავი ფაილები დაიბრუნოთ." +"Reload the page to start again." = "თავიდან დასაწყებად განაახლეთ გვერდი." "Remove" = "წაშლა" "Remove all" = "ყველას წაშლა" "Remove annotation" = "ანოტაციის წაშლა" +"Remove all auto layout" = "ყველა ავტოგანლაგების მოხსნა" "Remove auto layout" = "ავტოგანლაგების მოხსნა" "Remove column" = "სვეტის წაშლა" "Remove dev resource" = "დეველოპერის რესურსის წაშლა" @@ -1243,6 +1267,7 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "Reset adjustments" = "კორექციების ჩამოყრა" "Reset all changes" = "ყველა ცვლილების ჩამოყრა" "Reset all overrides on this layer" = "ამ შრის ყველა გადაფარვის ჩამოყრა" +"Reset grid" = "ბადის ჩამოყრა" "Reset overrides" = "გადაფარვების ჩამოყრა" "Reset slot" = "სლოტის ჩამოყრა" "Reset this override" = "ამ გადაფარვის ჩამოყრა" @@ -1297,6 +1322,7 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "See all templates" = "ყველა შაბლონის ნახვა" "Select layers and they space themselves as their content changes" = "შრეები შიგთავსის ცვლილებისას თავად დაშორდება" "SHA-256: {sha}…" = "SHA-256: {sha}…" +"Same as file ({profile})" = "როგორც ფაილში ({profile})" "Same as layer" = "შრის მსგავსად" "Saturation" = "გაჯერება" "Save" = "შენახვა" @@ -1322,6 +1348,8 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "Search files and templates" = "ფაილებისა და შაბლონების ძიება" "Search results" = "ძიების შედეგები" "Search fonts" = "შრიფტების ძიება" +"This server doesn't count insertions" = "ეს სერვერი ჩასმებს არ ითვლის" +"This server doesn't count styles and variables" = "ეს სერვერი სტილებსა და ცვლადებს არ ითვლის" "Use fonts installed on this computer…" = "ამ კომპიუტერზე დაყენებული შრიფტების გამოყენება…" "Search layers" = "შრეების ძიება" "Search shortcuts" = "მალსახმობების ძიება" @@ -1381,6 +1409,7 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "Show device frame" = "მოწყობილობის კორპუსის ჩვენება" "Show dimensions on objects" = "ზომების ჩვენება ობიექტებზე" "Show hotspot hints" = "აქტიური არეების მინიშნებების ჩვენება" +"The bars are hidden. {shortcut} shows them again" = "ზოლები დამალულია. {shortcut} ისევ აჩვენებს მათ" "Show in Explorer" = "Explorer-ში ჩვენება" "Show in Finder" = "Finder-ში ჩვენება" "Show in folder" = "საქაღალდეში ჩვენება" @@ -1484,6 +1513,7 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "Stroke style" = "კონტურის სტილი" "Stroke weight" = "კონტურის სისქე" "Strokes" = "კონტურები" +"Strong line every" = "მუქი ხაზის ბიჯი" "Style" = "სტილი" "Styles" = "სტილები" "Stylistic set 1" = "სტილისტური ნაკრები 1" @@ -1707,6 +1737,7 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "Your copy stays open; the file stays on the server" = "თქვენი ასლი ღია რჩება; ფაილი სერვერზე რჩება" "Your name" = "თქვენი სახელი" "Your system asks for reduced motion: animations stay off." = "თქვენი სისტემა ითხოვს მოძრაობის შემცირებას: ანიმაციები გამორთული რჩება." +"Your unsaved files were too large for the browser to keep." = "თქვენი შეუნახავი ფაილები ბრაუზერისთვის შესანახად ზედმეტად დიდი იყო." "Z" = "Z" "Z to A" = "ჰ-დან ა-მდე" "Zoom" = "მასშტაბი" @@ -1740,6 +1771,7 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "connector label was skipped: text style data is missing" = "შემაერთებლის იარლიყი გამოტოვებულია: ტექსტის სტილის მონაცემები აკლია" "connector label was skipped: text transform is invalid" = "შემაერთებლის იარლიყი გამოტოვებულია: ტექსტის გარდაქმნა არასწორია" "connector labels were skipped" = "შემაერთებლების იარლიყები გამოტოვებულია" +"connector labels without a saved snapshot are centred on the line, without their background" = "შენახული სნეპშოტის გარეშე შემაერთებლის იარლიყები ხაზზე ცენტრდება, ფონის გარეშე" "connector layers import as static frame/vector snapshots with labels when present; live endpoint bindings are not retained" = "შემაერთებლის შრეები იმპორტირდება ჩარჩოს ან ვექტორის სტატიკური სნეპშოტების სახით, იარლიყებით (თუ არის); ბოლოების ცოცხალი მიბმები არ ნარჩუნდება" "connector snapshot vector data is missing; connector was left empty" = "შემაერთებლის სნეპშოტის ვექტორული მონაცემები აკლია; შემაერთებელი ცარიელი დარჩა" "connectors whose ends can't be placed are empty" = "შემაერთებლები, რომელთა ბოლოების განთავსება ვერ ხერხდება, ცარიელია" @@ -1751,6 +1783,7 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "duplicate grid track sizing entries use equal tracks" = "ბადის ტრეკის ზომის დუბლირებული ჩანაწერებისას ტრეკები თანაბარია" "e.g. count + 1" = "მაგ. count + 1" "e.g. count >= 3 and not done" = "მაგ. count >= 3 and not done" +"elbowed and curved connectors without a saved path follow FigCraft's own routing" = "შენახული ტრაექტორიის გარეშე კუთხოვანი და მრუდი შემაერთებლები FigCraft-ის საკუთარ მარშრუტს მიჰყვება" "entries without a node type were skipped" = "კვანძის ტიპის გარეშე ჩანაწერები გამოტოვებულია" "figcraft:// links from a browser, chat or email open this app and join the session." = "ბრაუზერიდან, ჩატიდან ან ელფოსტიდან figcraft:// ბმულები ხსნის ამ აპს და უერთდება სესიას." "from {server}" = "წყარო: {server}" @@ -1772,12 +1805,15 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "invalid internal .fig text path data was ignored" = ".fig-ის შიდა ტექსტის ტრაექტორიის არასწორი მონაცემები იგნორირებულია" "invalid or oversized vector networks import as outlines" = "არასწორი ან ზედმეტად დიდი ვექტორული ქსელები კონტურებად იმპორტირდება" "invalid or oversized vector path data was skipped" = "ვექტორული ტრაექტორიის არასწორი ან ზედმეტად დიდი მონაცემები გამოტოვებულია" +"invalid vector region fill paint list; layer fill used" = "ვექტორული არის შევსების საღებავების სია არასწორია; გამოყენებულია შრის შევსება" +"invalid vector region paints were skipped" = "ვექტორული არის არასწორი საღებავები გამოტოვებულია" "just now" = "ახლახან" "key triggers without a supported key were skipped" = "მხარდაჭერილი კლავიშის გარეშე კლავიშის გამშვებები გამოტოვებულია" "key up triggers import as key presses" = "კლავიშის აშვების გამშვებები კლავიშის დაჭერებად იმპორტირდება" "layers without a position were placed at their parent's origin" = "პოზიციის გარეშე შრეები მშობლის საწყის წერტილში განთავსდა" "layers without a type were skipped" = "ტიპის გარეშე შრეები გამოტოვებულია" "legacy image filter container is unsupported; filter conversion was skipped" = "გამოსახულების ფილტრების ძველი კონტეინერი მხარდაუჭერელია; ფილტრების გარდაქმნა გამოტოვებულია" +"linked vector region fill styles keep resolved appearance; live style links were left out" = "ვექტორული არის მიბმული შევსების სტილები გამოთვლილ იერსახეს ინარჩუნებს; სტილების ცოცხალი კავშირები არ გადმოვიდა" "links to shared styles that aren't in the file kept the layers' own values" = "ფაილში არარსებულ საერთო სტილებზე ბმულებმა შეინარჩუნეს ფენების საკუთარი მნიშვნელობები" "locked" = "ჩაკეტილი" "malformed image filters container was skipped" = "გამოსახულების ფილტრების დაზიანებული კონტეინერი გამოტოვებულია" @@ -1786,6 +1822,10 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "no bleed" = "ჭრისპირა არის გარეშე" "nobody else here yet" = "აქ ჯერ სხვა არავინაა" "non-default slot settings are not represented and were skipped" = "სლოტის არანაგულისხმევი პარამეტრები არ არის წარმოდგენილი და გამოტოვებულია" +"note or shape generated child has invalid bounds; child skipped" = "შენიშვნის ან ფიგურის გენერირებულ შვილობილ ელემენტს არასწორი საზღვრები აქვს; ელემენტი გამოტოვებულია" +"note or shape generated child is missing its style or bounds; child skipped" = "შენიშვნის ან ფიგურის გენერირებულ შვილობილ ელემენტს სტილი ან საზღვრები აკლია; ელემენტი გამოტოვებულია" +"note or shape generated children exceed the layer or nesting limit; remaining children skipped" = "შენიშვნის ან ფიგურის გენერირებული შვილობილი ელემენტები შრეების ან ჩადგმის ლიმიტს აჭარბებს; დანარჩენი ელემენტები გამოტოვებულია" +"note or shape generated layout is missing or unsupported; using its outer frame" = "შენიშვნის ან ფიგურის გენერირებული განლაგება აკლია ან მხარდაუჭერელია; გამოიყენება მისი გარე ჩარჩო" "now" = "ახლა" "offer files to save if it asks to (you choose where each one goes)" = "შესანახად ფაილების შეთავაზება, თუ ამას ითხოვს (თითოეულის ადგილს თქვენ ირჩევთ)" "only in a text style or variable" = "მხოლოდ ტექსტის სტილში ან ცვლადში" @@ -1809,6 +1849,7 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "set-variable actions with values that don't fit the variable were skipped" = "ცვლადის დაყენების მოქმედებები, რომელთა მნიშვნელობა ცვლადს არ შეესაბამება, გამოტოვებულია" "set-variable actions without a value were skipped" = "მნიშვნელობის გარეშე ცვლადის დაყენების მოქმედებები გამოტოვებულია" "set-variable-mode actions on collections or modes that aren't in the variables JSON were skipped" = "ცვლადის რეჟიმის დაყენების მოქმედებები იმ კოლექციებზე ან რეჟიმებზე, რომლებიც ცვლადების JSON-ში არ არის, გამოტოვებულია" +"shape generated outline is missing or damaged; using its rectangle" = "ფიგურის გენერირებული კონტური აკლია ან დაზიანებულია; გამოიყენება მისი მართკუთხედი" "slot content assignment target is missing or is not slot content" = "სლოტის შიგთავსის მინიჭების სამიზნე აკლია ან სლოტის შიგთავსი არ არის" "slot content assignment uses the empty GUID sentinel and was skipped" = "სლოტის შიგთავსის მინიჭება ცარიელ GUID მარკერს იყენებს და გამოტოვებულია" "slot layers without a matching slot property were imported as frames" = "სლოტის შრეები, რომლებსაც შესაბამისი სლოტის თვისება არ აქვს, ჩარჩოებად იმპორტირდა" @@ -1834,10 +1875,13 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "variable modes of collections that aren't in the file were skipped" = "იმ კოლექციების ცვლადის რეჟიმები, რომლებიც ფაილში არ არის, გამოტოვებულია" "variable modes of collections that aren't in the variables JSON were skipped" = "იმ კოლექციების ცვლადის რეჟიმები, რომლებიც ცვლადების JSON-ში არ არის, გამოტოვებულია" "variable values that don't match their type (or composed colours) were skipped" = "ცვლადის მნიშვნელობები, რომლებიც თავიანთ ტიპს არ შეესაბამება (ან შედგენილი ფერები), გამოტოვებულია" +"variable-bound vector region paints keep resolved appearance; live bindings were left out" = "ცვლადებზე მიბმული ვექტორული არის საღებავები გამოთვლილ იერსახეს ინარჩუნებს; ცოცხალი მიბმები არ გადმოვიდა" "variables of unknown types were skipped" = "უცნობი ტიპის ცვლადები გამოტოვებულია" "variables whose collection isn't in the variables JSON were skipped" = "ცვლადები, რომელთა კოლექცია ცვლადების JSON-ში არ არის, გამოტოვებულია" "variables without readable values were skipped" = "წაკითხვადი მნიშვნელობების გარეშე ცვლადები გამოტოვებულია" "vector points with unknown stroke joins use the layer join" = "უცნობი კონტურის შეერთების მქონე ვექტორული წერტილები შრის შეერთებას იყენებს" +"vector region paint data exceeded import limits and was skipped" = "ვექტორული არის საღებავის მონაცემებმა იმპორტის ლიმიტებს გადააჭარბა და გამოტოვებულია" +"vector region references a missing fill style; layer fill used" = "ვექტორული არე მიუთითებს შევსების არარსებულ სტილზე; გამოყენებულია შრის შევსება" "vectors without geometry are empty" = "გეომეტრიის გარეშე ვექტორები ცარიელია" "vectors without geometry are empty (export the file JSON with geometry=paths)" = "გეომეტრიის გარეშე ვექტორები ცარიელია (ფაილის JSON-ის ექსპორტი გააკეთეთ geometry=paths პარამეტრით)" "very long text was cut to 1,048,576 characters" = "ძალიან გრძელი ტექსტი 1 048 576 სიმბოლომდე შემოკლდა" @@ -1845,6 +1889,8 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "video actions are not supported and were skipped" = "ვიდეოს მოქმედებები მხარდაუჭერელია და გამოტოვებულია" "video triggers are not supported and were skipped" = "ვიდეოს გამშვებები მხარდაუჭერელია და გამოტოვებულია" "yesterday" = "გუშინ" +"{count} in it now · Changed {date}" = "ახლა მასშია: {count} · შეცვლილია: {date}" +"{insertions} · {detachments}" = "{insertions} · {detachments}" "{instances} in {files}" = "{instances} — {files}" "{language}: draft translation, waiting for a native speaker's review." = "{language}: თარგმანის მონახაზი, ელოდება მშობლიური ენის მცოდნის განხილვას." "{length} bleed" = "ჭრისპირა არე: {length}" @@ -1853,7 +1899,6 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "{name} is forgotten on this computer; the file stays on {server}" = "{name} დავიწყებულია ამ კომპიუტერზე; ფაილი {server}-ზე რჩება" "{name} is on the server." = "{name} სერვერზეა." "{name} is spotlighting" = "ყურადღება {name}-ზეა" -"{name}, disconnected from its live session" = "{name}, ცოცხალ სესიასთან კავშირი გაწყვეტილია" "{name}\nClick to apply to the selection" = "{name}\nდაწკაპეთ მონიშნულზე გამოსაყენებლად" "{name}\nDrag onto the canvas, or click to place in the middle of the view.\nHold Alt (Option) while dropping onto an instance to swap it." = "{name}\nგადაათრიეთ ტილოზე ან დაწკაპეთ ხედის შუაში განსათავსებლად.\nინსტანსის ჩასანაცვლებლად მასზე ჩაგდებისას დააჭირეთ Alt-ს (Option)." "{name} (from {library})" = "{name} ({library}-იდან)" @@ -1881,8 +1926,10 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "{n} components and styles have newer versions" = { one = "ახალი ვერსია აქვს კომპონენტს ან სტილს: {n}", other = "ახალი ვერსია აქვს კომპონენტს ან სტილს: {n}" } "{n} conflicts to resolve" = { one = "გადასაწყვეტი კონფლიქტი: {n}", other = "გადასაწყვეტი კონფლიქტი: {n}" } "{n} days ago" = { one = "{n} დღის წინ", other = "{n} დღის წინ" } +"{n} detached" = { one = "გამოყოფილი: {n}", other = "გამოყოფილი: {n}" } "{n} files" = { one = "ფაილი: {n}", other = "ფაილი: {n}" } "{n} hours ago" = { one = "{n} საათის წინ", other = "{n} საათის წინ" } +"{n} inserted" = { one = "ჩასმული: {n}", other = "ჩასმული: {n}" } "{n} instances" = { one = "ინსტანსი: {n}", other = "ინსტანსი: {n}" } "{n} layers" = { one = "შრე: {n}", other = "შრე: {n}" } "{n} layers as one file" = { one = "შრე: {n}, ერთ ფაილად", other = "შრე: {n}, ერთ ფაილად" } @@ -1913,12 +1960,15 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "{n}w" = "{n} კვ" "{page}, nothing selected" = "{page}, არაფერია მონიშნული" "{percent}%" = "{percent}%" +"{period}: {counts}" = "{period}: {counts}" "{profile} (current)" = "{profile} (მიმდინარე)" "{property} is its value; {property ? \"a\" : \"b\"} picks a string. Other {…} stays as written." = "{property} მისი მნიშვნელობაა; {property ? \"a\" : \"b\"} ირჩევს სტრიქონს. ნებისმიერი სხვა {…} რჩება დაწერილი სახით." "{server} can't say what became of your files (it is older than this app)." = "{server} ვერ გეტყვით, რა მოუვიდა თქვენს ფაილებს (ის ამ აპზე ძველია)." "{server} · No longer on the server" = "{server} · სერვერზე აღარ არის" "{server} · {shared} · Opened {date}" = "{server} · {shared} · გაიხსნა {date}" "{tool} hold {key}" = "{tool} დააჭირეთ {key}" +"{used} · {detached}" = "{used} · {detached}" +"{used} · {inserted}" = "{used} · {inserted}" "{value} isn't a colour" = "{value} ფერი არ არის" "{when} · edited" = "{when} · რედაქტირებულია" "← ↑ → ↓" = "← ↑ → ↓" @@ -1926,23 +1976,32 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "←" = "←" "→, Space or N" = "→, Space ან N" "↵" = "↵" -"↵ / ⇧↵" = "↵ / ⇧↵" "⇥ / ⇧⇥" = "⇥ / ⇧⇥" -"⇥ or ⌥ Space again" = "⇥ ან ხელახლა ⌥ Space" "⌘ arrows" = "⌘ ისრები" "⌘ click" = "⌘ დაწკაპუნება" -"⌘ click a padding field" = "⌘ დაწკაპუნება შიდა დაშორების ველზე" "⌘ scroll" = "⌘ გადახვევა" -"⌥ double-click an edge of an auto layout child" = "⌥ ორმაგი დაწკაპუნება ავტოგანლაგების შვილობილი ელემენტის კიდეზე" "⌥ drag" = "⌥ გადათრევა" +"Selection box: switch to pick select" = "მონიშვნის ჩარჩო: შრის არჩევაზე გადართვა" +"Pick select: next or previous layer" = "შრის არჩევა: შემდეგი ან წინა შრე" +"Pick select: into a layer, out to its parent" = "შრის არჩევა: შრეში შესვლა, მშობელზე გასვლა" +"Pick select: select the picked layer" = "შრის არჩევა: არჩეული შრის მონიშვნა" +"⇥ or ⌥ Space again" = "⇥ ან ხელახლა ⌥ Space" +"Tab or Ctrl+Space again" = "Tab ან ხელახლა Ctrl+Space" +"↵ / ⇧↵" = "↵ / ⇧↵" +"Enter / Shift+Enter" = "Enter / Shift+Enter" +"Space" = "Space" +"Nothing to pick: the page is empty" = "ასარჩევი არაფერია: გვერდი ცარიელია" +"Pick select: Tab and Shift+Tab move between layers, Enter goes into one, Shift+Enter out, Space selects, Escape cancels" = "შრის არჩევა: Tab და Shift+Tab შრეებს შორის გადაადგილდება, Enter შრეში შედის, Shift+Enter გამოდის, Space მონიშნავს, Escape გააუქმებს" "Android Vector Drawable" = "Android Vector Drawable" "Best effort" = "მაქსიმალური მიახლოება" "Check for Updates" = "განახლებების შემოწმება" "Check for updates…" = "განახლებების შემოწმება…" "Compatibility" = "თავსებადობა" "Dart constants for Flutter…" = "Dart-ის კონსტანტები Flutter-ისთვის…" +"Calculated from other variables; it follows them" = "გამოითვლება სხვა ცვლადებიდან და მათ მიჰყვება" "Copy effect" = "ეფექტის კოპირება" "Copy fill" = "შევსების კოპირება" +"Copy for AI" = "კოპირება AI-სთვის" "Copy stroke" = "კონტურის კოპირება" "Couldn't download {name}" = "{name} ვერ ჩამოიტვირთა" "Don't show this again" = "აღარ აჩვენო" @@ -1959,70 +2018,11 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "Set corner smoothing to 60%" = "კუთხეების დარბილების 60%-ზე დაყენება" "Text on a path" = "ტექსტი ტრაექტორიაზე" "This link opens a website outside the prototype:" = "ეს ბმული პროტოტიპის გარეთ ვებსაიტს ხსნის:" +"This link opens your mail app to write a message:" = "ეს ბმული წერილის დასაწერად თქვენს საფოსტო აპს ხსნის:" +"This server doesn't count detached instances" = "ეს სერვერი გამოყოფილ ინსტანსებს არ ითვლის" "Update check is not supported in the web browser." = "ვებბრაუზერში განახლებების შემოწმება მხარდაჭერილი არ არის." "instance swap properties whose default component was past the layer limit were skipped" = "ინსტანსის ჩანაცვლების თვისებები, რომელთა ნაგულისხმევი კომპონენტი შრეების ზღვარს მიღმა იყო, გამოტოვებულია" "instances whose component was past the layer limit were imported as frames" = "ინსტანსები, რომელთა კომპონენტი შრეების ზღვარს მიღმა იყო, ჩარჩოებად იმპორტირდა" -"1 year" = "1 წელი" -"30 days" = "30 დღე" -"90 days" = "90 დღე" -"Allow and download" = "დაშვება და ჩამოტვირთვა" -"Allow downloading fonts?" = "დაიშვას შრიფტების ჩამოტვირთვა?" -"Board grid" = "დაფის ბადე" -"Changed {date}" = "შეცვლილია: {date}" -"Copy browser link" = "ბრაუზერის ბმულის კოპირება" -"Couldn't reach {server} for its team list." = "{server}-იდან გუნდის სიის მიღება ვერ მოხერხდა." -"Calculated from other variables; it follows them" = "გამოითვლება სხვა ცვლადებიდან და მათ მიჰყვება" -"Crop image" = "გამოსახულების ჩამოჭრა" -"Detach calculation" = "გამოთვლის გამოყოფა" -"Download" = "ჩამოტვირთვა" -"Downloading… {percent}%" = "ჩამოტვირთვა… {percent}%" -"Drop to use this image" = "ჩააგდეთ ამ გამოსახულების გამოსაყენებლად" -"Everyone who reaches this server can open these files while they are shared." = "ამ სერვერთან წვდომის მქონე ყველას შეუძლია ამ ფაილების გახსნა, სანამ ისინი გაზიარებულია." -"FigCraft stopped because of an internal error." = "FigCraft-ის მუშაობა შიდა შეცდომის გამო შეწყდა." -"Free fonts come from Google Fonts and Noto, through jsDelivr and GitHub. Each file is checked against the font index before it is installed into the font folder the Craft apps share. Nothing is downloaded until you allow it." = "უფასო შრიფტები Google Fonts-იდან და Noto-დან მოდის, jsDelivr-ისა და GitHub-ის გავლით. თითოეული ფაილი შრიფტების ინდექსთან მოწმდება, სანამ Craft-აპების საერთო შრიფტების საქაღალდეში დაინსტალირდება. სანამ არ დაუშვებთ, არაფერი ჩამოიტვირთება." -"Graph paper" = "მილიმეტრიანი ქაღალდი" -"Joining live session…" = "ცოცხალ სესიასთან შეერთება…" -"Link copied: it opens the file in FigCraft" = "ბმული დაკოპირდა: ის ფაილს FigCraft-ში ხსნის" -"Link copied: it opens the file in the browser" = "ბმული დაკოპირდა: ის ფაილს ბრაუზერში ხსნის" -"Nobody shares a file there now." = "იქ ახლა არავინ აზიარებს ფაილს." -"Past 30 days" = "ბოლო 30 დღე" -"Past 90 days" = "ბოლო 90 დღე" -"Past year" = "ბოლო წელი" -"Shared by your team on {server}" = "თქვენი გუნდის მიერ {server}-ზე გაზიარებული" -"Not now" = "ახლა არა" -"Nothing counted yet" = "ჯერ არაფერი დათვლილა" -"Reload the page to get back the unsaved files the browser had room for." = "განაახლეთ გვერდი, რომ დაიბრუნოთ ის შეუნახავი ფაილები, რომლებიც ბრაუზერში დაეტია." -"Reload the page to get your unsaved files back." = "განაახლეთ გვერდი, რომ შეუნახავი ფაილები დაიბრუნოთ." -"Reload the page to start again." = "თავიდან დასაწყებად განაახლეთ გვერდი." -"Reset grid" = "ბადის ჩამოყრა" -"This server doesn't count insertions" = "ეს სერვერი ჩასმებს არ ითვლის" -"This server doesn't count styles and variables" = "ეს სერვერი სტილებსა და ცვლადებს არ ითვლის" -"Upload from computer" = "კომპიუტერიდან ატვირთვა" -"Strong line every" = "მუქი ხაზის ბიჯი" -"This link opens your mail app to write a message:" = "ეს ბმული წერილის დასაწერად თქვენს საფოსტო აპს ხსნის:" -"This server doesn't count detached instances" = "ეს სერვერი გამოყოფილ ინსტანსებს არ ითვლის" -"Your unsaved files were too large for the browser to keep." = "თქვენი შეუნახავი ფაილები ბრაუზერისთვის შესანახად ზედმეტად დიდი იყო." -"connector labels without a saved snapshot are centred on the line, without their background" = "შენახული სნეპშოტის გარეშე შემაერთებლის იარლიყები ხაზზე ცენტრდება, ფონის გარეშე" -"elbowed and curved connectors without a saved path follow FigCraft's own routing" = "შენახული ტრაექტორიის გარეშე კუთხოვანი და მრუდი შემაერთებლები FigCraft-ის საკუთარ მარშრუტს მიჰყვება" -"invalid vector region fill paint list; layer fill used" = "ვექტორული არის შევსების საღებავების სია არასწორია; გამოყენებულია შრის შევსება" -"invalid vector region paints were skipped" = "ვექტორული არის არასწორი საღებავები გამოტოვებულია" -"linked vector region fill styles keep resolved appearance; live style links were left out" = "ვექტორული არის მიბმული შევსების სტილები გამოთვლილ იერსახეს ინარჩუნებს; სტილების ცოცხალი კავშირები არ გადმოვიდა" -"note or shape generated child has invalid bounds; child skipped" = "შენიშვნის ან ფიგურის გენერირებულ შვილობილ ელემენტს არასწორი საზღვრები აქვს; ელემენტი გამოტოვებულია" -"note or shape generated child is missing its style or bounds; child skipped" = "შენიშვნის ან ფიგურის გენერირებულ შვილობილ ელემენტს სტილი ან საზღვრები აკლია; ელემენტი გამოტოვებულია" -"note or shape generated children exceed the layer or nesting limit; remaining children skipped" = "შენიშვნის ან ფიგურის გენერირებული შვილობილი ელემენტები შრეების ან ჩადგმის ლიმიტს აჭარბებს; დანარჩენი ელემენტები გამოტოვებულია" -"note or shape generated layout is missing or unsupported; using its outer frame" = "შენიშვნის ან ფიგურის გენერირებული განლაგება აკლია ან მხარდაუჭერელია; გამოიყენება მისი გარე ჩარჩო" -"shape generated outline is missing or damaged; using its rectangle" = "ფიგურის გენერირებული კონტური აკლია ან დაზიანებულია; გამოიყენება მისი მართკუთხედი" -"variable-bound vector region paints keep resolved appearance; live bindings were left out" = "ცვლადებზე მიბმული ვექტორული არის საღებავები გამოთვლილ იერსახეს ინარჩუნებს; ცოცხალი მიბმები არ გადმოვიდა" -"vector region paint data exceeded import limits and was skipped" = "ვექტორული არის საღებავის მონაცემებმა იმპორტის ლიმიტებს გადააჭარბა და გამოტოვებულია" -"vector region references a missing fill style; layer fill used" = "ვექტორული არე მიუთითებს შევსების არარსებულ სტილზე; გამოყენებულია შრის შევსება" -"{count} in it now · Changed {date}" = "ახლა მასშია: {count} · შეცვლილია: {date}" -"{insertions} · {detachments}" = "{insertions} · {detachments}" -"{period}: {counts}" = "{period}: {counts}" -"{used} · {detached}" = "{used} · {detached}" -"{used} · {inserted}" = "{used} · {inserted}" -"{n} detached" = { one = "გამოყოფილი: {n}", other = "გამოყოფილი: {n}" } -"{n} inserted" = { one = "ჩასმული: {n}", other = "ჩასმული: {n}" } -"⌥⌘ ← ↑ → ↓" = "⌥⌘ ← ↑ → ↓" [commands] "align.bottom" = "ქვემოთ სწორება" @@ -2053,10 +2053,12 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "arrange.tidy" = "მოწესრიგება" "board.addConnected" = "დაკავშირებული ფიგურის დამატება" "board.connector" = "შემაერთებელი" +"board.grid" = "დაფის ბადე" "board.ink" = "მარკერის შტრიხი" "board.label" = "შემაერთებლის წარწერა" "board.nextSticky" = "შემდეგი სტიკერი" "board.reattach" = "შემაერთებლის ხელახლა მიმაგრება" +"board.reshape" = "შემაერთებლის ფორმის შეცვლა" "board.setColor" = "დაფის ფერი" "board.setStyle" = "დაფის სტილი" "board.shape" = "ფიგურა ტექსტით" @@ -2218,6 +2220,8 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "fill.pattern" = "პატერნით შევსება" "fill.remove" = "შევსების წაშლა" "fill.set" = "შევსების დაყენება" +"font.download" = "შრიფტის ჩამოტვირთვა" +"font.downloads" = "შრიფტების ჩამოტვირთვები" "frame.create" = "ჩარჩოს შექმნა" "frame.presets" = "ჩარჩოს პრესეტების სია" "frame.swapOrientation" = "ორიენტაციის შეცვლა" @@ -2234,9 +2238,11 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "help.page" = "დახმარების გვერდი" "help.shortcuts" = "კლავიატურის მალსახმობები" "image.adjust" = "გამოსახულების კორექცია" +"image.crop" = "გამოსახულების ჩამოჭრა" "image.deletePreset" = "გამოსახულების პრესეტის წაშლა" "image.place" = "გამოსახულების განთავსება" "image.presets" = "გამოსახულების პრესეტები" +"image.replace" = "გამოსახულების ჩანაცვლება" "image.savePreset" = "გამოსახულების პრესეტის შენახვა" "inspect.assets" = "რესურსების ინსპექტირება" "inspect.code" = "შრის კოდი" @@ -2263,6 +2269,7 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "library.aliasVariable" = "ბიბლიოთეკის ცვლადის ალიასი" "library.applyStyle" = "ბიბლიოთეკის სტილის გამოყენება" "library.bindVariable" = "ბიბლიოთეკის ცვლადის მიბმა" +"library.check" = "გუნდის ბიბლიოთეკების განახლებების შემოწმება" "library.extendCollection" = "ბიბლიოთეკის კოლექციის გაფართოება" "library.import" = "ბიბლიოთეკის კომპონენტის იმპორტი" "library.importVariable" = "ბიბლიოთეკის ცვლადის იმპორტი" @@ -2524,6 +2531,7 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "variable.deleteCollection" = "კოლექციის წაშლა" "variable.duplicate" = "ცვლადის დუბლირება" "variable.export" = "ცვლადების ექსპორტირება" +"variable.extendCollection" = "კოლექციის გაფართოება" "variable.import" = "ცვლადების იმპორტი" "variable.list" = "ცვლადების სია" "variable.moveMode" = "რეჟიმის გადატანა" @@ -2633,6 +2641,7 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "view.zoomOut" = "დაპატარავება" "view.zoomSelection" = "მონიშნულის მასშტაბირება" "widget.click" = "ვიჯეტზე დაწკაპუნება" +"widget.hover" = "ვიჯეტზე მაჩვენებლის მიტანა" "widget.insert" = "ვიჯეტის ჩასმა" "widget.list" = "ვიჯეტების სია" "widget.menu" = "ვიჯეტის მენიუ" @@ -2650,15 +2659,6 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "file.markSaved" = "შენახულად მარკირება" "text.fit" = "ტექსტის ჩატევა თავის საზღვრებში" "data.fill" = "ასლების მონაცემებით შევსება" -"board.grid" = "დაფის ბადე" -"font.download" = "შრიფტის ჩამოტვირთვა" -"font.downloads" = "შრიფტების ჩამოტვირთვები" -"image.crop" = "გამოსახულების ჩამოჭრა" -"library.check" = "გუნდის ბიბლიოთეკების განახლებების შემოწმება" -"board.reshape" = "შემაერთებლის ფორმის შეცვლა" -"image.replace" = "გამოსახულების ჩანაცვლება" -"variable.extendCollection" = "კოლექციის გაფართოება" -"widget.hover" = "ვიჯეტზე მაჩვენებლის მიტანა" [menu] "bool.exclude" = "გამორიცხვა" From 92cf9849027aff7dc4a2aee82ecdc1bd1d7a0cd1 Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Sun, 8 Nov 2026 17:38:13 -0500 Subject: [PATCH 033/101] Selection: Escape tests for a top-level layer, several layers and the focused frame (#2107 review) One Escape selects nothing for a top-level frame, a top-level layer, two layers in one group, layers in different parents, and a nested layer with a top-level one. With the focused frame itself selected, one Escape leaves the focus view. Co-Authored-By: Claude Opus 5.5 Model-Effort: Opus 5.5 drove and wrote --- crates/engine/src/devfocus_tests.rs | 6 ++++++ crates/engine/src/selection_behaviour_tests.rs | 14 ++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/crates/engine/src/devfocus_tests.rs b/crates/engine/src/devfocus_tests.rs index f36af7ee6..b7a4f9341 100644 --- a/crates/engine/src/devfocus_tests.rs +++ b/crates/engine/src/devfocus_tests.rs @@ -92,6 +92,12 @@ fn only_the_focused_frame_is_hit_and_escape_leaves() { assert_eq!(focused(&s), None, "Escape with nothing selected leaves"); click(&mut s, 350.0, 100.0); assert_eq!(s.selection(), vec![b], "everything is hit again"); + // With the focused frame itself selected, one Escape leaves the focus view. + ex(&mut s, "dev.focus", json!({"id": a})); + ex(&mut s, "select.set", json!({"ids": [a]})); + assert_eq!(focused(&s), Some(a)); + s.escape().unwrap(); + assert_eq!(focused(&s), None, "Escape with the focused frame selected leaves at once"); } #[test] diff --git a/crates/engine/src/selection_behaviour_tests.rs b/crates/engine/src/selection_behaviour_tests.rs index b3289c6c3..6498b8cb5 100644 --- a/crates/engine/src/selection_behaviour_tests.rs +++ b/crates/engine/src/selection_behaviour_tests.rs @@ -277,6 +277,20 @@ fn keyboard_selection() { assert_eq!(s.selection(), Vec::::new(), "Esc from a nested layer selects nothing, not the parent"); s.escape().unwrap(); assert_eq!(s.selection(), Vec::::new()); + // A top-level layer, and several layers, nested or not: one Esc selects nothing. + let cases: Vec<(Vec, &str)> = vec![ + (vec![k.f], "a top-level frame"), + (vec![k.r], "a top-level layer"), + (vec![k.a, k.b], "two layers in one group (not their group)"), + (vec![k.a, k.d], "layers in different parents (not the parents)"), + (vec![k.a, k.r], "a nested layer and a top-level one"), + ]; + for (ids, why) in cases { + ex(&mut s, "select.set", json!({"ids": ids})); + assert_eq!(sorted(s.selection()), sorted(ids.clone()), "{why}: selected"); + s.escape().unwrap(); + assert_eq!(s.selection(), Vec::::new(), "Esc on {why} selects nothing"); + } } #[test] From 0aba3f7632457150cfe18c96510022e1566151c6 Mon Sep 17 00:00:00 2001 From: ljkx <177671075+ljkx@users.noreply.github.com> Date: Mon, 9 Nov 2026 06:15:26 +0100 Subject: [PATCH 034/101] M4: a Pencil stroke stays where it was drawn, without spikes off it (#1741) kurbo's simplify_bezpath, which smooths Pencil samples and runs Simplify path, fitted two common shapes with a curve that ran far off the path: a stroke that goes out and back to the very point it left (kurbo keeps a reversal as a smooth join) and nearly collinear samples (kurbo measures its error across the path, not along it). figcraft_geom::simplify_path cuts the path where it turns back by more than a right angle, simplifies each run with kurbo, and keeps a run as it was when its fit strays more than twice the accuracy from it. The Pencil and vector.simplify use it. --- crates/engine/src/brush_tests.rs | 46 +++++++ crates/engine/src/canvas/tools/pen.rs | 5 +- crates/engine/src/cmd/structure.rs | 8 +- crates/engine/src/vector_behaviour_tests.rs | 21 +++ crates/geom/src/lib.rs | 2 + crates/geom/src/simplify.rs | 140 ++++++++++++++++++++ crates/geom/src/tests.rs | 117 ++++++++++++++++ 7 files changed, 333 insertions(+), 6 deletions(-) create mode 100644 crates/geom/src/simplify.rs diff --git a/crates/engine/src/brush_tests.rs b/crates/engine/src/brush_tests.rs index 35dba6a7f..50317496d 100644 --- a/crates/engine/src/brush_tests.rs +++ b/crates/engine/src/brush_tests.rs @@ -149,3 +149,49 @@ fn the_pencil_draws_white_on_a_dark_background() { assert_eq!(stroke(&mut s, 0.0, 600.0).0, want, "on {bg}"); } } + +/// A Pencil stroke stays where it was drawn: the fitted curve shot far off the stroke, a spike +/// (#1741, its second point), where the stroke went out and back to the very point it left and +/// where samples ran on nearly straight. Pointer pixels become fractional page points, so going +/// back to a pixel lands on exactly the same point. Both sample runs are ones kurbo's fit took +/// hundreds of units off. +#[test] +fn the_pencil_keeps_its_stroke_where_it_was_drawn() { + let mut s = Session::new(); + s.execute("tool.set", &json!({"tool": "pencil"})).unwrap(); + let (p, q) = ((86.043_565_719_086_97, -173.744_402_349_100_94), (87.851_850_739_335_35, -179.202_846_445_954_52)); + let back = [(80.0, -160.0), p, q, p, (95.0, -185.0)]; + let straight = [ + (204.0, -198.0), + (209.598_690_794_015_5, -204.909_328_119_739_88), + (211.277_914_263_870_97, -207.190_974_020_753_4), + (214.246_506_828_720_84, -211.228_827_590_623_24), + (218.0, -214.0), + ]; + for (what, samples) in [("out and back", &back[..]), ("nearly straight", &straight[..])] { + let (first, last) = (samples[0], samples[samples.len() - 1]); + s.pointer(&PointerEvent::at(PointerKind::Down, first.0, first.1, 1.0)).unwrap(); + for (x, y) in &samples[1..] { + s.pointer(&PointerEvent::at(PointerKind::Move, *x, *y, 1.0)).unwrap(); + } + s.pointer(&PointerEvent::at(PointerKind::Up, last.0, last.1, 1.0)).unwrap(); + let doc = s.doc().unwrap(); + let n = doc.nodes().filter(|n| matches!(n.kind, NodeKind::Vector { .. })).max_by_key(|n| n.id).unwrap(); + let NodeKind::Vector { network } = &n.kind else { panic!("{what}: not a vector") }; + let drawn = doc.world_transform(n.id) * network.stroke_path(); + let samples_box = figcraft_geom::points_bounds(samples.iter().map(|(x, y)| Point::new(*x, *y))).unwrap(); + let (path_box, node_box) = (figcraft_geom::Shape::bounding_box(&drawn), doc.world_bounds(n.id).unwrap()); + assert!( + samples_box.inflate(1.5, 1.5).contains_rect(path_box), + "{what}: the stroke {path_box:?} goes past the samples {samples_box:?}: {}", + drawn.to_svg() + ); + assert!(samples_box.inflate(1.5, 1.5).contains_rect(node_box), "{what}: the layer {node_box:?}, the samples {samples_box:?}"); + } + // The turn is a point of the stroke, where it was drawn. + let doc = s.doc().unwrap(); + let turned = doc.nodes().find(|n| n.name == "Vector" && doc.world_bounds(n.id).is_some_and(|b| b.y1 < -150.0 && b.x1 < 100.0)).unwrap(); + let NodeKind::Vector { network } = &turned.kind else { panic!("not a vector") }; + let xf = doc.world_transform(turned.id); + assert!(network.vertices.iter().any(|v| (xf * Point::new(v.x, v.y) - Point::new(q.0, q.1)).hypot() < 1e-6), "no point at the turn"); +} diff --git a/crates/engine/src/canvas/tools/pen.rs b/crates/engine/src/canvas/tools/pen.rs index 4b98ccee1..3f8b47e59 100644 --- a/crates/engine/src/canvas/tools/pen.rs +++ b/crates/engine/src/canvas/tools/pen.rs @@ -313,7 +313,8 @@ impl Session { if points.len() < 2 { return Ok(()); } - // Smooth: fit a curve through the samples. + // Smooth: fit a curve through the samples, kept from shooting past them where the stroke + // turns back or runs nearly straight (#1741). let mut poly = figcraft_geom::BezPath::new(); for (k, p) in points.iter().enumerate() { if k == 0 { @@ -322,7 +323,7 @@ impl Session { poly.line_to(*p); } } - let fitted = figcraft_geom::kurbo::simplify::simplify_bezpath(poly.iter(), 0.75, &Default::default()); + let fitted = figcraft_geom::simplify_path(&poly, 0.75); let d = fitted.to_svg(); if matches!(self.tool.tool, ToolId::Marker | ToolId::Highlighter) { return self.ink_finish(&d); diff --git a/crates/engine/src/cmd/structure.rs b/crates/engine/src/cmd/structure.rs index 3339faa38..34cc91fbb 100644 --- a/crates/engine/src/cmd/structure.rs +++ b/crates/engine/src/cmd/structure.rs @@ -799,7 +799,7 @@ fn simplify(s: &mut Session, p: &Value) -> Result { WindingRule::NonZero }; let path = drawn.fill_path(); - let path = figcraft_geom::kurbo::simplify::simplify_bezpath(path.iter(), tol, &Default::default()); + let path = figcraft_geom::simplify_path(&path, tol); let (path, output_winding) = match figcraft_pathops::simplify_with_rule(&path, winding == WindingRule::EvenOdd) { Ok(path) => (path, WindingRule::EvenOdd), Err(_) => (path, winding), @@ -809,7 +809,7 @@ fn simplify(s: &mut Session, p: &Value) -> Result { } else { for (index, region) in source.regions.iter().enumerate() { let Some(path) = drawn.region_path(index) else { continue }; - let path = figcraft_geom::kurbo::simplify::simplify_bezpath(path.iter(), tol, &Default::default()); + let path = figcraft_geom::simplify_path(&path, tol); let path = figcraft_pathops::simplify_with_rule(&path, region.winding == WindingRule::EvenOdd).unwrap_or(path); append_region_path(&mut net, &path, region, region.winding); } @@ -826,7 +826,7 @@ fn simplify(s: &mut Session, p: &Value) -> Result { open.regions.clear(); if !open.segments.is_empty() { let path = open.stroke_path(); - let simplified = figcraft_geom::kurbo::simplify::simplify_bezpath(path.iter(), tol, &Default::default()); + let simplified = figcraft_geom::simplify_path(&path, tol); let mut loose = VectorNetwork::from_path(&simplified); loose.regions.clear(); append_network(&mut net, loose); @@ -834,7 +834,7 @@ fn simplify(s: &mut Session, p: &Value) -> Result { } if source.regions.is_empty() { let path = source.stroke_path(); - let simplified = figcraft_geom::kurbo::simplify::simplify_bezpath(path.iter(), tol, &Default::default()); + let simplified = figcraft_geom::simplify_path(&path, tol); net = VectorNetwork::from_path(&simplified); net.regions.clear(); } diff --git a/crates/engine/src/vector_behaviour_tests.rs b/crates/engine/src/vector_behaviour_tests.rs index c990ad348..4666c3028 100644 --- a/crates/engine/src/vector_behaviour_tests.rs +++ b/crates/engine/src/vector_behaviour_tests.rs @@ -326,6 +326,27 @@ fn ex_to_vector(doc: &mut figcraft_doc::Document, id: NodeId) { doc.get_mut(id).unwrap().kind = NodeKind::Vector { network }; } +/// Simplify path keeps nearly collinear points near where they were: kurbo's fit, which Simplify +/// path and the Pencil share, ran a handle hundreds of units on along the line (#1741). +#[test] +fn simplify_keeps_nearly_collinear_points_near_them() { + let mut s = Session::new(); + let id = id_of(&ex(&mut s, "vector.create", json!({"path": "M0 0 L10 10"}))["id"]).unwrap(); + // The points exactly as sampled, at the page origin (`vector.create` would move them). + let d = "M209.5986907940155 -204.90932811973988 L211.27791426387097 -207.1909740207534 L214.24650682872084 -211.22882759062324"; + let before = BezPath::from_svg(d).unwrap(); + { + let n = s.doc_mut().unwrap().get_mut(id).unwrap(); + n.transform = figcraft_geom::Affine::IDENTITY; + n.kind = NodeKind::Vector { network: VectorNetwork::from_path(&before) }; + } + assert_eq!(net(&s, id).stroke_path().elements(), before.elements(), "the samples as they were"); + ex(&mut s, "vector.simplify", json!({"ids": [id], "tolerance": 0.75})); + let after = s.doc().unwrap().world_transform(id) * net(&s, id).stroke_path(); + let (b0, b1) = (before.bounding_box(), after.bounding_box()); + assert!(b0.inflate(1.5, 1.5).contains_rect(b1), "{b1:?} past {b0:?}: {}", after.to_svg()); +} + fn ex(s: &mut Session, cmd: &str, p: Value) -> Value { s.execute(cmd, &p).unwrap_or_else(|e| panic!("{cmd}: {e}")) } diff --git a/crates/geom/src/lib.rs b/crates/geom/src/lib.rs index a775a4170..191b30419 100644 --- a/crates/geom/src/lib.rs +++ b/crates/geom/src/lib.rs @@ -12,7 +12,9 @@ use kurbo::ParamCurve; use std::f64::consts::{FRAC_PI_2, PI, TAU}; pub mod measure; +mod simplify; mod transform; +pub use simplify::simplify_path; pub use transform::*; /// Corner radii in clockwise order from the top-left: `[tl, tr, br, bl]`. diff --git a/crates/geom/src/simplify.rs b/crates/geom/src/simplify.rs new file mode 100644 index 000000000..e768f303a --- /dev/null +++ b/crates/geom/src/simplify.rs @@ -0,0 +1,140 @@ +//! Path simplification that keeps to its input where kurbo's fit would shoot past it. + +use kurbo::{BezPath, ParamCurve, ParamCurveNearest, PathEl, PathSeg, Point, Vec2}; + +/// How far, as a multiple of the accuracy asked for, a fitted run may stray from the run it +/// replaces before the run is kept as it was. kurbo's own fits stay within about the accuracy; its +/// failures stray by tens to hundreds of units, so twice the accuracy tells them apart without +/// undoing fits that are merely a little over. +const STRAY: f64 = 2.0; + +/// `path` simplified to within `accuracy` by kurbo's [`simplify_bezpath`], kept from straying +/// far from `path` where kurbo's fit does. +/// +/// Two inputs made kurbo's fit shoot far past the path it simplified (#1741, a Pencil stroke with +/// a spike off it), and both are common in pointer samples: +/// - A join where the path turns straight back (samples going down and back up the same line): +/// kurbo keeps two segments in one smooth fit when their tangents are parallel whichever way +/// they point (`|cross| <= |dot| * angle_thresh`), so it fits a smooth curve through the cusp. +/// The path is cut where it turns back by more than a right angle, each run between the cuts is +/// simplified on its own, and the runs are joined again, so the turn stays a sharp corner. Any +/// other join that isn't straight within kurbo's threshold is a corner to kurbo already, so the +/// cut changes nothing there. +/// - A run of nearly collinear segments: kurbo measures its error across the path, not along it, so +/// a fitted cubic whose handle runs hundreds of units on along the line passes its check. Each +/// fitted run is measured against the run it replaces, and one that strays more than +/// twice `accuracy` from it is kept as it was instead. +/// +/// Subpaths and closes are kept, and a closing segment stays implicit, as kurbo leaves it. +/// +/// [`simplify_bezpath`]: kurbo::simplify::simplify_bezpath +pub fn simplify_path(path: &BezPath, accuracy: f64) -> BezPath { + let mut out = BezPath::new(); + let mut run = BezPath::new(); + // Where the current subpath started, where the pen is, and the last segment's end tangent. + let mut start = Point::ZERO; + let mut at = Point::ZERO; + let mut last_tan: Option = None; + // Whether the next run that draws anything has to start the subpath with its move. + let mut fresh = true; + for el in path.elements() { + let seg = match *el { + PathEl::MoveTo(p) => { + flush(&mut out, &mut run, accuracy, &mut fresh); + (start, at, last_tan, fresh) = (p, p, None, true); + run.move_to(p); + continue; + } + PathEl::ClosePath => { + flush(&mut out, &mut run, accuracy, &mut fresh); + if !fresh { + out.close_path(); + } + // A segment after a close starts a new subpath at the closed one's start. + (at, last_tan, fresh) = (start, None, true); + run.move_to(start); + continue; + } + PathEl::LineTo(p) => PathSeg::Line(kurbo::Line::new(at, p)), + PathEl::QuadTo(p1, p2) => PathSeg::Quad(kurbo::QuadBez::new(at, p1, p2)), + PathEl::CurveTo(p1, p2, p3) => PathSeg::Cubic(kurbo::CubicBez::new(at, p1, p2, p3)), + }; + if run.elements().is_empty() { + run.move_to(at); + } + let Some((t0, t1)) = tangents(seg) else { continue }; + if last_tan.is_some_and(|last| last.dot(t0) < 0.0) { + flush(&mut out, &mut run, accuracy, &mut fresh); + run.move_to(at); + } + run.push(*el); + at = seg.end(); + last_tan = Some(t1); + } + flush(&mut out, &mut run, accuracy, &mut fresh); + out +} + +/// Simplify `run` (one move and the segments after it) with kurbo and append it to `out`; the +/// run's move is kept only when it starts a subpath (`fresh`), else the run carries on from the +/// last point drawn. `run` is left empty. +fn flush(out: &mut BezPath, run: &mut BezPath, accuracy: f64, fresh: &mut bool) { + if run.elements().len() > 1 { + let fitted = kurbo::simplify::simplify_bezpath(run.iter(), accuracy, &Default::default()); + let fitted = if keeps_to(&fitted, run, STRAY * accuracy) { fitted } else { std::mem::take(run) }; + for el in fitted.elements() { + match el { + PathEl::MoveTo(_) if !*fresh => {} + _ => { + out.push(*el); + *fresh = false; + } + } + } + } + *run = BezPath::new(); +} + +/// Whether every point of `fitted` lies within `tol` of `source`: one subpath each, from the same +/// start to the same end, `fitted` being kurbo's simplification of `source`. +/// +/// kurbo ends each fitted segment on the source, so the two are walked together: for each fitted +/// segment, the source segments from where it starts to the first one its end lies on are the only +/// ones its sample points are measured against. The work is linear in the two lengths. A fitted end +/// found on no source segment counts as straying. +fn keeps_to(fitted: &BezPath, source: &BezPath, tol: f64) -> bool { + /// Parts each fitted segment is cut into: the points between them are the ones measured. + const SAMPLES: u32 = 16; + let src: Vec = source.segments().collect(); + // kurbo puts each end on the source by evaluating it: off by rounding at most. + let on2 = (tol * 1e-3).powi(2); + let (tol2, mut cur) = (tol * tol, 0); + for seg in fitted.segments() { + let Some(last) = (cur..src.len()).find(|&i| src.get(i).is_some_and(|s| s.nearest(seg.end(), 1e-9).distance_sq <= on2)) else { + return false; + }; + let near = src.get(cur..=last).unwrap_or_default(); + for i in 1..SAMPLES { + let p = seg.eval(f64::from(i) / f64::from(SAMPLES)); + if !near.iter().any(|s| s.nearest(p, 1e-6).distance_sq <= tol2) { + return false; + } + } + cur = last; + } + true +} + +/// The directions `seg` leaves its start and reaches its end, skipping control points that sit on +/// an end; `None` for a segment of no length, which kurbo skips too. +fn tangents(seg: PathSeg) -> Option<(Vec2, Vec2)> { + let pts: Vec = match seg { + PathSeg::Line(l) => vec![l.p0, l.p1], + PathSeg::Quad(q) => vec![q.p0, q.p1, q.p2], + PathSeg::Cubic(c) => vec![c.p0, c.p1, c.p2, c.p3], + }; + let (first, last) = (*pts.first()?, *pts.last()?); + let t0 = pts.iter().map(|p| *p - first).find(|d| d.hypot2() > 0.0)?; + let t1 = pts.iter().rev().map(|p| last - *p).find(|d| d.hypot2() > 0.0)?; + Some((t0, t1)) +} diff --git a/crates/geom/src/tests.rs b/crates/geom/src/tests.rs index 459b2b101..10e09318c 100644 --- a/crates/geom/src/tests.rs +++ b/crates/geom/src/tests.rs @@ -366,3 +366,120 @@ fn svg_path_refuses_numbers_past_the_limit_before_parsing() { assert!(number_past("M0 0L-2.5.5 1e-3-4e3z", 1e3)); assert!(number_past("M.5.5e10", 1e3)); } + +/// A path through `pts` with straight lines (pencil samples). +fn polyline(pts: &[(f64, f64)]) -> BezPath { + let mut p = BezPath::new(); + for (k, (x, y)) in pts.iter().enumerate() { + if k == 0 { p.move_to((*x, *y)) } else { p.line_to((*x, *y)) } + } + p +} + +/// How far `out` strays from `input`: the largest distance from a point sampled along `out` to the +/// nearest segment of `input` (closing segments included). +fn deviation(out: &BezPath, input: &BezPath) -> f64 { + use kurbo::{ParamCurve, ParamCurveNearest}; + let segs: Vec = input.segments().collect(); + out.segments() + .flat_map(|seg| (0..=32).map(move |i| seg.eval(f64::from(i) / 32.0))) + .map(|p| segs.iter().map(|s| s.nearest(p, 1e-6).distance_sq).fold(f64::INFINITY, f64::min).sqrt()) + .fold(0.0, f64::max) +} + +/// Pencil strokes kurbo's fit shot far past keep to their samples (#1741): a stroke that goes out +/// and back to the very point it left, nearly collinear samples, and strokes that turn back along +/// their own line. The first two are from fuzzing pencil-like strokes, where kurbo's curve went +/// about 390 and 160 units off; at whole-pixel coordinates the same shapes happened to fit well. +#[test] +fn simplifying_keeps_to_strokes_kurbo_shot_past() { + use kurbo::ParamCurve; + let cases: [(&str, &[(f64, f64)]); 5] = [ + ( + "out and back to the same point", + &[ + (86.043_565_719_086_97, -173.744_402_349_100_94), + (87.851_850_739_335_35, -179.202_846_445_954_52), + (86.043_565_719_086_97, -173.744_402_349_100_94), + ], + ), + ( + "nearly collinear", + &[ + (209.598_690_794_015_5, -204.909_328_119_739_88), + (211.277_914_263_870_97, -207.190_974_020_753_4), + (214.246_506_828_720_84, -211.228_827_590_623_24), + ], + ), + ( + "a dip straight down and back up", + &[(0.0, 0.0), (10.0, 0.0), (20.0, 2.0), (30.0, 6.0), (30.0, 12.0), (30.0, 6.0), (40.0, 2.0), (50.0, 0.0)], + ), + ("a slip back at the end", &[(0.0, 0.0), (10.0, 3.0), (20.0, 8.0), (30.0, 15.0), (30.0, 25.0), (30.0, 22.0)]), + ( + "a near reversal in a curve", + &[(0.0, 0.0), (8.0, 2.0), (16.0, 6.0), (24.0, 12.0), (32.0, 20.0), (24.0, 12.000_01), (16.0, 6.0), (8.0, 2.0)], + ), + ]; + for (what, pts) in cases { + let input = polyline(pts); + let out = simplify_path(&input, 0.75); + let d = deviation(&out, &input); + assert!(d <= 1.5, "{what}: strays {d} from the samples: {}", out.to_svg()); + let (inb, outb) = (input.bounding_box(), out.bounding_box()); + assert!(inb.inflate(1.5, 1.5).contains_rect(outb), "{what}: {outb:?} past {inb:?}"); + // One subpath, starting and ending where the stroke does. + let moves = out.elements().iter().filter(|e| matches!(e, kurbo::PathEl::MoveTo(_))).count(); + assert_eq!(moves, 1, "{what}: {}", out.to_svg()); + let (first, last) = (pts[0], pts[pts.len() - 1]); + assert_eq!(out.segments().next().map(|s| s.start()), Some(Point::new(first.0, first.1)), "{what}"); + assert_eq!(out.segments().last().map(|s| s.end()), Some(Point::new(last.0, last.1)), "{what}"); + } +} + +/// Where a path never turns back and kurbo's fit holds, the result is kurbo's own, element for +/// element: smooth runs, corners sharper than a right angle, closed subpaths and several subpaths. +#[test] +fn simplifying_is_kurbos_where_its_fit_holds() { + let wave: Vec<(f64, f64)> = (0..=60).map(|i| (f64::from(i) * 4.0, (f64::from(i) / 6.0).sin() * 30.0)).collect(); + let zigzag: Vec<(f64, f64)> = (0..=8).map(|i| (f64::from(i) * 10.0, if i % 2 == 0 { 0.0 } else { 40.0 })).collect(); + let mut closed = polyline(&wave[..20]); + closed.close_path(); + let mut several = polyline(&wave); + several.extend(polyline(&zigzag).elements().iter().map(|e| match *e { + kurbo::PathEl::MoveTo(p) => kurbo::PathEl::MoveTo(p + Vec2::new(0.0, 100.0)), + kurbo::PathEl::LineTo(p) => kurbo::PathEl::LineTo(p + Vec2::new(0.0, 100.0)), + e => e, + })); + let curves = BezPath::from_svg("M0 0 C10 -20 30 -20 40 0 C50 20 70 20 80 0 Q100 -30 120 0 L140 10 Z M200 0 L240 0").unwrap(); + for (what, input) in + [("a wave", polyline(&wave)), ("a zigzag", polyline(&zigzag)), ("closed", closed), ("two subpaths", several), ("curves", curves)] + { + let ours = simplify_path(&input, 0.75); + let theirs = kurbo::simplify::simplify_bezpath(input.iter(), 0.75, &Default::default()); + assert_eq!(ours.elements(), theirs.elements(), "{what}"); + } +} + +/// A closed path with a reversal in it stays one closed subpath, and each subpath of several keeps +/// its own start. +#[test] +fn simplifying_keeps_closes_and_subpaths_across_a_reversal() { + let mut input = polyline(&[(0.0, 0.0), (40.0, 0.0), (40.0, 30.0), (40.0, 20.0), (0.0, 30.0)]); + input.close_path(); + input.extend(polyline(&[(100.0, 0.0), (100.0, 20.0), (100.0, 10.0)]).elements().iter().copied()); + let out = simplify_path(&input, 0.75); + let els = out.elements(); + let moves: Vec = els.iter().filter_map(|e| if let kurbo::PathEl::MoveTo(p) = e { Some(*p) } else { None }).collect(); + assert_eq!(moves, [Point::new(0.0, 0.0), Point::new(100.0, 0.0)], "{}", out.to_svg()); + assert_eq!(els.iter().filter(|e| matches!(e, kurbo::PathEl::ClosePath)).count(), 1, "{}", out.to_svg()); + let close = els.iter().position(|e| matches!(e, kurbo::PathEl::ClosePath)).unwrap(); + assert!(matches!(els[close + 1], kurbo::PathEl::MoveTo(_)), "the first subpath closes before the second starts"); + assert!(deviation(&out, &input) <= 1.5, "{}", out.to_svg()); + // Nothing to draw: nothing out, not a stray move or close. + let mut empty = BezPath::new(); + empty.move_to((5.0, 5.0)); + empty.line_to((5.0, 5.0)); + empty.close_path(); + assert!(simplify_path(&empty, 0.75).elements().is_empty()); +} From cf567c3f63993b0ec0aabe122b2fac73b900e6e0 Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Mon, 9 Nov 2026 00:51:03 -0500 Subject: [PATCH 035/101] M2: a child dragged in auto layout passes a sibling when its leading edge reaches the sibling's middle Within its own row or column, a dragged child's slot follows the box it would fill under the pointer (start bounds plus the unsnapped drag), by the edge facing the drag, not the pointer. Measured in Figma's web app, 2026-11-09. Dragging in from outside, wrapping layouts and grids keep their rules. Several moving layers use their combined box. Co-Authored-By: Claude Sonnet 5.5 Model-Effort: Opus 5.5 drove and briefed; Sonnet 5.5 measured and wrote at medium --- crates/engine/src/al_drag_tests.rs | 53 ++++++++++++++++++++++++++ crates/engine/src/canvas/drop.rs | 40 ++++++++++++++++--- crates/engine/src/canvas/tools/drag.rs | 16 +++++++- docs/auto-layout-parity.md | 5 ++- 4 files changed, 105 insertions(+), 9 deletions(-) diff --git a/crates/engine/src/al_drag_tests.rs b/crates/engine/src/al_drag_tests.rs index 528fdd9d7..23f416481 100644 --- a/crates/engine/src/al_drag_tests.rs +++ b/crates/engine/src/al_drag_tests.rs @@ -69,3 +69,56 @@ fn grid_drag_takes_the_cell_under_the_pointer() { let cl = s.doc().unwrap().node(kids[0]).unwrap().child_layout.clone(); assert_eq!((cl.grid_column, cl.grid_row), (None, None), "one undo step"); } + +/// Three 60 x 60 rectangles in a row (or column), gap 20, at 0, 80 and 160 along the flow. +fn three(s: &mut Session, mode: &str) -> (NodeId, [NodeId; 3]) { + let f = id(s.execute("frame.create", &json!({"x": 0, "y": 0, "width": 300, "height": 300})).unwrap()); + let kids: Vec = + (0..3).map(|_| id(s.execute("shape.rectangle", &json!({"x": 0, "y": 0, "width": 60, "height": 60, "parent": f})).unwrap())).collect(); + s.execute("layout.add", &json!({"ids": [f]})).unwrap(); + s.execute("node.set", &json!({"id": f, "props": {"layoutMode": mode, "gap": 20, "padding": 0, "sizingH": "fixed", "sizingV": "fixed"}})).unwrap(); + s.execute("select.none", &json!({})).unwrap(); + (f, [kids[0], kids[1], kids[2]]) +} + +/// The order after dragging kid `which` by `by` along the flow, grabbed `grab` from its start edge. +fn dragged_order(mode: &str, which: usize, grab: f64, by: f64) -> Vec { + let mut s = Session::new(); + let (f, kids) = three(&mut s, mode); + let vertical = mode == "vertical"; + let b = s.doc().unwrap().world_bounds(kids[which]).unwrap(); + let from = if vertical { (b.center().x, b.y0 + grab) } else { (b.x0 + grab, b.center().y) }; + let to = if vertical { (from.0, from.1 + by) } else { (from.0 + by, from.1) }; + drag(&mut s, from, to); + let order = s.doc().unwrap().node(f).unwrap().children.clone(); + order.iter().map(|c| kids.iter().position(|k| k == c).unwrap()).collect() +} + +#[test] +fn a_child_dragged_right_passes_a_sibling_when_its_leading_edge_reaches_the_siblings_middle() { + assert_eq!(dragged_order("horizontal", 0, 30.0, 49.0), vec![0, 1, 2]); + assert_eq!(dragged_order("horizontal", 0, 30.0, 50.0), vec![1, 0, 2]); + assert_eq!(dragged_order("horizontal", 0, 30.0, 129.0), vec![1, 0, 2]); + assert_eq!(dragged_order("horizontal", 0, 30.0, 130.0), vec![1, 2, 0]); +} + +#[test] +fn where_the_child_is_grabbed_does_not_change_its_slot() { + assert_eq!(dragged_order("horizontal", 0, 10.0, 49.0), vec![0, 1, 2]); + assert_eq!(dragged_order("horizontal", 0, 10.0, 50.0), vec![1, 0, 2]); + assert_eq!(dragged_order("horizontal", 0, 10.0, 129.0), vec![1, 0, 2]); + assert_eq!(dragged_order("horizontal", 0, 10.0, 130.0), vec![1, 2, 0]); +} + +#[test] +fn a_child_dragged_left_passes_a_sibling_by_its_left_edge() { + assert_eq!(dragged_order("horizontal", 2, 30.0, -49.0), vec![0, 1, 2]); + assert_eq!(dragged_order("horizontal", 2, 30.0, -50.0), vec![0, 2, 1]); + assert_eq!(dragged_order("horizontal", 2, 30.0, -130.0), vec![2, 0, 1]); +} + +#[test] +fn a_column_reorders_by_the_bottom_edge() { + assert_eq!(dragged_order("vertical", 0, 30.0, 50.0), vec![1, 0, 2]); + assert_eq!(dragged_order("vertical", 0, 30.0, 130.0), vec![1, 2, 0]); +} diff --git a/crates/engine/src/canvas/drop.rs b/crates/engine/src/canvas/drop.rs index e46734ac9..7bad66ac3 100644 --- a/crates/engine/src/canvas/drop.rs +++ b/crates/engine/src/canvas/drop.rs @@ -20,6 +20,31 @@ pub struct DropSlot { /// placed child whose centre is past the pointer, and the line to draw there. Hidden children and /// those ignoring auto layout don't take part. pub fn auto_layout_slot(doc: &Document, parent: NodeId, p: Point, exclude: &[NodeId]) -> Option<(usize, Option<[f64; 4]>)> { + slot_in(doc, parent, p, exclude, None) +} + +/// [`auto_layout_slot`] for layers dragged within their own frame (measured in Figma's web app, +/// 2026-11-09): the slot follows the leading edge of `moved`, the box the layers would fill under +/// the pointer, in the direction of `delta` (the drag along the page). Wrapping layouts keep the +/// pointer rule. +pub fn auto_layout_slot_within( + doc: &Document, + parent: NodeId, + p: Point, + exclude: &[NodeId], + moved: figcraft_geom::Rect, + delta: Point, +) -> Option<(usize, Option<[f64; 4]>)> { + slot_in(doc, parent, p, exclude, Some((moved, delta))) +} + +fn slot_in( + doc: &Document, + parent: NodeId, + p: Point, + exclude: &[NodeId], + dragged: Option<(figcraft_geom::Rect, Point)>, +) -> Option<(usize, Option<[f64; 4]>)> { let pn = doc.node(parent)?; let layout = pn.layout.as_ref()?; let vertical = layout.mode == LayoutMode::Vertical; @@ -34,11 +59,16 @@ pub fn auto_layout_slot(doc: &Document, parent: NodeId, p: Point, exclude: &[Nod let (k, line) = wrap_slot(doc, &flow_ids, p, vertical); return Some((index(k), line)); } - let pos = if vertical { p.y } else { p.x }; - let k = flow_ids - .iter() - .position(|c| doc.world_bounds(*c).is_some_and(|b| pos < if vertical { b.center().y } else { b.center().x })) - .unwrap_or(flow_ids.len()); + let mid = |c: &NodeId| doc.world_bounds(*c).map(|b| if vertical { b.center().y } else { b.center().x }); + let k = if let Some((r, d)) = dragged { + let (lo, hi, dd) = if vertical { (r.y0, r.y1, d.y) } else { (r.x0, r.x1, d.x) }; + // Forward: past every sibling whose middle the trailing edge has reached; backward: past + // every one whose middle lies before the leading (low) edge. + flow_ids.iter().position(|c| mid(c).is_some_and(|m| if dd > 0.0 { m > hi } else { m >= lo })).unwrap_or(flow_ids.len()) + } else { + let pos = if vertical { p.y } else { p.x }; + flow_ids.iter().position(|c| mid(c).is_some_and(|m| pos < m)).unwrap_or(flow_ids.len()) + }; let line = flow_ids.get(k).and_then(|c| doc.world_bounds(*c)).map(|b| line_before(b, vertical, 2.0)).or_else(|| { flow_ids .last() diff --git a/crates/engine/src/canvas/tools/drag.rs b/crates/engine/src/canvas/tools/drag.rs index 64d48bc86..94f0e654e 100644 --- a/crates/engine/src/canvas/tools/drag.rs +++ b/crates/engine/src/canvas/tools/drag.rs @@ -216,6 +216,8 @@ impl Session { } } // Cmd/Ctrl (and Control on macOS) held while dragging suspends snapping. + // The pointer's own drag, before snapping: a reorder in auto layout follows it. + let raw = d; let snap_on = self.ds().map(|ds| ds.view.snap_objects).unwrap_or(true) && !ev.cmd && !ev.ctrl; let mut guides = Vec::new(); if self.ds().map(|ds| ds.view.snap_pixel).unwrap_or(true) { @@ -268,8 +270,18 @@ impl Session { // cell) under the pointer, as the frame shows it now. A frame other than the // one they come from is outlined too. let cell = if mode == LayoutMode::Grid { crate::drop::grid_cell_at(doc, target, p) } else { None }; - let idx = - if mode == LayoutMode::Grid { 0 } else { crate::drop::auto_layout_slot(doc, target, p, &moving).map_or(0, |(i, _)| i) }; + // Within the frame they came from, the slot follows the leading edge of the + // box they would fill (their combined start bounds moved by the drag), not + // the pointer. The preview starts from the document as the drag began. + let within = moving.iter().all(|m| doc.node(*m).is_some_and(|n| n.parent == Some(target))); + let idx = if mode == LayoutMode::Grid { + 0 + } else if let (true, Some(b)) = (within, doc.bounds_of(&moving)) { + let moved = Rect::new(b.x0 + raw.x, b.y0 + raw.y, b.x1 + raw.x, b.y1 + raw.y); + crate::drop::auto_layout_slot_within(doc, target, p, &moving, moved, Point::new(raw.x, raw.y)).map_or(0, |(i, _)| i) + } else { + crate::drop::auto_layout_slot(doc, target, p, &moving).map_or(0, |(i, _)| i) + }; for m in &moving { if doc.get(*m)?.parent != Some(target) { doc.reparent(*m, target, None)?; diff --git a/docs/auto-layout-parity.md b/docs/auto-layout-parity.md index f60cd4350..16776ca5e 100644 --- a/docs/auto-layout-parity.md +++ b/docs/auto-layout-parity.md @@ -1,6 +1,6 @@ # Auto layout and constraints parity -> **Last reviewed:** 2026-10-11 · **Last updated:** 2026-11-03 · **Change:** patch (a Cmd/Ctrl-click on a padding field sets all four sides with the value typed, as the Guide to auto layout's shortcut guide says; Suggest auto layout is its own command, as the help center says: it adds as many auto layout frames as needed, splitting a frame's layers into rows or columns by the gaps between them, and keeps the placement of the design where the gaps are even (#1823); baseline alignment puts a layer without text with its bottom on the line, as the help center's figure shows an icon next to text (#1825); fill children share the free space by their content area, border-box fashion, as the Flexbox article says (#1824); double-click an edge of an auto layout frame's box for Hug contents, Alt+double-click an edge of a child's box for Fill container, as the Guide to auto layout says (#1838); a child resized to the full available space of its auto layout frame becomes Fill container on that axis, as the Guide to auto layout says; a text keeps a max height or a number of max lines, not both, as the Guide to auto layout says: a max height sets max lines to Auto and max lines remove the max height; Remove all auto layout, as the help center's More layout options has it: `layout.removeAll` takes the auto layout off a frame and every frame nested in it in one undo step; grid auto-placement looks for free cells a 64-bit word at a time and skips what blocks it, with the same placements (#1083); Layout sidebar: Add auto layout (+) is available for groups and converts a single group to a frame in place, with mask order, flow-only inference and Fill sizing preserved; adding auto layout to an empty frame keeps its size (#369); `node.set` applies auto layout keys only to frames, with warnings (#603); core editor leftovers: auto gap handles, wrapped-line alignment; behaviour suite written from the public documentation, every rule's status; fixes and the missing settings it found) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-11 · **Last updated:** 2026-11-09 · **Change:** patch (a child dragged within its own auto layout row or column passes a sibling when its leading edge reaches the sibling's middle, as measured in Figma's web app, wherever it is grabbed; a Cmd/Ctrl-click on a padding field sets all four sides with the value typed, as the Guide to auto layout's shortcut guide says; Suggest auto layout is its own command, as the help center says: it adds as many auto layout frames as needed, splitting a frame's layers into rows or columns by the gaps between them, and keeps the placement of the design where the gaps are even (#1823); baseline alignment puts a layer without text with its bottom on the line, as the help center's figure shows an icon next to text (#1825); fill children share the free space by their content area, border-box fashion, as the Flexbox article says (#1824); double-click an edge of an auto layout frame's box for Hug contents, Alt+double-click an edge of a child's box for Fill container, as the Guide to auto layout says (#1838); a child resized to the full available space of its auto layout frame becomes Fill container on that axis, as the Guide to auto layout says; a text keeps a max height or a number of max lines, not both, as the Guide to auto layout says: a max height sets max lines to Auto and max lines remove the max height; Remove all auto layout, as the help center's More layout options has it: `layout.removeAll` takes the auto layout off a frame and every frame nested in it in one undo step; grid auto-placement looks for free cells a 64-bit word at a time and skips what blocks it, with the same placements (#1083); Layout sidebar: Add auto layout (+) is available for groups and converts a single group to a frame in place, with mask order, flow-only inference and Fill sizing preserved; adding auto layout to an empty frame keeps its size (#369); `node.set` applies auto layout keys only to frames, with warnings (#603); core editor leftovers: auto gap handles, wrapped-line alignment; behaviour suite written from the public documentation, every rule's status; fixes and the missing settings it found) · **Target:** Figma Design (desktop app 126.10.7) Auto layout is the most used layout feature in Figma and the one where small differences (a hugging frame one pixel off, text wrapping at another width) break real files. **Breadth ~98%, @@ -88,7 +88,7 @@ Status: **pass** (a case in the suite holds), **fixed** (the suite found a diver | Absolute position (ignore auto layout) with constraints | done | | | Strokes included in layout (inside strokes), canvas stacking | done | | | On-canvas padding and gap handles, incl. wrap row/column gap and grid gaps | done | an automatic gap's handle shows the distance it has; dragging it fixes the gap from there (silent in the documentation) | -| Drag to reorder (wrap-aware, by row or column), into grid cells, across nested frames | done | `al_drag_tests.rs` | +| Drag to reorder (wrap-aware, by row or column), into grid cells, across nested frames | done | `al_drag_tests.rs`. A child dragged within its own row or column takes its slot by the dragged box's leading edge, not the pointer: it passes a sibling when the edge facing the drag reaches the sibling's middle (right or bottom edge going forward, left or top edge going back), wherever it was grabbed. Measured in Figma's web app, 2026-11-09 (three 60 x 60 rectangles, gap 20: after B at 50, after C at 130; the mirror for a leftward drag; the same along y). Layers dragged in from outside and wrapping layouts keep the pointer rule (unmeasured). Tests: `a_child_dragged_right_passes_a_sibling_when_its_leading_edge_reaches_the_siblings_middle`, `where_the_child_is_grabbed_does_not_change_its_slot`, `a_child_dragged_left_passes_a_sibling_by_its_left_edge`, `a_column_reorders_by_the_bottom_edge` | | Arrow keys move children one place (flows, rows, columns, grid cells, into neighbours) | done | `al_keys_tests.rs` | | Constraints: left, right, left and right, centre, scale; top/bottom likewise | done | | | Layout grids: columns, rows, grid; stretch/left/centre/right; variables bound | done | | @@ -104,6 +104,7 @@ Status: **pass** (a case in the suite holds), **fixed** (the suite found a diver | 2026-11-05 | patch | M2, #1823: Suggest auto layout is no longer Add auto layout under another name: `layout.suggest` splits a frame's layers into rows (Vertical) or else columns (Horizontal) by the gaps between their boxes, wraps each band of several layers in a new frame without fill or clipping that hugs it, and repeats inside it (16 levels, 1,000 layers per frame at most). The frame keeps its size; gap and padding come from the bands, so layers keep their boxes where the gaps are even and the bands start at the same offset; instances and layers inside them are refused; uneven gaps (smallest used), bands that start at different offsets across the flow (lined up at the smallest) and layers that overlap along both axes come back as `warnings`. A band frame hugs only when its own split succeeds: a band whose layers overlap along both axes gets no auto layout and stays Fixed, so it cannot reflow those children. `direction` sets the top level only; one undo step; `layout.add` is unchanged. Tests in `layout_suggest_tests.rs` | | 2026-11-02 | patch | M2: a Cmd/Ctrl-click on a padding field (the horizontal or vertical pair, or a side with Individual padding open) makes the value typed go to all four sides in one undo step (Guide to auto layout, Keyboard shortcut guide); a plain click still edits that axis or side alone. The modifier was ignored before. Test: `padding_individual_tests` | | 2026-11-03 | patch | M2, #1825: baseline alignment of a layer without text (an icon next to a text) puts its bottom on the line's baseline, as the help center's figure shows ("the bottoms of the icon and the word home are aligned on the red line"); it kept to the top of the line. A layer reaching below the text's baseline moves the text down, and a line with no text lines the layers' bottoms up (the documentation is silent; CSS baseline alignment does the same). Tests: `alignment_rules` (three cases), engine `baseline_alignment_puts_an_icons_bottom_on_the_text_baseline`. Numbers unchanged. | +| 2026-11-09 | patch | M2: a child dragged within its own auto layout row or column takes its slot by the dragged box's leading edge instead of the pointer, as measured in Figma's web app on 2026-11-09: it passes a sibling when the edge facing the drag reaches the sibling's middle, so the result no longer depends on where the child was grabbed. Several moving layers use their combined box. Dragging in from outside, wrapping layouts and grids are unchanged. Tests in `al_drag_tests.rs` | | 2026-11-02 | patch | M2, #1824: fill container children share the free space by their content area: each one's own insets (padding and an included inside stroke, from the same `insets` the frame uses) come off the free space before the equal split and go back on its share, so a child with more padding or a thicker inside stroke takes a little more and the content areas match ("Figma distributes space amongst fill container children by the children's content area instead of by their size, matching the CSS border-box model", Use auto layout with CSS Flexbox in mind). Min and max still clamp the outer sizes and the frozen-share loop is as it was; children without insets split as before. Test: `nested_tests::fill_children_share_by_content_area` | | 2026-11-02 | patch | M2, #1838: a double-click on an edge of an auto layout frame's bounding box sets Hug contents on that axis, Alt+double-click on an edge of a child's Fill container ("Double-click the vertical or horizontal edge of an auto layout object's bounding box to set it to Hug contents", "Hold ⌥ Option or Alt and double-click ... to set it to Fill container", Guide to auto layout); a vertical edge sizes the width, a horizontal one the height; the Keyboard shortcuts panel lists both gestures. Test: `double_click_tests::a_double_click_on_an_auto_layout_edge_hugs_and_with_alt_fills`. Numbers unchanged. | | 2026-11-02 | patch | M2: a child of an auto layout frame resized to the full space available to it on an axis (the frame's size less its padding: across the flow for any child, along the flow for a lone child) becomes Fill container on that axis, whether by `transform.resize`, the W/H fields or a canvas handle ("Child objects of an auto layout frame will also be set to Fill container if they are manually resized to the full available space of the parent frame", Guide to auto layout). Any other size keeps the axis Fixed as before; beside siblings along the flow, in a hugging or wrapping frame, in a grid and for a layer that ignores the layout nothing changes. Test: `al_behaviour_tests::a_child_resized_to_the_full_available_space_becomes_fill` | From 92145e6f8da614aae4ea48f4fade36086accb7f5 Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Mon, 9 Nov 2026 02:59:53 -0500 Subject: [PATCH 036/101] M8: K focuses the Scale field, so K, 2, Enter scales by two (#2146) The Scale tool now opens its factor field focused with its text selected (once per activation), the origin starts at the centre, and Enter or Escape in the field returns the tool to Move with the selection kept. Measured in Figma web, 2026-11-09. Docs: ui-parity Scale tool row and revision. Co-Authored-By: Claude Sonnet 5.5 Model-Effort: Opus 5.5 drove and briefed; Sonnet 5.5 measured and wrote at medium --- crates/ui-egui/src/field_tests.rs | 63 ++++++++++++++++++++++++ crates/ui-egui/src/panels/right.rs | 2 + crates/ui-egui/src/panels/scale_panel.rs | 33 +++++++++++-- crates/ui-egui/src/widgets.rs | 9 +++- docs/ui-parity.md | 5 +- 5 files changed, 106 insertions(+), 6 deletions(-) diff --git a/crates/ui-egui/src/field_tests.rs b/crates/ui-egui/src/field_tests.rs index e3bdad1dd..a0f5f24d6 100644 --- a/crates/ui-egui/src/field_tests.rs +++ b/crates/ui-egui/src/field_tests.rs @@ -737,6 +737,69 @@ fn scrubbing_the_scale_panel_width_scales_live_in_one_undo_step() { assert_eq!((w, h, undo_steps(&u)), (60.0, 45.0, steps + 1), "40×30 scaled to a width of 60"); } +/// A 100 x 100 rectangle at the origin, selected, in a Ui with the Move tool. +fn scale_setup() -> (Ui, NodeId) { + let mut s = Session::new(); + let r = id(s.execute("shape.rectangle", &json!({"x": 0, "y": 0, "width": 100, "height": 100})).unwrap()); + s.execute("select.set", &json!({"ids": [r]})).unwrap(); + let mut u = Ui::new(s); + u.frame(vec![]); + u.frame(vec![]); + (u, r) +} + +fn scale_field_focused(u: &Ui) -> bool { + u.ctx.memory(|m| m.has_focus(Id::unique("scale_k").with("te"))) +} + +/// Measured in Figma's web app (2026-11-09): K opens the Scale section with its input focused. +#[test] +fn pressing_k_focuses_the_scale_field_with_its_text_selected() { + let (mut u, _) = scale_setup(); + assert!(!scale_field_focused(&u)); + key(&mut u, Key::K, Modifiers::NONE); + u.frame(vec![]); + assert_eq!(u.app.session.tool.tool, figcraft_engine::ToolId::Scale); + assert!(scale_field_focused(&u), "the scale field has the keyboard"); + let state = egui::TextEdit::load_state(&u.ctx, Id::unique("scale_k").with("te")).expect("the editor exists"); + let range = state.cursor.char_range().expect("a selection"); + assert_ne!(range.primary.index, range.secondary.index, "its text is selected"); +} + +/// K, 2, Enter: 100 x 100 becomes 200 x 200 about the centre, the tool is Move, one undo step. +#[test] +fn k_two_enter_scales_the_selection_by_two_about_its_centre() { + let (mut u, r) = scale_setup(); + let steps = undo_steps(&u); + key(&mut u, Key::K, Modifiers::NONE); + u.frame(vec![]); + u.frame(vec![Event::Text("2".to_string())]); + key(&mut u, Key::Enter, Modifiers::NONE); + u.frame(vec![]); + assert_eq!(geom(&u, r), (-50.0, -50.0, 200.0, 200.0)); + assert_eq!(u.app.session.tool.tool, figcraft_engine::ToolId::Move); + assert_eq!(u.app.session.ds().unwrap().selection, vec![r]); + assert_eq!(undo_steps(&u), steps + 1); + u.app.run("edit.undo", json!({})); + assert_eq!(geom(&u, r), (0.0, 0.0, 100.0, 100.0)); +} + +/// Escape in the scale field closes it and changes nothing. +#[test] +fn escape_in_the_scale_field_closes_it_and_changes_nothing() { + let (mut u, r) = scale_setup(); + let steps = undo_steps(&u); + key(&mut u, Key::K, Modifiers::NONE); + u.frame(vec![]); + u.frame(vec![Event::Text("3".to_string())]); + key(&mut u, Key::Escape, Modifiers::NONE); + u.frame(vec![]); + assert_eq!(geom(&u, r), (0.0, 0.0, 100.0, 100.0)); + assert_eq!(u.app.session.tool.tool, figcraft_engine::ToolId::Move); + assert_eq!(u.app.session.ds().unwrap().selection, vec![r]); + assert_eq!(undo_steps(&u), steps); +} + /// The texts painted in the last frame: what they say, whether they end in an ellipsis, and where /// they show (within their clip). fn painted_texts(shapes: &[egui::epaint::ClippedShape]) -> Vec<(String, bool, egui::Rect)> { diff --git a/crates/ui-egui/src/panels/right.rs b/crates/ui-egui/src/panels/right.rs index bba57c778..5c190576f 100644 --- a/crates/ui-egui/src/panels/right.rs +++ b/crates/ui-egui/src/panels/right.rs @@ -281,6 +281,8 @@ fn design(app: &mut FigApp, ui: &mut Ui) { if app.session.tool.tool == figcraft_engine::ToolId::Scale { crate::scale_panel::section(app, ui, &shown, &sel); widgets::separator(ui); + } else { + crate::scale_panel::closed(ui.ctx()); } position(app, ui, &doc, &shown, &sel); } diff --git a/crates/ui-egui/src/panels/scale_panel.rs b/crates/ui-egui/src/panels/scale_panel.rs index fd3a100e8..d86355c25 100644 --- a/crates/ui-egui/src/panels/scale_panel.rs +++ b/crates/ui-egui/src/panels/scale_panel.rs @@ -17,6 +17,27 @@ use crate::widgets::{self, FieldEdit, Lead}; pub fn section(app: &mut FigApp, ui: &mut Ui, doc: &Document, sel: &[NodeId]) { let Some(b) = doc.bounds_of(sel) else { return }; widgets::section_header(ui, tr("Scale"), &[], false); + // The origin starts at the centre, as Figma's grid does: set once per app, so a point the + // user picked later stays. + let anchor_init = Id::unique("scale_anchor_init"); + if !ui.data(|d| d.get_temp::(anchor_init)).unwrap_or(false) { + ui.data_mut(|d| d.insert_temp(anchor_init, true)); + app.run("tool.scaleAnchor", json!({"anchor": "c"})); + } + // The factor field takes the keyboard once, with its text selected, when the tool opens. + let k_id = Id::unique("scale_k"); + let opened = Id::unique("scale_opened"); + if !ui.data(|d| d.get_temp::(opened)).unwrap_or(false) { + ui.data_mut(|d| d.insert_temp(opened, true)); + widgets::request_edit(ui, k_id); + } + // Enter or Escape in the factor field ends the tool (back to Move, the selection kept). + // (Focus as it was last frame: the shortcut layer may already have let go of it this frame.) + let in_k_id = Id::unique("scale_in_k"); + let in_k = ui.data(|d| d.get_temp::(in_k_id)).unwrap_or(false); + let focused_now = ui.memory(|m| m.has_focus(k_id.with("te"))); + ui.data_mut(|d| d.insert_temp(in_k_id, focused_now)); + let (enter, esc) = ui.input(|i| (i.key_pressed(egui::Key::Enter), i.key_pressed(egui::Key::Escape))); let col = widgets::col_width(ui.available_width()); // Anchor: column and row (0 start, 1 middle, 2 end) of the point that stays put. let anchor = app.session.tool.scale_anchor; @@ -41,9 +62,7 @@ pub fn section(app: &mut FigApp, ui: &mut Ui, doc: &Document, sel: &[NodeId]) { widgets::sublabels(ui, tr("Scale"), Some(tr("Anchor"))); crate::right::block(ui, 52.0, 2.0, |ui| { // Relative to the layers as they are: a scrub applies once, when let go. - if let Some(FieldEdit::Set(k) | FieldEdit::Scrub(k, true)) = - widgets::number_field(ui, Id::unique("scale_k"), Lead::None, Some(1.0), "x", col, 0.1) - { + if let Some(FieldEdit::Set(k) | FieldEdit::Scrub(k, true)) = widgets::number_field(ui, k_id, Lead::None, Some(1.0), "x", col, 0.1) { factor = Some(k); } ui.add_space(8.0); @@ -70,6 +89,14 @@ pub fn section(app: &mut FigApp, ui: &mut Ui, doc: &Document, sel: &[NodeId]) { } } } + if in_k && (enter || esc) { + app.run("tool.set", json!({"tool": "move"})); + } +} + +/// Forget that the section opened, so the next time the Scale tool opens it takes the keyboard. +pub fn closed(ctx: &egui::Context) { + ctx.data_mut(|d| d.remove::(Id::unique("scale_opened"))); } /// The factor (clamped to 0.01–100) and pivot for scaling `b` by `k` around `anchor`; None when diff --git a/crates/ui-egui/src/widgets.rs b/crates/ui-egui/src/widgets.rs index eae46fd81..b25ed54b9 100644 --- a/crates/ui-egui/src/widgets.rs +++ b/crates/ui-egui/src/widgets.rs @@ -223,6 +223,12 @@ pub fn number_field(ui: &mut Ui, id: Id, lead: Lead, value: Option, suffix: number_field_mixed(ui, id, lead, value, suffix, width, step)?.settled() } +/// Ask number field `id` to open for typing on its next frame, its text selected (a tool that +/// opens with its field focused, such as Scale). +pub fn request_edit(ui: &Ui, id: Id) { + ui.data_mut(|d| d.insert_temp(id.with("beginedit"), true)); +} + /// Whether the edit of number field `id` began with a Cmd/Ctrl-click. A padding field edited /// that way sets every side (Guide to auto layout, Keyboard shortcut guide). pub fn edit_began_with_command(ui: &Ui, id: Id) -> bool { @@ -400,7 +406,8 @@ fn number_field_impl( } // Typing on a field the keyboard reached (Tab) edits it: the editor takes the typed text. let typed_now = editing.is_none() && on_field && ui.input(|i| i.events.iter().any(|e| matches!(e, egui::Event::Text(_)))); - let started = editing.is_none() && ((field_resp.clicked() && !alt_now) || typed_now); + let requested = ui.data_mut(|d| d.remove_temp::(id.with("beginedit"))).unwrap_or(false); + let started = editing.is_none() && ((field_resp.clicked() && !alt_now) || typed_now || requested); // The text the field would commit to no effect: what it showed when the edit began, or the // value the arrows last stepped it to. let kept_id = id.with("kept"); diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 463be3b47..9eedb74db 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -1,6 +1,6 @@ # UI and interaction parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-04 · **Change:** minor (the left rail's and tab strip's icons are larger, 20 pt (#553); pick select: Tab while the keyboard selection box shows (or the chord again) puts a pink outline on a layer and the keys walk the layer tree from it, as Accessibility at Figma says (#1836); scrubbing a field faster or slower by the pointer's height, with a notice of the speed, as the help center's Scrub fields says (#1837); component rows in the Layers panel at AA contrast in the theme's component tint, with the rows inside a selected component in a tone of its row (#1903); Cmd/Ctrl-click on a padding field sets all four sides with the value typed, a documented auto layout shortcut; a fill per region of a vector: with regions selected in edit mode, the Fill section and the fill commands edit those regions' own fills, as Edit vector layers says (#1875); the Fill section of a text whose characters were coloured differently while editing shows mixed content, characters that all share fills the layer doesn't have show those, and a layer-level fill edit reaches every character (#1856); a number field scrubs when dragged with Alt held, as the help center's scrub section says, not only by its label; reuse visible layer selection roots (M8); ; with a shape or frame tool chosen and nothing selected, the arrows show a placement crosshair in the middle of the view and move it, and Enter places there, as Accessibility at Figma says (#1839); text direction per paragraph: Text ▸ Text direction forces a paragraph left to right or right to left, as Add right-to-left text says (#1830), with `text.direction`, `node.set textDirection`, the Type settings control once a right-to-left script is in the text, inspect, the CSS `direction` and the `.fig` lines' `sourceDirectionality`; the boolean operation menu in the Design panel leads each entry with an original icon drawn in code, a filled preview of the result (#2003); a press on the open gradient's handles or stops on the canvas keeps the colour picker open through the drag, as its own control (#1852); a click with the Bend tool on a sharp point curves it, its handles along the line between its neighbours, as Edit vector layers says (#1875); wrap style: Auto, Balance and Pretty on a text layer decide where its lines break, as Explore text properties says (#1827), with the Type settings control, `text.wrapStyle`, `node.set wrapStyle`, inspect and the CSS `text-wrap`; Backspace or Delete at the start of a list item keeps the item's indentation level, as the lists article says; max lines on auto-width text keep it auto width, hugging that many lines, as the text properties article says; superscript and subscript are synthesised where the font has no glyphs for them, from the standard glyphs shrunk and shifted by the font's OS/2 metrics, and a run mixing available and unavailable glyphs is synthesised whole, as Explore text properties says (#1828); Alt+Enter while editing text opens the link at the caret, as the accessibility page documents; Minimize, by its shortcut or the button by the file name, collapses the navigation bar and both sidebars as the help center says, with the right sidebar back while something is selected (#1835); the interface size keys of the help center's accessibility page: Cmd/Ctrl+Shift+Alt with =, - and 0 step the interface through the Preferences sizes and back to the system's size; Cmd/Ctrl+Alt+arrows rotate the selection a degree at a time, 15 with Shift, as the help center's accessibility page says; they resized before; the Layers panel answers Ctrl+1 as well as Alt+1 on Windows and Linux, the two keys the help center gives it; 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 keyboard's Menu key opens the context menu, as Shift+F10 does; the eyedropper with Cmd/Ctrl+Shift makes a colour style or variable of what it picks; sidebar number and text fields keep their text vertically centered when focused, including typography spacing; 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); 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); Preferences ▸ Scroll wheel zoom: a mouse wheel zooms the canvas about the pointer and Cmd/Ctrl+wheel scrolls (#1390); boolean operations refuse input past their caps, and a boolean group past them draws without its result (#1104); the selection and hover outlines of rounded rectangles and frames follow their corners (#1506); colour picker review fixes for text undo, fitted sidebars, moving controls and gradient variables; Corner smoothing: an original icon and the shared number-field drag gesture, preserving fractional baselines; guides snap to layers when dragged; Crop image: Object ▸ Crop image, the right-click menu and the image fill row enter crop mode (`image.crop`, #1464); the Design panel's sections on one grid — 16 / 8 margins, 88 + 8 + 88 + 8 + 24 columns, 24 pt rows, 4 pt between a row's buttons (#858); the toolbar on one 32 pt grid, without its Resources button (#1210); colour picker LCH and OKLCH models; an XML (Android Vector Drawable) export format; Context menus: the Menu key reaches egui 0.37 but is unbound (row done → partial); the Text on a path tool; board tool keys pinned; community fixes: the text box by dragging, the font picker keys, the pen path on leaving Design, a still canvas in vector edit mode, a scrolling pages list, colour emoji, readable new text in frames, system theme on first run; the Small caps sample in Type settings drawn from capitals; recent files as cards; vector edit mode: hovering, hatching, selecting and dragging filled regions; home screen: Templates tab, first-run templates and Getting started tips; number fields: scrub rates, arrow steps, arithmetic with brackets, relative edits of mixed values; outline mode's hidden layers and object bounds; Hide when publishing; cursors per tool and modifier; panel widths; dark pages for files made in the dark theme; drag threshold and double-clicks into text in groups; rotation origin on Alt+R and placing with Enter: no documented shortcut missing; keyboard shortcut parity suite and bindings; cursor chat and spotlight in live sessions; layers and assets panels behaviour suite and fixes; vector multi-edit and the vector edit tail; canvas navigation, guides and grids behaviour suite and fixes; shapes and vector behaviour suite and fixes; paint and effects behaviour suite and fixes; frames, groups, sections and masks behaviour suite and fixes; layers panel keyboard: F2 rename, Shift+F10 context menu, F8 box selection; selection and transform behaviour suite and fixes; Display P3: gamut warning and soft-proof (true P3 blocked upstream); several windows; boolean hit testing on the result, group drags, frame outlines and slices; outlines for the selection, mask outlines; arc fields, live boolean editing, shape builder on strokes, one-sided widths; fields select their text on focus; Typography spacing icons support scrubbing (#373); CSS colour names in hex fields; a rename selects the whole name, so typing replaces it; Escape or Enter after a pen path stays on the same vector (#760); IME composition kept on through idle frames of a text edit, candidates at the caret (#747); Selection colors for mixed selections and smart-selection spacing (#753); submenus with a hover delay and a safe triangle; the Actions palette's tabs, ranked search, highlight and recents; menu items that ask for a value; editor fixes from the community batches) · **Target:** Figma Design UI3 (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-09 · **Change:** minor (M8, #2146: K focuses the Scale tool's factor field with its text selected, so K, 2, Enter scales the selection by two about the origin grid's centre (the default) in one undo step, after which the tool returns to Move with the selection kept; Escape in the field closes it with the tool back on Move and nothing changed (measured in Figma's web app, 2026-11-09; `pressing_k_focuses_the_scale_field_with_its_text_selected`, `k_two_enter_scales_the_selection_by_two_about_its_centre`, `escape_in_the_scale_field_closes_it_and_changes_nothing`); the left rail's and tab strip's icons are larger, 20 pt (#553); pick select: Tab while the keyboard selection box shows (or the chord again) puts a pink outline on a layer and the keys walk the layer tree from it, as Accessibility at Figma says (#1836); scrubbing a field faster or slower by the pointer's height, with a notice of the speed, as the help center's Scrub fields says (#1837); component rows in the Layers panel at AA contrast in the theme's component tint, with the rows inside a selected component in a tone of its row (#1903); Cmd/Ctrl-click on a padding field sets all four sides with the value typed, a documented auto layout shortcut; a fill per region of a vector: with regions selected in edit mode, the Fill section and the fill commands edit those regions' own fills, as Edit vector layers says (#1875); the Fill section of a text whose characters were coloured differently while editing shows mixed content, characters that all share fills the layer doesn't have show those, and a layer-level fill edit reaches every character (#1856); a number field scrubs when dragged with Alt held, as the help center's scrub section says, not only by its label; reuse visible layer selection roots (M8); ; with a shape or frame tool chosen and nothing selected, the arrows show a placement crosshair in the middle of the view and move it, and Enter places there, as Accessibility at Figma says (#1839); text direction per paragraph: Text ▸ Text direction forces a paragraph left to right or right to left, as Add right-to-left text says (#1830), with `text.direction`, `node.set textDirection`, the Type settings control once a right-to-left script is in the text, inspect, the CSS `direction` and the `.fig` lines' `sourceDirectionality`; the boolean operation menu in the Design panel leads each entry with an original icon drawn in code, a filled preview of the result (#2003); a press on the open gradient's handles or stops on the canvas keeps the colour picker open through the drag, as its own control (#1852); a click with the Bend tool on a sharp point curves it, its handles along the line between its neighbours, as Edit vector layers says (#1875); wrap style: Auto, Balance and Pretty on a text layer decide where its lines break, as Explore text properties says (#1827), with the Type settings control, `text.wrapStyle`, `node.set wrapStyle`, inspect and the CSS `text-wrap`; Backspace or Delete at the start of a list item keeps the item's indentation level, as the lists article says; max lines on auto-width text keep it auto width, hugging that many lines, as the text properties article says; superscript and subscript are synthesised where the font has no glyphs for them, from the standard glyphs shrunk and shifted by the font's OS/2 metrics, and a run mixing available and unavailable glyphs is synthesised whole, as Explore text properties says (#1828); Alt+Enter while editing text opens the link at the caret, as the accessibility page documents; Minimize, by its shortcut or the button by the file name, collapses the navigation bar and both sidebars as the help center says, with the right sidebar back while something is selected (#1835); the interface size keys of the help center's accessibility page: Cmd/Ctrl+Shift+Alt with =, - and 0 step the interface through the Preferences sizes and back to the system's size; Cmd/Ctrl+Alt+arrows rotate the selection a degree at a time, 15 with Shift, as the help center's accessibility page says; they resized before; the Layers panel answers Ctrl+1 as well as Alt+1 on Windows and Linux, the two keys the help center gives it; 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 keyboard's Menu key opens the context menu, as Shift+F10 does; the eyedropper with Cmd/Ctrl+Shift makes a colour style or variable of what it picks; sidebar number and text fields keep their text vertically centered when focused, including typography spacing; 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); 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); Preferences ▸ Scroll wheel zoom: a mouse wheel zooms the canvas about the pointer and Cmd/Ctrl+wheel scrolls (#1390); boolean operations refuse input past their caps, and a boolean group past them draws without its result (#1104); the selection and hover outlines of rounded rectangles and frames follow their corners (#1506); colour picker review fixes for text undo, fitted sidebars, moving controls and gradient variables; Corner smoothing: an original icon and the shared number-field drag gesture, preserving fractional baselines; guides snap to layers when dragged; Crop image: Object ▸ Crop image, the right-click menu and the image fill row enter crop mode (`image.crop`, #1464); the Design panel's sections on one grid — 16 / 8 margins, 88 + 8 + 88 + 8 + 24 columns, 24 pt rows, 4 pt between a row's buttons (#858); the toolbar on one 32 pt grid, without its Resources button (#1210); colour picker LCH and OKLCH models; an XML (Android Vector Drawable) export format; Context menus: the Menu key reaches egui 0.37 but is unbound (row done → partial); the Text on a path tool; board tool keys pinned; community fixes: the text box by dragging, the font picker keys, the pen path on leaving Design, a still canvas in vector edit mode, a scrolling pages list, colour emoji, readable new text in frames, system theme on first run; the Small caps sample in Type settings drawn from capitals; recent files as cards; vector edit mode: hovering, hatching, selecting and dragging filled regions; home screen: Templates tab, first-run templates and Getting started tips; number fields: scrub rates, arrow steps, arithmetic with brackets, relative edits of mixed values; outline mode's hidden layers and object bounds; Hide when publishing; cursors per tool and modifier; panel widths; dark pages for files made in the dark theme; drag threshold and double-clicks into text in groups; rotation origin on Alt+R and placing with Enter: no documented shortcut missing; keyboard shortcut parity suite and bindings; cursor chat and spotlight in live sessions; layers and assets panels behaviour suite and fixes; vector multi-edit and the vector edit tail; canvas navigation, guides and grids behaviour suite and fixes; shapes and vector behaviour suite and fixes; paint and effects behaviour suite and fixes; frames, groups, sections and masks behaviour suite and fixes; layers panel keyboard: F2 rename, Shift+F10 context menu, F8 box selection; selection and transform behaviour suite and fixes; Display P3: gamut warning and soft-proof (true P3 blocked upstream); several windows; boolean hit testing on the result, group drags, frame outlines and slices; outlines for the selection, mask outlines; arc fields, live boolean editing, shape builder on strokes, one-sided widths; fields select their text on focus; Typography spacing icons support scrubbing (#373); CSS colour names in hex fields; a rename selects the whole name, so typing replaces it; Escape or Enter after a pen path stays on the same vector (#760); IME composition kept on through idle frames of a text edit, candidates at the caret (#747); Selection colors for mixed selections and smart-selection spacing (#753); submenus with a hover delay and a safe triangle; the Actions palette's tabs, ranked search, highlight and recents; menu items that ask for a value; editor fixes from the community batches) · **Target:** Figma Design UI3 (desktop app 126.10.7) Fine canvas control is what Figma users feel first: handles, snapping, nudging, modifier keys, drag behaviour, numeric precision. This checklist covers the tools, gestures and panels. Status: @@ -67,7 +67,7 @@ interaction feel not yet compared. | Enter with a shape or frame tool chosen | done | places what a click makes (100×100, lines 100 long, sections 400×300) in the middle of the view, selected (`tool.place`); from the toolbar, Enter on the chosen tool. With nothing selected, the arrows first show a crosshair in the middle of the view and then move it by the nudge amounts (`tool.crosshair`; Shift the large one), and Enter places there; Escape or a tool change takes it away ("Use the arrow keys to activate the crosshair cursor. It will appear in the middle of the viewport indicating where the new object will be placed", Accessibility at Figma; #1839) | | Alt-drag duplicate | done | the copy snaps to the layer it came from too (edges, centres, equal spacing); Duplicate (Cmd+D) then repeats the copy's offset, also after a Duplicate whose copy was moved, as long as the copies stay selected (the documentation doesn't say; pinned from community answers) | | Drag threshold; double-click into groups and text | done | a press moves or resizes only once the pointer has travelled 3 px on screen, so a click or double-click made with an unsteady hand drags nothing; a double-click goes one level into a group and the next one edits the text under it, wherever on the text it lands, with all of it selected (a double-click in the text being edited selects the word) (`double_click_tests`); Enter on a selected text does the same (all of it selected, typing replaces it) and Escape leaves editing with the layer still selected (`text_enter_tests`) | -| Scale tool (K): handles about an anchor, live factor, panel | done | | +| Scale tool (K): handles about an anchor, live factor, panel | done | Pressing K opens the Scale section with its factor field focused and its text selected; typing 2 (or 2x, 1.5) then Enter scales the selection by it about the origin grid's centre (the default), as one undo step, then closes the section and returns to Move with the selection kept; Escape in the field closes it, back to Move, nothing changed. Measured in Figma's web app, 2026-11-09. Tests: `pressing_k_focuses_the_scale_field_with_its_text_selected`, `k_two_enter_scales_the_selection_by_two_about_its_centre`, `escape_in_the_scale_field_closes_it_and_changes_nothing`. | | Nudge 1 / Shift 10 (preference), Cmd+arrows resize | done | arrows reorder auto layout children | | Smart guides: edges, centres, equal spacing (between two layers or continuing a row's gap, labelled), spacing labels, parent, layout grid, ruler guides | done | red, `snap.rs`; a guide dragged out of a ruler or moved snaps to layer edges and centres too (Snap to Objects; Cmd/Ctrl suspends), on its own axis only; page guides see the page's top-level layers, frame guides the frame's box, layout grids and every layer in it, along a rotated frame's own axes; thresholds not yet compared with Figma's (`guide_snap_tests`) | | Ctrl to suspend snapping while dragging (macOS) | done | Control on macOS (Cmd keeps working), Ctrl elsewhere; moving, resizing and drawing | @@ -271,4 +271,5 @@ in the table. `crates/ui-egui/src/shortcut_keys_tests.rs` drives the keys a look | 2026-10-11 | minor | Canvas fixes: boolean groups clicked where their result is, a layer dragged inside a group stays in it, View ▸ Frame outlines and View ▸ Slices draw | | 2026-10-11 | minor | Outline mode done: outlines for the selection (the selected layers draw as outlines, the rest normally) and mask outlines | | 2026-10-11 | minor | Design panel arc fields, live boolean editing (operands on the canvas, live results, per-operand operations), shape builder on strokes and open paths, one-sided widths (Alt-drag a width handle) | +| 2026-11-09 | patch | M8, #2146: K focuses the Scale tool's factor field with its text selected, so K, 2, Enter scales the selection by two about the origin grid's centre (the default) in one undo step, after which the tool returns to Move with the selection kept; Escape in the field closes it with the tool back on Move and nothing changed (measured in Figma's web app, 2026-11-09; `pressing_k_focuses_the_scale_field_with_its_text_selected`, `k_two_enter_scales_the_selection_by_two_about_its_centre`, `escape_in_the_scale_field_closes_it_and_changes_nothing`) | | 2026-10-10 | major | Created from the ROADMAP's look-and-feel and interaction items, the keymap and the canvas code | From 6856437479dfa29d8e224359eda3db13b3b91320 Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Mon, 9 Nov 2026 03:03:26 -0500 Subject: [PATCH 037/101] M8: the Scale panel keeps FigCraft's origin; the centre default is a follow-up (#2146) The panel set the origin to the centre once per app. The origin is the Scale tool's drag pivot too (scale_factor), so that also changed handle drags, unmeasured against Figma, while the engine and its tests keep top-left. This PR keeps to the focus and the Enter and Escape endings the issue asks for. Co-Authored-By: Claude Opus 5.5 Model-Effort: Opus 5.5 drove and wrote --- crates/ui-egui/src/field_tests.rs | 5 +++-- crates/ui-egui/src/panels/scale_panel.rs | 7 ------- docs/ui-parity.md | 6 +++--- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/crates/ui-egui/src/field_tests.rs b/crates/ui-egui/src/field_tests.rs index a0f5f24d6..dfa097db0 100644 --- a/crates/ui-egui/src/field_tests.rs +++ b/crates/ui-egui/src/field_tests.rs @@ -768,7 +768,7 @@ fn pressing_k_focuses_the_scale_field_with_its_text_selected() { /// K, 2, Enter: 100 x 100 becomes 200 x 200 about the centre, the tool is Move, one undo step. #[test] -fn k_two_enter_scales_the_selection_by_two_about_its_centre() { +fn k_two_enter_scales_the_selection_by_two() { let (mut u, r) = scale_setup(); let steps = undo_steps(&u); key(&mut u, Key::K, Modifiers::NONE); @@ -776,7 +776,8 @@ fn k_two_enter_scales_the_selection_by_two_about_its_centre() { u.frame(vec![Event::Text("2".to_string())]); key(&mut u, Key::Enter, Modifiers::NONE); u.frame(vec![]); - assert_eq!(geom(&u, r), (-50.0, -50.0, 200.0, 200.0)); + // About the panel's origin, FigCraft's top-left default (Figma's grid starts at the centre). + assert_eq!(geom(&u, r), (0.0, 0.0, 200.0, 200.0)); assert_eq!(u.app.session.tool.tool, figcraft_engine::ToolId::Move); assert_eq!(u.app.session.ds().unwrap().selection, vec![r]); assert_eq!(undo_steps(&u), steps + 1); diff --git a/crates/ui-egui/src/panels/scale_panel.rs b/crates/ui-egui/src/panels/scale_panel.rs index d86355c25..7ba0618c8 100644 --- a/crates/ui-egui/src/panels/scale_panel.rs +++ b/crates/ui-egui/src/panels/scale_panel.rs @@ -17,13 +17,6 @@ use crate::widgets::{self, FieldEdit, Lead}; pub fn section(app: &mut FigApp, ui: &mut Ui, doc: &Document, sel: &[NodeId]) { let Some(b) = doc.bounds_of(sel) else { return }; widgets::section_header(ui, tr("Scale"), &[], false); - // The origin starts at the centre, as Figma's grid does: set once per app, so a point the - // user picked later stays. - let anchor_init = Id::unique("scale_anchor_init"); - if !ui.data(|d| d.get_temp::(anchor_init)).unwrap_or(false) { - ui.data_mut(|d| d.insert_temp(anchor_init, true)); - app.run("tool.scaleAnchor", json!({"anchor": "c"})); - } // The factor field takes the keyboard once, with its text selected, when the tool opens. let k_id = Id::unique("scale_k"); let opened = Id::unique("scale_opened"); diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 9eedb74db..5a6614d2e 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -1,6 +1,6 @@ # UI and interaction parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-09 · **Change:** minor (M8, #2146: K focuses the Scale tool's factor field with its text selected, so K, 2, Enter scales the selection by two about the origin grid's centre (the default) in one undo step, after which the tool returns to Move with the selection kept; Escape in the field closes it with the tool back on Move and nothing changed (measured in Figma's web app, 2026-11-09; `pressing_k_focuses_the_scale_field_with_its_text_selected`, `k_two_enter_scales_the_selection_by_two_about_its_centre`, `escape_in_the_scale_field_closes_it_and_changes_nothing`); the left rail's and tab strip's icons are larger, 20 pt (#553); pick select: Tab while the keyboard selection box shows (or the chord again) puts a pink outline on a layer and the keys walk the layer tree from it, as Accessibility at Figma says (#1836); scrubbing a field faster or slower by the pointer's height, with a notice of the speed, as the help center's Scrub fields says (#1837); component rows in the Layers panel at AA contrast in the theme's component tint, with the rows inside a selected component in a tone of its row (#1903); Cmd/Ctrl-click on a padding field sets all four sides with the value typed, a documented auto layout shortcut; a fill per region of a vector: with regions selected in edit mode, the Fill section and the fill commands edit those regions' own fills, as Edit vector layers says (#1875); the Fill section of a text whose characters were coloured differently while editing shows mixed content, characters that all share fills the layer doesn't have show those, and a layer-level fill edit reaches every character (#1856); a number field scrubs when dragged with Alt held, as the help center's scrub section says, not only by its label; reuse visible layer selection roots (M8); ; with a shape or frame tool chosen and nothing selected, the arrows show a placement crosshair in the middle of the view and move it, and Enter places there, as Accessibility at Figma says (#1839); text direction per paragraph: Text ▸ Text direction forces a paragraph left to right or right to left, as Add right-to-left text says (#1830), with `text.direction`, `node.set textDirection`, the Type settings control once a right-to-left script is in the text, inspect, the CSS `direction` and the `.fig` lines' `sourceDirectionality`; the boolean operation menu in the Design panel leads each entry with an original icon drawn in code, a filled preview of the result (#2003); a press on the open gradient's handles or stops on the canvas keeps the colour picker open through the drag, as its own control (#1852); a click with the Bend tool on a sharp point curves it, its handles along the line between its neighbours, as Edit vector layers says (#1875); wrap style: Auto, Balance and Pretty on a text layer decide where its lines break, as Explore text properties says (#1827), with the Type settings control, `text.wrapStyle`, `node.set wrapStyle`, inspect and the CSS `text-wrap`; Backspace or Delete at the start of a list item keeps the item's indentation level, as the lists article says; max lines on auto-width text keep it auto width, hugging that many lines, as the text properties article says; superscript and subscript are synthesised where the font has no glyphs for them, from the standard glyphs shrunk and shifted by the font's OS/2 metrics, and a run mixing available and unavailable glyphs is synthesised whole, as Explore text properties says (#1828); Alt+Enter while editing text opens the link at the caret, as the accessibility page documents; Minimize, by its shortcut or the button by the file name, collapses the navigation bar and both sidebars as the help center says, with the right sidebar back while something is selected (#1835); the interface size keys of the help center's accessibility page: Cmd/Ctrl+Shift+Alt with =, - and 0 step the interface through the Preferences sizes and back to the system's size; Cmd/Ctrl+Alt+arrows rotate the selection a degree at a time, 15 with Shift, as the help center's accessibility page says; they resized before; the Layers panel answers Ctrl+1 as well as Alt+1 on Windows and Linux, the two keys the help center gives it; 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 keyboard's Menu key opens the context menu, as Shift+F10 does; the eyedropper with Cmd/Ctrl+Shift makes a colour style or variable of what it picks; sidebar number and text fields keep their text vertically centered when focused, including typography spacing; 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); 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); Preferences ▸ Scroll wheel zoom: a mouse wheel zooms the canvas about the pointer and Cmd/Ctrl+wheel scrolls (#1390); boolean operations refuse input past their caps, and a boolean group past them draws without its result (#1104); the selection and hover outlines of rounded rectangles and frames follow their corners (#1506); colour picker review fixes for text undo, fitted sidebars, moving controls and gradient variables; Corner smoothing: an original icon and the shared number-field drag gesture, preserving fractional baselines; guides snap to layers when dragged; Crop image: Object ▸ Crop image, the right-click menu and the image fill row enter crop mode (`image.crop`, #1464); the Design panel's sections on one grid — 16 / 8 margins, 88 + 8 + 88 + 8 + 24 columns, 24 pt rows, 4 pt between a row's buttons (#858); the toolbar on one 32 pt grid, without its Resources button (#1210); colour picker LCH and OKLCH models; an XML (Android Vector Drawable) export format; Context menus: the Menu key reaches egui 0.37 but is unbound (row done → partial); the Text on a path tool; board tool keys pinned; community fixes: the text box by dragging, the font picker keys, the pen path on leaving Design, a still canvas in vector edit mode, a scrolling pages list, colour emoji, readable new text in frames, system theme on first run; the Small caps sample in Type settings drawn from capitals; recent files as cards; vector edit mode: hovering, hatching, selecting and dragging filled regions; home screen: Templates tab, first-run templates and Getting started tips; number fields: scrub rates, arrow steps, arithmetic with brackets, relative edits of mixed values; outline mode's hidden layers and object bounds; Hide when publishing; cursors per tool and modifier; panel widths; dark pages for files made in the dark theme; drag threshold and double-clicks into text in groups; rotation origin on Alt+R and placing with Enter: no documented shortcut missing; keyboard shortcut parity suite and bindings; cursor chat and spotlight in live sessions; layers and assets panels behaviour suite and fixes; vector multi-edit and the vector edit tail; canvas navigation, guides and grids behaviour suite and fixes; shapes and vector behaviour suite and fixes; paint and effects behaviour suite and fixes; frames, groups, sections and masks behaviour suite and fixes; layers panel keyboard: F2 rename, Shift+F10 context menu, F8 box selection; selection and transform behaviour suite and fixes; Display P3: gamut warning and soft-proof (true P3 blocked upstream); several windows; boolean hit testing on the result, group drags, frame outlines and slices; outlines for the selection, mask outlines; arc fields, live boolean editing, shape builder on strokes, one-sided widths; fields select their text on focus; Typography spacing icons support scrubbing (#373); CSS colour names in hex fields; a rename selects the whole name, so typing replaces it; Escape or Enter after a pen path stays on the same vector (#760); IME composition kept on through idle frames of a text edit, candidates at the caret (#747); Selection colors for mixed selections and smart-selection spacing (#753); submenus with a hover delay and a safe triangle; the Actions palette's tabs, ranked search, highlight and recents; menu items that ask for a value; editor fixes from the community batches) · **Target:** Figma Design UI3 (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-09 · **Change:** minor (M8, #2146: K focuses the Scale tool's factor field with its text selected, so K, 2, Enter scales the selection by two about the panel's origin (FigCraft's starts at the top left; Figma's grid starts at the centre, left for a follow-up because the origin also sets where a handle drag pivots, which is not measured) in one undo step, after which the tool returns to Move with the selection kept; Escape in the field closes it with the tool back on Move and nothing changed (measured in Figma's web app, 2026-11-09; `pressing_k_focuses_the_scale_field_with_its_text_selected`, `k_two_enter_scales_the_selection_by_two`, `escape_in_the_scale_field_closes_it_and_changes_nothing`); the left rail's and tab strip's icons are larger, 20 pt (#553); pick select: Tab while the keyboard selection box shows (or the chord again) puts a pink outline on a layer and the keys walk the layer tree from it, as Accessibility at Figma says (#1836); scrubbing a field faster or slower by the pointer's height, with a notice of the speed, as the help center's Scrub fields says (#1837); component rows in the Layers panel at AA contrast in the theme's component tint, with the rows inside a selected component in a tone of its row (#1903); Cmd/Ctrl-click on a padding field sets all four sides with the value typed, a documented auto layout shortcut; a fill per region of a vector: with regions selected in edit mode, the Fill section and the fill commands edit those regions' own fills, as Edit vector layers says (#1875); the Fill section of a text whose characters were coloured differently while editing shows mixed content, characters that all share fills the layer doesn't have show those, and a layer-level fill edit reaches every character (#1856); a number field scrubs when dragged with Alt held, as the help center's scrub section says, not only by its label; reuse visible layer selection roots (M8); ; with a shape or frame tool chosen and nothing selected, the arrows show a placement crosshair in the middle of the view and move it, and Enter places there, as Accessibility at Figma says (#1839); text direction per paragraph: Text ▸ Text direction forces a paragraph left to right or right to left, as Add right-to-left text says (#1830), with `text.direction`, `node.set textDirection`, the Type settings control once a right-to-left script is in the text, inspect, the CSS `direction` and the `.fig` lines' `sourceDirectionality`; the boolean operation menu in the Design panel leads each entry with an original icon drawn in code, a filled preview of the result (#2003); a press on the open gradient's handles or stops on the canvas keeps the colour picker open through the drag, as its own control (#1852); a click with the Bend tool on a sharp point curves it, its handles along the line between its neighbours, as Edit vector layers says (#1875); wrap style: Auto, Balance and Pretty on a text layer decide where its lines break, as Explore text properties says (#1827), with the Type settings control, `text.wrapStyle`, `node.set wrapStyle`, inspect and the CSS `text-wrap`; Backspace or Delete at the start of a list item keeps the item's indentation level, as the lists article says; max lines on auto-width text keep it auto width, hugging that many lines, as the text properties article says; superscript and subscript are synthesised where the font has no glyphs for them, from the standard glyphs shrunk and shifted by the font's OS/2 metrics, and a run mixing available and unavailable glyphs is synthesised whole, as Explore text properties says (#1828); Alt+Enter while editing text opens the link at the caret, as the accessibility page documents; Minimize, by its shortcut or the button by the file name, collapses the navigation bar and both sidebars as the help center says, with the right sidebar back while something is selected (#1835); the interface size keys of the help center's accessibility page: Cmd/Ctrl+Shift+Alt with =, - and 0 step the interface through the Preferences sizes and back to the system's size; Cmd/Ctrl+Alt+arrows rotate the selection a degree at a time, 15 with Shift, as the help center's accessibility page says; they resized before; the Layers panel answers Ctrl+1 as well as Alt+1 on Windows and Linux, the two keys the help center gives it; 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 keyboard's Menu key opens the context menu, as Shift+F10 does; the eyedropper with Cmd/Ctrl+Shift makes a colour style or variable of what it picks; sidebar number and text fields keep their text vertically centered when focused, including typography spacing; 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); 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); Preferences ▸ Scroll wheel zoom: a mouse wheel zooms the canvas about the pointer and Cmd/Ctrl+wheel scrolls (#1390); boolean operations refuse input past their caps, and a boolean group past them draws without its result (#1104); the selection and hover outlines of rounded rectangles and frames follow their corners (#1506); colour picker review fixes for text undo, fitted sidebars, moving controls and gradient variables; Corner smoothing: an original icon and the shared number-field drag gesture, preserving fractional baselines; guides snap to layers when dragged; Crop image: Object ▸ Crop image, the right-click menu and the image fill row enter crop mode (`image.crop`, #1464); the Design panel's sections on one grid — 16 / 8 margins, 88 + 8 + 88 + 8 + 24 columns, 24 pt rows, 4 pt between a row's buttons (#858); the toolbar on one 32 pt grid, without its Resources button (#1210); colour picker LCH and OKLCH models; an XML (Android Vector Drawable) export format; Context menus: the Menu key reaches egui 0.37 but is unbound (row done → partial); the Text on a path tool; board tool keys pinned; community fixes: the text box by dragging, the font picker keys, the pen path on leaving Design, a still canvas in vector edit mode, a scrolling pages list, colour emoji, readable new text in frames, system theme on first run; the Small caps sample in Type settings drawn from capitals; recent files as cards; vector edit mode: hovering, hatching, selecting and dragging filled regions; home screen: Templates tab, first-run templates and Getting started tips; number fields: scrub rates, arrow steps, arithmetic with brackets, relative edits of mixed values; outline mode's hidden layers and object bounds; Hide when publishing; cursors per tool and modifier; panel widths; dark pages for files made in the dark theme; drag threshold and double-clicks into text in groups; rotation origin on Alt+R and placing with Enter: no documented shortcut missing; keyboard shortcut parity suite and bindings; cursor chat and spotlight in live sessions; layers and assets panels behaviour suite and fixes; vector multi-edit and the vector edit tail; canvas navigation, guides and grids behaviour suite and fixes; shapes and vector behaviour suite and fixes; paint and effects behaviour suite and fixes; frames, groups, sections and masks behaviour suite and fixes; layers panel keyboard: F2 rename, Shift+F10 context menu, F8 box selection; selection and transform behaviour suite and fixes; Display P3: gamut warning and soft-proof (true P3 blocked upstream); several windows; boolean hit testing on the result, group drags, frame outlines and slices; outlines for the selection, mask outlines; arc fields, live boolean editing, shape builder on strokes, one-sided widths; fields select their text on focus; Typography spacing icons support scrubbing (#373); CSS colour names in hex fields; a rename selects the whole name, so typing replaces it; Escape or Enter after a pen path stays on the same vector (#760); IME composition kept on through idle frames of a text edit, candidates at the caret (#747); Selection colors for mixed selections and smart-selection spacing (#753); submenus with a hover delay and a safe triangle; the Actions palette's tabs, ranked search, highlight and recents; menu items that ask for a value; editor fixes from the community batches) · **Target:** Figma Design UI3 (desktop app 126.10.7) Fine canvas control is what Figma users feel first: handles, snapping, nudging, modifier keys, drag behaviour, numeric precision. This checklist covers the tools, gestures and panels. Status: @@ -67,7 +67,7 @@ interaction feel not yet compared. | Enter with a shape or frame tool chosen | done | places what a click makes (100×100, lines 100 long, sections 400×300) in the middle of the view, selected (`tool.place`); from the toolbar, Enter on the chosen tool. With nothing selected, the arrows first show a crosshair in the middle of the view and then move it by the nudge amounts (`tool.crosshair`; Shift the large one), and Enter places there; Escape or a tool change takes it away ("Use the arrow keys to activate the crosshair cursor. It will appear in the middle of the viewport indicating where the new object will be placed", Accessibility at Figma; #1839) | | Alt-drag duplicate | done | the copy snaps to the layer it came from too (edges, centres, equal spacing); Duplicate (Cmd+D) then repeats the copy's offset, also after a Duplicate whose copy was moved, as long as the copies stay selected (the documentation doesn't say; pinned from community answers) | | Drag threshold; double-click into groups and text | done | a press moves or resizes only once the pointer has travelled 3 px on screen, so a click or double-click made with an unsteady hand drags nothing; a double-click goes one level into a group and the next one edits the text under it, wherever on the text it lands, with all of it selected (a double-click in the text being edited selects the word) (`double_click_tests`); Enter on a selected text does the same (all of it selected, typing replaces it) and Escape leaves editing with the layer still selected (`text_enter_tests`) | -| Scale tool (K): handles about an anchor, live factor, panel | done | Pressing K opens the Scale section with its factor field focused and its text selected; typing 2 (or 2x, 1.5) then Enter scales the selection by it about the origin grid's centre (the default), as one undo step, then closes the section and returns to Move with the selection kept; Escape in the field closes it, back to Move, nothing changed. Measured in Figma's web app, 2026-11-09. Tests: `pressing_k_focuses_the_scale_field_with_its_text_selected`, `k_two_enter_scales_the_selection_by_two_about_its_centre`, `escape_in_the_scale_field_closes_it_and_changes_nothing`. | +| Scale tool (K): handles about an anchor, live factor, panel | done | Pressing K opens the Scale section with its factor field focused and its text selected; typing 2 (or 2x, 1.5) then Enter scales the selection by it about the panel's origin (FigCraft's starts at the top left; Figma's grid starts at the centre, left for a follow-up because the origin also sets where a handle drag pivots, which is not measured), as one undo step, then closes the section and returns to Move with the selection kept; Escape in the field closes it, back to Move, nothing changed. Measured in Figma's web app, 2026-11-09. Tests: `pressing_k_focuses_the_scale_field_with_its_text_selected`, `k_two_enter_scales_the_selection_by_two`, `escape_in_the_scale_field_closes_it_and_changes_nothing`. | | Nudge 1 / Shift 10 (preference), Cmd+arrows resize | done | arrows reorder auto layout children | | Smart guides: edges, centres, equal spacing (between two layers or continuing a row's gap, labelled), spacing labels, parent, layout grid, ruler guides | done | red, `snap.rs`; a guide dragged out of a ruler or moved snaps to layer edges and centres too (Snap to Objects; Cmd/Ctrl suspends), on its own axis only; page guides see the page's top-level layers, frame guides the frame's box, layout grids and every layer in it, along a rotated frame's own axes; thresholds not yet compared with Figma's (`guide_snap_tests`) | | Ctrl to suspend snapping while dragging (macOS) | done | Control on macOS (Cmd keeps working), Ctrl elsewhere; moving, resizing and drawing | @@ -271,5 +271,5 @@ in the table. `crates/ui-egui/src/shortcut_keys_tests.rs` drives the keys a look | 2026-10-11 | minor | Canvas fixes: boolean groups clicked where their result is, a layer dragged inside a group stays in it, View ▸ Frame outlines and View ▸ Slices draw | | 2026-10-11 | minor | Outline mode done: outlines for the selection (the selected layers draw as outlines, the rest normally) and mask outlines | | 2026-10-11 | minor | Design panel arc fields, live boolean editing (operands on the canvas, live results, per-operand operations), shape builder on strokes and open paths, one-sided widths (Alt-drag a width handle) | -| 2026-11-09 | patch | M8, #2146: K focuses the Scale tool's factor field with its text selected, so K, 2, Enter scales the selection by two about the origin grid's centre (the default) in one undo step, after which the tool returns to Move with the selection kept; Escape in the field closes it with the tool back on Move and nothing changed (measured in Figma's web app, 2026-11-09; `pressing_k_focuses_the_scale_field_with_its_text_selected`, `k_two_enter_scales_the_selection_by_two_about_its_centre`, `escape_in_the_scale_field_closes_it_and_changes_nothing`) | +| 2026-11-09 | patch | M8, #2146: K focuses the Scale tool's factor field with its text selected, so K, 2, Enter scales the selection by two about the panel's origin (FigCraft's starts at the top left; Figma's grid starts at the centre, left for a follow-up because the origin also sets where a handle drag pivots, which is not measured) in one undo step, after which the tool returns to Move with the selection kept; Escape in the field closes it with the tool back on Move and nothing changed (measured in Figma's web app, 2026-11-09; `pressing_k_focuses_the_scale_field_with_its_text_selected`, `k_two_enter_scales_the_selection_by_two`, `escape_in_the_scale_field_closes_it_and_changes_nothing`) | | 2026-10-10 | major | Created from the ROADMAP's look-and-feel and interaction items, the keymap and the canvas code | From 197a390a8406150a3c9beae0ad4c7855f370985e Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Mon, 9 Nov 2026 03:40:27 -0500 Subject: [PATCH 038/101] M8: the Scale field refocuses after another tab, and Enter elsewhere keeps the tool (#2148 review) The focus request was reset only while the Design panel drew, so choosing the tool again on the Prototype tab left the field without the keyboard; it now follows the frame the section last showed in. Whether the factor field had the keyboard was read before the widgets ran, so an Enter right after a click into W or H could end the tool; it is read after them now. A number field's leftover edit from when it was last shown no longer swallows the focus request. Co-Authored-By: Claude Opus 5.5 Model-Effort: Opus 5.5 drove and wrote --- crates/ui-egui/src/field_tests.rs | 39 +++++++++++++++++++++++- crates/ui-egui/src/panels/right.rs | 2 -- crates/ui-egui/src/panels/scale_panel.rs | 27 ++++++++-------- crates/ui-egui/src/widgets.rs | 8 +++-- 4 files changed, 58 insertions(+), 18 deletions(-) diff --git a/crates/ui-egui/src/field_tests.rs b/crates/ui-egui/src/field_tests.rs index dfa097db0..06b78823c 100644 --- a/crates/ui-egui/src/field_tests.rs +++ b/crates/ui-egui/src/field_tests.rs @@ -766,7 +766,44 @@ fn pressing_k_focuses_the_scale_field_with_its_text_selected() { assert_ne!(range.primary.index, range.secondary.index, "its text is selected"); } -/// K, 2, Enter: 100 x 100 becomes 200 x 200 about the centre, the tool is Move, one undo step. +/// The Scale tool chosen again while the Design tab was away (Prototype tab, Move, then K): the +/// field takes the keyboard again when the Design tab comes back. +#[test] +fn the_scale_field_takes_the_keyboard_again_after_another_tab() { + let (mut u, _) = scale_setup(); + key(&mut u, Key::K, Modifiers::NONE); + u.frame(vec![]); + assert!(scale_field_focused(&u)); + u.app.ui.right_tab = crate::state::RightTab::Prototype; + u.frame(vec![]); + u.app.run("tool.set", json!({"tool": "move"})); + u.frame(vec![]); + u.app.run("tool.set", json!({"tool": "scale"})); + u.frame(vec![]); + u.app.ui.right_tab = crate::state::RightTab::Design; + u.frame(vec![]); + u.frame(vec![]); + assert!(scale_field_focused(&u), "the field has the keyboard again"); +} + +/// Tab moves the keyboard from the factor field to the next one; an Enter there leaves the +/// Scale tool on. +#[test] +fn enter_in_another_field_after_tab_keeps_the_scale_tool() { + let (mut u, _) = scale_setup(); + key(&mut u, Key::K, Modifiers::NONE); + u.frame(vec![]); + assert!(scale_field_focused(&u)); + // Tab, then Enter on the very next frame (as a quick Tab, Enter or a click and Enter would). + let ev = |key, pressed| Event::Key { key, physical_key: None, pressed, repeat: false, modifiers: Modifiers::NONE }; + u.frame(vec![ev(Key::Tab, true), ev(Key::Tab, false)]); + assert!(!scale_field_focused(&u), "Tab moved the keyboard on"); + u.frame(vec![ev(Key::Enter, true), ev(Key::Enter, false)]); + u.frame(vec![]); + assert_eq!(u.app.session.tool.tool, figcraft_engine::ToolId::Scale); +} + +/// K, 2, Enter: 100 x 100 becomes 200 x 200 about the panel's origin, the tool is Move, one undo step. #[test] fn k_two_enter_scales_the_selection_by_two() { let (mut u, r) = scale_setup(); diff --git a/crates/ui-egui/src/panels/right.rs b/crates/ui-egui/src/panels/right.rs index 5c190576f..bba57c778 100644 --- a/crates/ui-egui/src/panels/right.rs +++ b/crates/ui-egui/src/panels/right.rs @@ -281,8 +281,6 @@ fn design(app: &mut FigApp, ui: &mut Ui) { if app.session.tool.tool == figcraft_engine::ToolId::Scale { crate::scale_panel::section(app, ui, &shown, &sel); widgets::separator(ui); - } else { - crate::scale_panel::closed(ui.ctx()); } position(app, ui, &doc, &shown, &sel); } diff --git a/crates/ui-egui/src/panels/scale_panel.rs b/crates/ui-egui/src/panels/scale_panel.rs index 7ba0618c8..9b6dd98a1 100644 --- a/crates/ui-egui/src/panels/scale_panel.rs +++ b/crates/ui-egui/src/panels/scale_panel.rs @@ -17,19 +17,23 @@ use crate::widgets::{self, FieldEdit, Lead}; pub fn section(app: &mut FigApp, ui: &mut Ui, doc: &Document, sel: &[NodeId]) { let Some(b) = doc.bounds_of(sel) else { return }; widgets::section_header(ui, tr("Scale"), &[], false); - // The factor field takes the keyboard once, with its text selected, when the tool opens. + // The factor field takes the keyboard, with its text selected, whenever the section shows + // after a frame without it: the tool was chosen, or the panel came back from another tab or a + // hidden UI. let k_id = Id::unique("scale_k"); - let opened = Id::unique("scale_opened"); - if !ui.data(|d| d.get_temp::(opened)).unwrap_or(false) { - ui.data_mut(|d| d.insert_temp(opened, true)); + let shown_id = Id::unique("scale_shown_frame"); + let frame = ui.ctx().cumulative_frame_nr(); + let last = ui.data(|d| d.get_temp::(shown_id)); + ui.data_mut(|d| d.insert_temp(shown_id, frame)); + if last.is_none_or(|l| l.saturating_add(1) < frame) { widgets::request_edit(ui, k_id); } - // Enter or Escape in the factor field ends the tool (back to Move, the selection kept). - // (Focus as it was last frame: the shortcut layer may already have let go of it this frame.) + // Enter or Escape in the factor field ends the tool (back to Move, the selection kept). Whether + // the field had the keyboard is read as it was when the last frame's widgets were done: the + // shortcut layer may let go of it before this frame's panel runs, and a click or Tab that moved + // it to another field during the last frame counts. let in_k_id = Id::unique("scale_in_k"); let in_k = ui.data(|d| d.get_temp::(in_k_id)).unwrap_or(false); - let focused_now = ui.memory(|m| m.has_focus(k_id.with("te"))); - ui.data_mut(|d| d.insert_temp(in_k_id, focused_now)); let (enter, esc) = ui.input(|i| (i.key_pressed(egui::Key::Enter), i.key_pressed(egui::Key::Escape))); let col = widgets::col_width(ui.available_width()); // Anchor: column and row (0 start, 1 middle, 2 end) of the point that stays put. @@ -82,16 +86,13 @@ pub fn section(app: &mut FigApp, ui: &mut Ui, doc: &Document, sel: &[NodeId]) { } } } + let focused_now = ui.memory(|m| m.has_focus(k_id.with("te"))); + ui.data_mut(|d| d.insert_temp(in_k_id, focused_now)); if in_k && (enter || esc) { app.run("tool.set", json!({"tool": "move"})); } } -/// Forget that the section opened, so the next time the Scale tool opens it takes the keyboard. -pub fn closed(ctx: &egui::Context) { - ctx.data_mut(|d| d.remove::(Id::unique("scale_opened"))); -} - /// The factor (clamped to 0.01–100) and pivot for scaling `b` by `k` around `anchor`; None when /// nothing would change or `k` isn't a usable number. fn scale_about(b: figcraft_geom::Rect, anchor: (u8, u8), k: f64) -> Option<(f64, f64, f64)> { diff --git a/crates/ui-egui/src/widgets.rs b/crates/ui-egui/src/widgets.rs index b25ed54b9..252ae65af 100644 --- a/crates/ui-egui/src/widgets.rs +++ b/crates/ui-egui/src/widgets.rs @@ -224,9 +224,13 @@ pub fn number_field(ui: &mut Ui, id: Id, lead: Lead, value: Option, suffix: } /// Ask number field `id` to open for typing on its next frame, its text selected (a tool that -/// opens with its field focused, such as Scale). +/// opens with its field focused, such as Scale). An edit left over from when the field was last +/// shown (it went away with the keyboard on it) is dropped first, or the request would be ignored. pub fn request_edit(ui: &Ui, id: Id) { - ui.data_mut(|d| d.insert_temp(id.with("beginedit"), true)); + ui.data_mut(|d| { + d.remove::(id.with("editing")); + d.insert_temp(id.with("beginedit"), true); + }); } /// Whether the edit of number field `id` began with a Cmd/Ctrl-click. A padding field edited From 984270fbecdaace2353d8247f04b94626f10390f Mon Sep 17 00:00:00 2001 From: ljkx <177671075+ljkx@users.noreply.github.com> Date: Mon, 9 Nov 2026 12:38:29 +0100 Subject: [PATCH 039/101] M8: automation roots refuse a path on another computer before resolving it (#1094) On Windows, Roots::check resolved every path (canonicalize opens it) before comparing it with the roots, so `\server\share\x` contacted the server, and could send it the user's credentials, before it was refused. Now the path as given and made absolute is classified by its spelling with craft_docpath first: another computer that no root's share is on, a device path, or a DOS device name anywhere in it is refused, and so is a link on the way that leads to one (followed by its target's spelling, up to 40 links). Fixes #1094 --- crates/engine/src/automation/file_access.rs | 189 ++++++++++++++++-- .../src/automation/file_access/tests.rs | 177 ++++++++++++++++ 2 files changed, 344 insertions(+), 22 deletions(-) diff --git a/crates/engine/src/automation/file_access.rs b/crates/engine/src/automation/file_access.rs index 5ce06b122..97c6cd2f5 100644 --- a/crates/engine/src/automation/file_access.rs +++ b/crates/engine/src/automation/file_access.rs @@ -12,6 +12,11 @@ //! existing folder is resolved and the rest must be plain names. The comparison is by whole //! components (`/work2` is not inside `/work`), and the I/O uses the resolved path, so what was //! checked is what is opened. +//! +//! On Windows, resolving a path opens it, and opening a path on another computer contacts that +//! computer and may send it the signed-in user's credentials. So before anything is resolved, a +//! path on another computer that no root is on, a device path, or one reached through a link that +//! leads to them is refused by how it is spelled (#1094). #![allow(clippy::disallowed_methods)] use std::cell::RefCell; @@ -19,6 +24,8 @@ use std::ffi::{OsStr, OsString}; use std::path::{Component, Path, PathBuf}; use std::sync::Arc; +use craft_docpath::Refused; + use crate::{EngineError, Result}; /// What a command does with a file. @@ -58,6 +65,19 @@ impl Roots { Access::Read => ([self.read.as_slice(), self.write.as_slice()].concat(), "read"), Access::Write => (self.write.clone(), "written"), }; + if cfg!(windows) { + match refused_unresolved(path, &roots) { + Some(Unresolved::Spelled(Refused::Network)) => { + return Err(format!( + "automation path rejected: {asked} is on another computer, and no folder that may be {what} is on its share" + )); + } + Some(Unresolved::Spelled(_)) => return Err(format!("automation path rejected: {asked} names a device, not a file")), + // Where a link leads is only told by the usual message: it would say what is there. + Some(Unresolved::Linked) => return Err(outside(asked, &roots, what)), + None => {} + } + } match resolve(path) { Ok(resolved) if roots.iter().any(|r| resolved.starts_with(r)) => return Ok(resolved), Ok(_) => {} @@ -65,11 +85,7 @@ impl Roots { Err(why) if inside_as_far_as_it_exists(path, &roots) => return Err(format!("automation path rejected: {asked}: {why}")), Err(_) => {} } - if roots.is_empty() { - return Err(format!("automation path rejected: no folder may be {what} (no root for it was given): {asked}")); - } - let shown: Vec = roots.iter().map(|r| shown(r)).collect(); - Err(format!("automation path rejected: {asked} is outside the folders that may be {what}: {}", shown.join(", "))) + Err(outside(asked, &roots, what)) } /// The folders as JSON, resolved: `{read: [every folder that may be read], write: [the write roots]}`. @@ -79,23 +95,146 @@ impl Roots { } } +/// Why `asked` is refused: it is outside every one of `roots`, the folders that may be `what`. +fn outside(asked: std::path::Display<'_>, roots: &[PathBuf], what: &str) -> String { + if roots.is_empty() { + return format!("automation path rejected: no folder may be {what} (no root for it was given): {asked}"); + } + let shown: Vec = roots.iter().map(|r| shown(r)).collect(); + format!("automation path rejected: {asked} is outside the folders that may be {what}: {}", shown.join(", ")) +} + +/// Why a path is refused before it is resolved (#1094). +#[derive(Debug, PartialEq, Eq)] +enum Unresolved { + /// Its spelling leads to another computer ([`Refused::Network`]) or a device ([`Refused::Device`]). + Spelled(Refused), + /// A link on the way leads there. + Linked, +} + +/// How many links are followed on the way to a path before it is given up on, as on Linux. +const MAX_LINKS: u8 = 40; + +/// Why `path` is refused before anything on the way to it is opened, if it is: resolving it would +/// open a path on another computer, which on Windows contacts that computer and may send it the +/// signed-in user's credentials, or open a device (#1094). That is the case when the path as +/// given or made absolute is (see [`refused_spelling`]), or when a link on the way, or on the way +/// on from where one leads, leads to such a path ([`link_refused`]). A path on the share of one of +/// `roots` goes on to the usual check. +fn refused_unresolved(path: &Path, roots: &[PathBuf]) -> Option { + // Made absolute without looking at the disk (on Windows `GetFullPathNameW`, which also turns a + // bare device name such as `NUL` into `\\.\NUL`, as opening it would). + let abs = std::path::absolute(path).ok()?; + if let Some(why) = [path, abs.as_path()].into_iter().find_map(|p| refused_spelling(&p.to_string_lossy(), roots)) { + return Some(Unresolved::Spelled(why)); + } + link_refused(&abs, roots, MAX_LINKS, &on_disk).then_some(Unresolved::Linked) +} + +/// What is at a path, looked at without following a link there. +#[derive(Debug, Clone, PartialEq, Eq)] +enum Entry { + /// Nothing, or what can't be looked at: resolving the path meets the same there and goes no + /// further. + Missing, + /// A file or a folder. + Plain, + /// A link, with where it leads (`None` when that can't be read). + Link(Option), +} + +/// What is at `p` on disk (see [`Entry`]). +fn on_disk(p: &Path) -> Entry { + match std::fs::symlink_metadata(p) { + Ok(m) if m.is_symlink() => Entry::Link(std::fs::read_link(p).ok()), + Ok(_) => Entry::Plain, + Err(_) => Entry::Missing, + } +} + +/// Why path `p` is refused by its spelling alone, if it is (see [`craft_docpath::resolve`], which +/// reads both `/` and `\` as separators and compares names ignoring case): +/// - on another computer (`\\server\share`, `//server/share`, `\\?\UNC\…`, `\\.\UNC\…`, or a +/// server without a share) and on no root's share; +/// - a device path (`\\.\pipe\…`, `\\?\GLOBALROOT\…`, `\\.\C:\…`), other than a local volume's +/// `\\?\Volume{…}\`, which a folder can be mounted as; +/// - or with a device name (`CON`, `NUL`, `COM1.png`, `lpt1 `…) as any of its names: each folder on +/// the way is opened in turn while the path is resolved, and the device behind a name such as +/// `LPT1` can be a printer on another computer. +fn refused_spelling(p: &str, roots: &[PathBuf]) -> Option { + match craft_docpath::resolve(p, None) { + // With a root as the document, a path on its share is allowed. + Err(Refused::Network) if !roots.iter().any(|r| craft_docpath::resolve(p, Some(r)) != Err(Refused::Network)) => { + return Some(Refused::Network); + } + Err(Refused::Device) if !is_volume(p) => return Some(Refused::Device), + _ => {} + } + // `craft_docpath` stops at the first name it refuses, which may not be the device's. + p.split(['\\', '/']).any(device_name).then_some(Refused::Device) +} + +/// Whether `p` is in a local volume by its `\\?\Volume{…}` (or `\\.\Volume{…}`) name. +fn is_volume(p: &str) -> bool { + let mut names = p.split(['\\', '/']); + let (Some(""), Some(""), Some("?" | "."), Some(volume)) = (names.next(), names.next(), names.next(), names.next()) else { + return false; + }; + volume.get(..7).is_some_and(|v| v.eq_ignore_ascii_case("Volume{")) && volume.ends_with('}') +} + +/// Whether a link on the way to `abs` (an absolute path) leads to a path [`refused_spelling`] +/// refuses, following at most `links` links: one that leads to another, or on through further +/// links, is followed too, as resolving the path would. A link that can't be read, or more links +/// than that, are refused as well. Each name on the way is looked at with `look` ([`on_disk`]), +/// which doesn't follow a link: where a link leads is looked at only once its spelling is known +/// not to be refused. +fn link_refused(abs: &Path, roots: &[PathBuf], links: u8, look: &dyn Fn(&Path) -> Entry) -> bool { + let mut at = PathBuf::new(); + let mut rest = abs.components(); + while let Some(c) = rest.next() { + at.push(c); + if !matches!(c, Component::Normal(_)) { + continue; + } + let target = match look(&at) { + Entry::Plain => continue, + // Nothing is below what isn't there, so no link either. + Entry::Missing => return false, + Entry::Link(target) => target, + }; + let (Some(links), Some(target)) = (links.checked_sub(1), target) else { return true }; + // A relative target is relative to the link's folder; an absolute one replaces it. + let next = lexical(&at.parent().unwrap_or(&at).join(target).join(rest.as_path())); + return refused_spelling(&next.to_string_lossy(), roots).is_some() || link_refused(&next, roots, links, look); + } + false +} + +/// `p` with its `.` and `..` taken by name, as Windows takes them. +fn lexical(p: &Path) -> PathBuf { + let mut out = PathBuf::new(); + for c in p.components() { + match c { + Component::ParentDir => { + out.pop(); + } + Component::CurDir => {} + c => out.push(c), + } + } + out +} + /// Whether `path` lies in one of `roots` once made absolute with its `.` and `..` taken by name and /// its longest leading part that exists resolved, so links on the way are followed as the roots' /// were (`/tmp/work/x` is inside root `/private/tmp/work`, a link out of a root leads out of it). fn inside_as_far_as_it_exists(path: &Path, roots: &[PathBuf]) -> bool { let Ok(abs) = std::path::absolute(path) else { return false }; - let mut lexical = PathBuf::new(); - for c in abs.components() { - match c { - Component::ParentDir => { - lexical.pop(); - } - Component::CurDir => {} - c => lexical.push(c), - } - } + let folded = lexical(&abs); let mut rest: Vec<&OsStr> = Vec::new(); - let mut at = lexical.as_path(); + let mut at = folded.as_path(); let resolved = loop { if let Ok(mut base) = std::fs::canonicalize(at) { base.extend(rest.iter().rev()); @@ -169,18 +308,24 @@ fn resolve(path: &Path) -> std::result::Result { fn plain_name(name: &OsStr) -> std::result::Result<(), String> { if cfg!(windows) { let n = name.to_string_lossy(); - let stem = n.split('.').next().unwrap_or_default().trim_end().to_ascii_uppercase(); - let device = matches!(stem.as_str(), "CON" | "PRN" | "AUX" | "NUL" | "CONIN$" | "CONOUT$") - || ((stem.starts_with("COM") || stem.starts_with("LPT")) - && stem.chars().count() == 4 - && stem.chars().last().is_some_and(|c| c.is_ascii_digit() || matches!(c, '¹' | '²' | '³'))); - if device || n.contains(':') { + if device_name(&n) || n.contains(':') { return Err(format!("`{n}` is a device or stream name, not a file")); } } Ok(()) } +/// Whether Windows opens a device for file or folder name `n`: `CON`, `PRN`, `AUX`, `NUL`, +/// `CONIN$`, `CONOUT$`, `COM1`…`COM9` and `LPT1`…`LPT9` (also with `¹`, `²` or `³`), in any case, +/// and with anything after a dot or a colon or trailing spaces (`nul.txt`, `COM1 .png`, `con:x`). +fn device_name(n: &str) -> bool { + let stem = n.split(['.', ':']).next().unwrap_or_default().trim_end().to_ascii_uppercase(); + matches!(stem.as_str(), "CON" | "PRN" | "AUX" | "NUL" | "CONIN$" | "CONOUT$") + || ((stem.starts_with("COM") || stem.starts_with("LPT")) + && stem.chars().count() == 4 + && stem.chars().last().is_some_and(|c| c.is_ascii_digit() || matches!(c, '¹' | '²' | '³'))) +} + thread_local! { static ROOTS: RefCell>> = const { RefCell::new(None) }; } diff --git a/crates/engine/src/automation/file_access/tests.rs b/crates/engine/src/automation/file_access/tests.rs index 72f471f94..5f9c1ad5d 100644 --- a/crates/engine/src/automation/file_access/tests.rs +++ b/crates/engine/src/automation/file_access/tests.rs @@ -191,6 +191,183 @@ fn windows_case_devices_and_streams() { assert!(!e.contains(r"\\?\"), "{e}"); } +/// How each spelling of a path on another computer or of a device is told apart from a local path +/// (#1094), on every system: only Windows checks them, but they are spelled the same everywhere. +#[test] +fn spellings_of_other_computers_and_devices_are_refused() { + use super::refused_spelling; + use craft_docpath::Refused::{Device, Network}; + let local = [PathBuf::from(r"C:\work")]; + let network = [ + r"\\192.0.2.1\share\x.png", + "//192.0.2.1/share/x.png", + r"\/192.0.2.1/share\x.png", + r"\\?\UNC\192.0.2.1\share\x.png", + r"\\?\unc\192.0.2.1\share\x.png", + "//?/UNC/192.0.2.1/share/x.png", + r"\\.\UNC\192.0.2.1\share\x.png", + // A server without a share is contacted too. + r"\\192.0.2.1", + r"\\192.0.2.1\", + r"\\SERVER.\share \x.png", + ]; + let device = [ + r"\\.\pipe\figcraft", + r"\\?\GLOBALROOT\Device\Mup\192.0.2.1\share\x.png", + r"\\.\C:\work\x.png", + r"\\.\COM1", + r"\??\UNC\192.0.2.1\share\x.png", + // A device name anywhere: each folder on the way is opened as the path is resolved. + r"C:\work\COM1", + r"C:\work\nul.txt", + r"C:\work\Com1 .png", + r"C:\work\lpt1.\x.png", + r"C:\work\LPT³\x.png", + r"C:\work\conout$", + r"C:\work\aux:stream", + // After a name `craft_docpath` refuses for another reason. + r"C:\work\a:b\prn.png", + ]; + let fine = [ + r"C:\work\x.png", + r"\\?\C:\work\x.png", + r"C:\work\console.png", + r"C:\work\com10.png", + r"C:\work\lpt.png", + r"C:\work\nul-ish.txt", + r"\\?\Volume{0b3b1c63-0000-0000-0000-100000000000}\x.png", + "/home/u/work/x.png", + "x.png", + r"..\x.png", + ]; + for (paths, want) in [(&network[..], Some(Network)), (&device[..], Some(Device)), (&fine[..], None)] { + for p in paths { + assert_eq!(refused_spelling(p, &[]), want, "{p}"); + assert_eq!(refused_spelling(p, &local), want, "{p} with a local root"); + } + } + // A root on a share lets the paths on that share through, in any case and spelling, and only them. + let shared = [PathBuf::from(r"\\?\UNC\Server\Share\work")]; + for p in [r"\\server\SHARE\work\x.png", r"\\?\UNC\SERVER\share\elsewhere\x.png", "//Server/Share/work/x.png"] { + assert_eq!(refused_spelling(p, &shared), None, "{p}"); + } + for p in [r"\\server\other\x.png", r"\\other\share\x.png", r"\\server", r"\\server.\share\x.png"] { + assert_eq!(refused_spelling(p, &shared), Some(Network), "{p}"); + } + assert_eq!(refused_spelling(r"\\server\share\work\COM1", &shared), Some(Device)); +} + +/// The links on the way to a path are followed by their spelling before anything they lead to is +/// opened (#1094). The links are made up here, so this runs where tests may not make links. +#[test] +fn links_on_the_way_are_followed_by_their_spelling_first() { + use super::{Entry, MAX_LINKS, link_refused}; + use std::cell::RefCell; + use std::collections::HashMap; + let base = std::env::temp_dir().join("figcraft-links"); + let at = |rel: &str| base.join(rel); + let mut links: HashMap> = HashMap::from([ + // Relative to the link's folder, to a device name. + (at("root/dev"), Some(PathBuf::from("../outside/nul"))), + // To another link. + (at("root/hop"), Some(at("root/dev"))), + // Within the root. + (at("root/alias"), Some(PathBuf::from("sub"))), + (at("root/loop"), Some(at("root/loop"))), + (at("root/unreadable"), None), + // Below a name that isn't there: never looked at. + (at("missing/dev"), Some(PathBuf::from("nul"))), + ]); + if cfg!(windows) { + links.insert(at("root/remote"), Some(PathBuf::from(r"\\192.0.2.1\share"))); + links.insert(at("root/far"), Some(at("root/remote/work"))); + } + let plain = [at("root"), at("root/sub"), at("outside")]; + let looked = RefCell::new(Vec::new()); + let look = |p: &Path| { + looked.borrow_mut().push(p.to_path_buf()); + match links.get(p) { + Some(target) => Entry::Link(target.clone()), + None if base.starts_with(p) || plain.iter().any(|q| q == p) => Entry::Plain, + None => Entry::Missing, + } + }; + let refused = |rel: &str, roots: &[PathBuf]| link_refused(&at(rel), roots, MAX_LINKS, &look); + for rel in ["root/dev/x.png", "root/hop/x.png", "root/loop/x.png", "root/unreadable/x.png"] { + assert!(refused(rel, &[]), "{rel}"); + } + for rel in ["root/alias/x.png", "root/sub/x.png", "root/x.png", "missing/dev/x.png"] { + assert!(!refused(rel, &[]), "{rel}"); + } + // A refused target isn't looked at, nor is anything below what isn't there. + let looked = looked.take(); + assert!(!looked.contains(&at("outside/nul")) && !looked.contains(&at("missing/dev")), "{looked:?}"); + if cfg!(windows) { + for rel in ["root/remote/x.png", "root/far/x.png"] { + assert!(refused(rel, &[]), "{rel}"); + // Unless a root is on that share. + assert!(!refused(rel, &[PathBuf::from(r"\\?\UNC\192.0.2.1\share")]), "{rel}"); + } + } +} + +/// A path on another computer, a device path, and a link to them are refused before anything is +/// opened: resolving them made Windows contact the server, which may send it the signed-in user's +/// credentials (#1094). Nothing answers on 192.0.2.1 (an address for documentation), so a path +/// there that is opened takes Windows seconds to give up on; one refused first, none. +#[cfg(windows)] +#[test] +fn other_computers_and_devices_are_refused_before_anything_is_opened() { + use std::time::{Duration, Instant}; + let f = Fixture::new("network"); + let r = f.rw(); + let read_only = Roots::new(&[f.p("root")], &[]).unwrap(); + let refused = |roots: &Roots, p: &str, access: Access| { + let t = Instant::now(); + let e = roots.check(Path::new(p), access).expect_err(p); + assert!(t.elapsed() < Duration::from_secs(3), "{p}: took {:?}, so it was opened", t.elapsed()); + e + }; + for p in + [r"\\192.0.2.1\share\x.png", "//192.0.2.1/share/x.png", r"\\?\UNC\192.0.2.1\share\x.png", r"\\.\UNC\192.0.2.1\share\x.png", r"\\192.0.2.1"] + { + for access in [Access::Read, Access::Write] { + let e = refused(&r, p, access); + assert!(e.contains("is on another computer, and no folder that may be"), "{p}: {e}"); + } + let e = refused(&read_only, p, Access::Write); + assert!(e.ends_with("is on another computer, and no folder that may be written is on its share"), "{p}: {e}"); + } + for p in [r"\\.\pipe\figcraft-roots", r"\\?\GLOBALROOT\Device\Mup\192.0.2.1\share\x.png", &f.p(r"root\COM1\x.png"), "nul"] { + let e = refused(&r, p, Access::Read); + assert!(e.ends_with("names a device, not a file"), "{p}: {e}"); + } + // Local paths, in either spelling, are checked as before. + let inside = std::fs::canonicalize(f.p("root")).unwrap().join("in.txt"); + assert!(r.check(&inside, Access::Read).is_ok()); + assert!(r.check(Path::new(&f.p(r"root\in.txt")), Access::Read).is_ok()); + + // A link in a root to another computer is refused before it is followed, also through another + // link, and with the message any path outside gets: it doesn't tell where the link leads. + if !symlink_dir(Path::new(r"\\192.0.2.1\share"), &f.0.join("root/remote")) || !symlink_dir(&f.0.join("root/remote/work"), &f.0.join("root/hop")) { + eprintln!("skipped links: this system doesn't let tests make symbolic links"); + return; + } + // Relative to the link's folder. + assert!(symlink_dir(Path::new(r"..\remote"), &f.0.join("root/sub/up"))); + assert!(symlink_file(Path::new(r"\\.\pipe\figcraft-roots"), &f.0.join("root/pipe"))); + let standard = |p: &str| format!("automation path rejected: {p} is outside the folders that may be"); + for p in [f.p("root/remote/x.png"), f.p("root/hop/x.png"), f.p("root/sub/up/x.png"), f.p("root/pipe")] { + for access in [Access::Read, Access::Write] { + let e = refused(&r, &p, access); + assert!(e.starts_with(&standard(&p)), "{p}: {e}"); + } + } + // A link to a folder in the root still leads there. + assert!(symlink_dir(&f.0.join("root/sub"), &f.0.join("root/alias"))); + assert!(r.check(Path::new(&f.p("root/alias/x.png")), Access::Write).is_ok()); +} + #[test] fn a_scope_confines_the_thread_and_ends_with_it() { let f = Fixture::new("scope"); From 8330ffb32a9cfe5ab0d035ae21f063f4f41f32cc Mon Sep 17 00:00:00 2001 From: ljkx <177671075+ljkx@users.noreply.github.com> Date: Mon, 9 Nov 2026 12:44:21 +0100 Subject: [PATCH 040/101] M1: Crop chosen in the colour picker enters crop mode (#2150) Choosing Crop from the image fill's mode dropdown only set scale_mode: crop mode never started, the first press on a handle closed the picker and went to the tool, and the picture lost its place (no placement crop). For one layer's image fill it now runs image.crop, as Object > Crop image and the Fill row's button do; other targets only set the mode, as before. Fixes #2150 --- crates/ui-egui/src/crop_image_tests.rs | 53 +++++++++++++++++++++++ crates/ui-egui/src/widgets/colorpicker.rs | 31 +++++++++++-- 2 files changed, 81 insertions(+), 3 deletions(-) diff --git a/crates/ui-egui/src/crop_image_tests.rs b/crates/ui-egui/src/crop_image_tests.rs index 7883e9fe8..00a55f7dc 100644 --- a/crates/ui-egui/src/crop_image_tests.rs +++ b/crates/ui-egui/src/crop_image_tests.rs @@ -128,3 +128,56 @@ fn in_crop_mode_the_layers_edges_crop_without_moving_the_picture() { key(&mut u, Key::Escape); assert!(ghost(&mut u).is_none(), "gone with crop mode"); } + +/// Choose `item` from the image mode dropdown of the open colour picker, which reads `shown`. +fn choose_mode(u: &mut Ui, shown: &str, item: &str) { + for text in [shown, item] { + // The picker is drawn over the Design panel, so its text comes last. + let shapes = flat(&u.frame_output(vec![]).shapes); + let (_, p, size) = crate::live_tests::texts(&shapes).into_iter().rfind(|(t, _, _)| t == text).unwrap_or_else(|| panic!("no {text:?}")); + u.button(p + size / 2.0, true); + u.button(p + size / 2.0, false); + } + u.frame(vec![]); +} + +/// Crop chosen as the image fill's mode in the colour picker enters crop mode, as Crop image does +/// (#2150): the picker closes, the picture keeps its place, and a corner handle then crops it +/// with the layer still selected. The other modes only set the mode. +#[test] +fn crop_chosen_in_the_colour_picker_enters_crop_mode() { + let (mut u, layer, _) = setup(); + u.app.ui.picker = Some(crate::colorpicker::PickerTarget::Paint { fills: true, index: 0, ids: vec![layer] }); + for _ in 0..4 { + u.frame(vec![]); + } + choose_mode(&mut u, "Fill", "Fit"); + assert_eq!(mode(&u, layer), (ImageScaleMode::Fit, None)); + assert!(u.app.ui.picker.is_some() && u.app.ui.crop.is_none(), "Fit is only a mode"); + choose_mode(&mut u, "Fit", "Crop"); + assert_eq!(u.app.ui.crop, Some((layer, 0)), "crop mode on the image fill"); + assert!(u.app.ui.picker.is_none(), "crop mode takes the canvas from the picker"); + // The picture keeps its place: the crop is the one Crop image makes of the fitted image. + let (m, Some(before)) = mode(&u, layer) else { panic!("a crop where the picture was") }; + assert_eq!(m, ImageScaleMode::Crop); + let (mut menu, other, _) = setup(); + let mut fit = menu.app.session.doc().unwrap().node(other).unwrap().fills[0].clone(); + if let PaintKind::Image(img) = &mut fit.kind { + img.scale_mode = ImageScaleMode::Fit; + } + menu.app.run("fill.set", json!({"ids": [other], "index": 0, "paint": fit})); + assert_eq!(mode(&menu, other), (ImageScaleMode::Fit, None)); + menu.app.run("image.crop", json!({})); + assert_eq!(mode(&menu, other), (ImageScaleMode::Crop, Some(before))); + // The bottom right corner, dragged in, crops the picture to the top left 3/4 of the layer. + let (from, to) = (u.app.to_screen(200.0, 100.0), u.app.to_screen(150.0, 75.0)); + u.drag_to(from, to); + u.button(to, false); + assert_eq!(u.app.session.selection(), vec![layer], "the layer stays selected"); + assert_eq!(u.app.ui.crop, Some((layer, 0)), "still cropping"); + let n = u.app.session.doc().unwrap().node(layer).unwrap().clone(); + assert!((n.width - 150.0).abs() < 1e-6 && (n.height - 75.0).abs() < 1e-6, "{} x {}", n.width, n.height); + let (_, Some(after)) = mode(&u, layer) else { panic!("a crop") }; + assert!((after[0] - before[0] * 0.75).abs() < 1e-9 && (after[3] - before[3] * 0.75).abs() < 1e-9, "{before:?} -> {after:?}"); + assert!((after[4] - before[4]).abs() < 1e-9 && (after[5] - before[5]).abs() < 1e-9, "the top left stays: {before:?} -> {after:?}"); +} diff --git a/crates/ui-egui/src/widgets/colorpicker.rs b/crates/ui-egui/src/widgets/colorpicker.rs index 1e6f9d347..848a0c8d3 100644 --- a/crates/ui-egui/src/widgets/colorpicker.rs +++ b/crates/ui-egui/src/widgets/colorpicker.rs @@ -760,6 +760,21 @@ fn blend_row(ui: &mut Ui, app: &mut FigApp, target: &PickerTarget, paint: &mut P }); } +/// The layer and fill index to crop on the canvas (`image.crop`) when Crop is chosen for `target`: +/// one layer's image fill as the Fill section shows it (a text's characters' shared fills +/// included). Strokes, several layers at once and the regions selected in vector edit mode have +/// no crop mode, so for them Crop only sets the paint's mode. +fn crop_on_canvas(app: &FigApp, target: &PickerTarget) -> Option<(NodeId, usize)> { + let PickerTarget::Paint { fills: true, index, ids } = target else { return None }; + let [id] = ids[..] else { return None }; + if figcraft_engine::vectoredit::selected_region_fills(&app.session, id).is_some() { + return None; + } + let doc = app.session.doc().ok()?; + let shown = figcraft_engine::cmd::lists::character_fills(doc.node(id)?)?; + matches!(shown.get(*index)?.kind, PaintKind::Image(_)).then_some((id, *index)) +} + /// The image paint's scale mode, rotation, colour profile, presets and filter sliders. fn image_controls(app: &mut FigApp, ui: &mut Ui, target: &PickerTarget, paint: &mut Paint, mut img: ImagePaint, t: &Tokens) { ui.horizontal(|ui| { @@ -773,9 +788,19 @@ fn image_controls(app: &mut FigApp, ui: &mut Ui, target: &PickerTarget, paint: & (tr("Tile"), ImageScaleMode::Tile), ] { if crate::right::menu_item(ui, l, "") { - img.scale_mode = m; - paint.kind = PaintKind::Image(img.clone()); - write(app, target, paint, false); + match crop_on_canvas(app, target).filter(|_| m == ImageScaleMode::Crop) { + // Crop for a layer's own image fill is Crop image (#2150): the picture keeps + // its place and crop mode takes the canvas, closing the picker, so its + // handles crop it as they do when crop mode comes from the menu. + Some((id, index)) => { + app.run("image.crop", json!({"ids": [id], "index": index})); + } + None => { + img.scale_mode = m; + paint.kind = PaintKind::Image(img.clone()); + write(app, target, paint, false); + } + } ui.close(); } } From 91a76c72c4a40ff1fe245521459cd3caf59604c4 Mon Sep 17 00:00:00 2001 From: ljkx <177671075+ljkx@users.noreply.github.com> Date: Mon, 9 Nov 2026 12:53:10 +0100 Subject: [PATCH 041/101] M1: the picker-Crop test drags the picture's corner outside the layer too (#2150) --- crates/ui-egui/src/crop_image_tests.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/crates/ui-egui/src/crop_image_tests.rs b/crates/ui-egui/src/crop_image_tests.rs index 00a55f7dc..9f802aee2 100644 --- a/crates/ui-egui/src/crop_image_tests.rs +++ b/crates/ui-egui/src/crop_image_tests.rs @@ -180,4 +180,16 @@ fn crop_chosen_in_the_colour_picker_enters_crop_mode() { let (_, Some(after)) = mode(&u, layer) else { panic!("a crop") }; assert!((after[0] - before[0] * 0.75).abs() < 1e-9 && (after[3] - before[3] * 0.75).abs() < 1e-9, "{before:?} -> {after:?}"); assert!((after[4] - before[4]).abs() < 1e-9 && (after[5] - before[5]).abs() < 1e-9, "the top left stays: {before:?} -> {after:?}"); + // The picture's own corner, now outside the layer at (200, 100), scales the picture inside the + // layer, which keeps its size and its selection. + let (from, to) = (u.app.to_screen(200.0, 100.0), u.app.to_screen(240.0, 120.0)); + u.drag_to(from, to); + u.button(to, false); + assert_eq!(u.app.session.selection(), vec![layer], "the layer stays selected"); + assert_eq!(u.app.ui.crop, Some((layer, 0)), "still cropping"); + let n = u.app.session.doc().unwrap().node(layer).unwrap().clone(); + assert!((n.width - 150.0).abs() < 1e-6 && (n.height - 75.0).abs() < 1e-6, "the layer keeps its size: {} x {}", n.width, n.height); + let (_, Some(scaled)) = mode(&u, layer) else { panic!("a crop") }; + // The picture grew from 200 x 100 to 240 x 120: the layer shows 5/6 of what it showed. + assert!((scaled[0] - after[0] * 5.0 / 6.0).abs() < 1e-6 && (scaled[3] - after[3] * 5.0 / 6.0).abs() < 1e-6, "{after:?} -> {scaled:?}"); } From 50a76d091421d629a50dbb2b4e1fddf6ae21fcd3 Mon Sep 17 00:00:00 2001 From: Ragulsundaram <41433645+Ragulsundaram@users.noreply.github.com> Date: Mon, 9 Nov 2026 18:45:27 +0530 Subject: [PATCH 042/101] i18n: Tamil (ta) interface catalog (#2159) Adds ta.toml with every UI string, command label and menu wording, marked draft. Desktop draws Tamil with an installed face (#2018); the web picker leaves Tamil out until craft-fonts has Noto Sans Tamil, like Georgian and Arabic, with a test. docs/translating.md gains Tamil's entry, typography notes and a Tamil draft section. --- crates/ui-egui/locales/ta.toml | 2685 ++++++++++++++++++++++++++++++++ crates/ui-egui/src/cjk.rs | 13 + docs/translating.md | 19 +- 3 files changed, 2716 insertions(+), 1 deletion(-) create mode 100644 crates/ui-egui/locales/ta.toml diff --git a/crates/ui-egui/locales/ta.toml b/crates/ui-egui/locales/ta.toml new file mode 100644 index 000000000..15b12d854 --- /dev/null +++ b/crates/ui-egui/locales/ta.toml @@ -0,0 +1,2685 @@ +# FigCraft interface strings: Tamil (தமிழ்), translated from the English catalog. +# See docs/translating.md. + +[meta] +name = "தமிழ்" +status = "draft — needs native review" + +[ui] +"% of all commits" = "அனைத்து கமிட்களில் %" +"(no longer published)" = "(இனி வெளியிடப்படவில்லை)" +"({n} warnings: some entries were skipped)" = { one = "({n} எச்சரிக்கை: சில உள்ளீடுகள் தவிர்க்கப்பட்டன)", other = "({n} எச்சரிக்கைகள்: சில உள்ளீடுகள் தவிர்க்கப்பட்டன)" } +"+ Create variable" = "+ வேரியபிள் உருவாக்கு" +".fig (experimental)" = ".fig (சோதனை நிலை)" +"1 year" = "1 ஆண்டு" +"1…9, 0" = "1…9, 0" +"30 days" = "30 நாட்கள்" +"90 days" = "90 நாட்கள்" +"@{login}: {prs} PRs, {commits} commits, +{added} / −{deleted} lines (Δ {delta}), +{bin_added} / −{bin_deleted} binary assets, {first} – {last}" = "@{login}: {prs} PRகள், {commits} கமிட்கள், +{added} / −{deleted} வரிகள் (Δ {delta}), +{bin_added} / −{bin_deleted} பைனரி அசெட்கள், {first} – {last}" +"A .figcraft file with this name already exists. Choose its full name to confirm replacement." = "இந்தப் பெயரில் ஒரு .figcraft கோப்பு ஏற்கனவே உள்ளது. மாற்றியமைப்பை உறுதிப்படுத்த அதன் முழுப் பெயரைத் தேர்ந்தெடுக்கவும்." +"A collection of this file with these modes and variables: override their values per mode and add variables of its own" = "இந்தக் கோப்பின் இந்த மோட்கள் மற்றும் வேரியபிள்களுடன் கூடிய தொகுப்பு: ஒவ்வொரு மோடுக்கும் அவற்றின் மதிப்புகளை மாற்றலாம், சொந்த வேரியபிள்களையும் சேர்க்கலாம்" +"A later vote" = "பிந்தைய வாக்கு" +"A layer on its own aligns to its frame: select more layers, or one in a frame" = "தனி லேயர் அதன் ஃப்ரேமுடன் சீரமையும்: கூடுதல் லேயர்களை அல்லது ஃப்ரேமில் உள்ள ஒன்றைத் தேர்ந்தெடுக்கவும்" +"A responsive product page: hero, features, figures, a quote and a footer" = "பதிலளிக்கும் தயாரிப்புப் பக்கம்: ஹீரோ, அம்சங்கள், எண்ணிக்கைகள், மேற்கோள் மற்றும் அடிக்குறிப்பு" +"A spring plays until it settles: its mass, stiffness and damping set how long" = "ஸ்பிரிங் நிலைபெறும் வரை இயங்கும்: அதன் நிறை, விறைப்பு, தணிப்பு ஆகியவை கால அளவைத் தீர்மானிக்கின்றன" +"A table takes at most {rows} rows and {columns} columns: the rest wasn't pasted" = "ஒரு அட்டவணையில் அதிகபட்சம் {rows} வரிசைகளும் {columns} நெடுவரிசைகளும் இருக்கலாம்: மீதி ஒட்டப்படவில்லை" +"A title, an agenda, a big figure, a chart and a closing slide" = "தலைப்பு, நிகழ்ச்சி நிரல், பெரிய எண், விளக்கப்படம் மற்றும் நிறைவு ஸ்லைடு" +"A to Z" = "A முதல் Z வரை" +"About" = "பற்றி" +"About FigCraft" = "FigCraft பற்றி" +"About this server" = "இந்த சர்வர் பற்றி" +"Action" = "செயல்" +"Actions" = "செயல்கள்" +"Actions for {name}" = "{name} க்கான செயல்கள்" +"Actions…" = "செயல்கள்…" +"Active" = "செயலில்" +"Actual size (100%)" = "உண்மையான அளவு (100%)" +"Add a category" = "வகையைச் சேர்" +"Add a comment" = "கருத்தைச் சேர்" +"Add a connected shape" = "இணைந்த வடிவத்தைச் சேர்" +"Add a description" = "விளக்கத்தைச் சேர்" +"Add a frame (F) or a shape (R) to get started" = "தொடங்க ஒரு ஃப்ரேம் (F) அல்லது வடிவத்தை (R) சேர்க்கவும்" +"Add a layer or component to tile first" = "முதலில் டைல் செய்ய ஒரு லேயர் அல்லது காம்போனென்டைச் சேர்க்கவும்" +"Add a minute" = "ஒரு நிமிடம் சேர்" +"Add a note for developers" = "டெவலப்பர்களுக்கான குறிப்பைச் சேர்" +"Add action" = "செயலைச் சேர்" +"Add actions for when no condition holds" = "எந்த நிபந்தனையும் பொருந்தாதபோது செயல்களைச் சேர்" +"Add an annotation for developers" = "டெவலப்பர்களுக்கான குறிப்புரையைச் சேர்" +"Add another condition" = "மற்றொரு நிபந்தனையைச் சேர்" +"Add auto layout" = "ஆட்டோ லேஅவுட் சேர்" +"Add background behind overlay" = "ஓவர்லேவின் பின்னால் பின்னணி சேர்" +"Add column" = "நெடுவரிசை சேர்" +"Add content to this slot" = "இந்த ஸ்லாட்டில் உள்ளடக்கம் சேர்" +"Add dev resource" = "டெவ் ஆதாரத்தைச் சேர்" +"Add effect" = "எஃபெக்ட் சேர்" +"Add export setting" = "ஏற்றுமதி அமைப்பைச் சேர்" +"Add fill" = "ஃபில் சேர்" +"Add interaction" = "இன்டராக்ஷனைச் சேர்" +"Add layout grid" = "லேஅவுட் கட்டம் சேர்" +"Add library" = "லைப்ரரி சேர்" +"Add library file…" = "லைப்ரரி கோப்பைச் சேர்…" +"Add max height" = "அதிகபட்ச உயரம் சேர்" +"Add max width" = "அதிகபட்ச அகலம் சேர்" +"Add measurement" = "அளவீடு சேர்" +"Add min height" = "குறைந்தபட்ச உயரம் சேர்" +"Add min width" = "குறைந்தபட்ச அகலம் சேர்" +"Add mode" = "மோட் சேர்" +"Add new page" = "புதிய பக்கம் சேர்" +"Add or update collections from a variables JSON" = "வேரியபிள்கள் JSON இலிருந்து தொகுப்புகளைச் சேர் அல்லது புதுப்பி" +"Add properties to make instances configurable" = "இன்ஸ்டன்ஸ்களை உள்ளமைக்க பண்புகளைச் சேர்க்கவும்" +"Add reaction" = "எதிர்வினை சேர்" +"Add row" = "வரிசை சேர்" +"Add starting point" = "தொடக்கப் புள்ளி சேர்" +"Add stroke" = "ஸ்ட்ரோக் சேர்" +"Add variant" = "வேரியன்ட் சேர்" +"Add variant with a new value" = "புதிய மதிப்புடன் வேரியன்ட் சேர்" +"Added" = "சேர்க்கப்பட்டது" +"Added the library \"{name}\"" = "\"{name}\" லைப்ரரி சேர்க்கப்பட்டது" +"Adding to {name}" = "{name} இல் சேர்க்கிறது" +"Adjust" = "சரிசெய்" +"Adjustment presets" = "சரிசெய்தல் முன்னமைவுகள்" +"Advanced" = "மேம்பட்டவை" +"Advanced stroke" = "மேம்பட்ட ஸ்ட்ரோக்" +"After delay" = "தாமதத்திற்குப் பின்" +"After delay {ms}ms" = "{ms}ms தாமதத்திற்குப் பின்" +"Agent" = "ஏஜென்ட்" +"Align" = "சீரமை" +"Align bottom" = "கீழே சீரமை" +"Align center" = "மையத்தில் சீரமை" +"Align horizontal centers" = "கிடைமட்ட மையங்களைச் சீரமை" +"Align left" = "இடதுபுறம் சீரமை" +"Align middle" = "நடுவில் சீரமை" +"Align right" = "வலதுபுறம் சீரமை" +"Align text baselines" = "உரை அடிக்கோடுகளைச் சீரமை" +"Align top" = "மேலே சீரமை" +"Align vertical centers" = "செங்குத்து மையங்களைச் சீரமை" +"Alignment" = "சீரமைப்பு" +"All" = "அனைத்தும்" +"All categories" = "அனைத்து வகைகள்" +"All comments" = "அனைத்து கருத்துகள்" +"All components" = "அனைத்து காம்போனென்ட்கள்" +"All fonts" = "அனைத்து எழுத்துருக்கள்" +"All objects" = "அனைத்து பொருள்கள்" +"All supported properties" = "ஆதரிக்கப்படும் அனைத்து பண்புகள்" +"All the fonts this file uses are installed" = "இந்தக் கோப்பு பயன்படுத்தும் அனைத்து எழுத்துருக்களும் நிறுவப்பட்டுள்ளன" +"All variables" = "அனைத்து வேரியபிள்கள்" +"Allow and download" = "அனுமதித்து பதிவிறக்கு" +"Allow downloading fonts?" = "எழுத்துருக்களைப் பதிவிறக்க அனுமதிக்கவா?" +"Along the bottom" = "கீழே நெடுகிலும்" +"Along the left" = "இடதுபுறம் நெடுகிலும்" +"Along the right" = "வலதுபுறம் நெடுகிலும்" +"Along the top" = "மேலே நெடுகிலும்" +"Alpha" = "ஆல்ஃபா" +"Alphabetical" = "அகர வரிசை" +"Alt+double-click an edge of an auto layout child" = "ஆட்டோ லேஅவுட் சைல்டின் ஓரத்தை Alt+இருமுறை கிளிக் செய்யவும்" +"Alt+drag" = "Alt+இழு" +"An analytics screen on a grid: figures, charts drawn from vectors and a table" = "வெக்டர்களால் வரையப்பட்ட விளக்கப்படங்கள், எண்ணிக்கைகள் மற்றும் அட்டவணையுடன் கட்டத்தில் ஒரு பகுப்பாய்வுத் திரை" +"An earlier vote" = "முந்தைய வாக்கு" +"An invite link that opens FigCraft and joins" = "FigCraft ஐத் திறந்து இணையும் அழைப்பு இணைப்பு" +"Anchor" = "நங்கூரம்" +"Android" = "Android" +"Android Vector Drawable" = "Android Vector Drawable" +"Angular" = "கோண" +"Animation" = "அனிமேஷன்" +"Annotations" = "குறிப்புரைகள்" +"Annotations shown on the canvas" = "கேன்வாஸில் காட்டப்படும் குறிப்புரைகள்" +"Another server, or one that needs its key. The usual server is set in Preferences." = "மற்றொரு சர்வர், அல்லது சாவி தேவைப்படும் ஒன்று. வழக்கமான சர்வர் விருப்பங்களில் அமைக்கப்பட்டுள்ளது." +"Any status" = "எந்த நிலையும்" +"Anyone on your network with this code can edit the file, while this app stays open." = "இந்த ஆப் திறந்திருக்கும் வரை, இந்தக் குறியீடு உள்ள உங்கள் நெட்வொர்க்கில் உள்ள எவரும் கோப்பைத் திருத்தலாம்." +"Anyone on your network with this code can look at the file, not change it, while this app stays open." = "இந்த ஆப் திறந்திருக்கும் வரை, இந்தக் குறியீடு உள்ள உங்கள் நெட்வொர்க்கில் உள்ள எவரும் கோப்பைப் பார்க்கலாம், மாற்ற முடியாது." +"Anyone with the edit link can change the file; the view link only lets people look. The links carry their secrets: share them like passwords. `figcraft-server links` makes more and revokes them." = "திருத்தும் இணைப்பு உள்ள எவரும் கோப்பை மாற்றலாம்; பார்க்கும் இணைப்பு பார்க்க மட்டுமே அனுமதிக்கும். இணைப்புகளில் அவற்றின் ரகசியங்கள் உள்ளன: கடவுச்சொற்களைப் போலப் பகிரவும். `figcraft-server links` மேலும் இணைப்புகளை உருவாக்கி அவற்றைத் திரும்பப் பெறும்." +"Anyone with this code can edit the file." = "இந்தக் குறியீடு உள்ள எவரும் கோப்பைத் திருத்தலாம்." +"Anyone with this code can look at the file and comment on it, not change it." = "இந்தக் குறியீடு உள்ள எவரும் கோப்பைப் பார்த்துக் கருத்து தெரிவிக்கலாம், மாற்ற முடியாது." +"Anyone with this code can look at the file, not change it." = "இந்தக் குறியீடு உள்ள எவரும் கோப்பைப் பார்க்கலாம், மாற்ற முடியாது." +"Appearance" = "தோற்றம்" +"Apply a component property" = "காம்போனென்ட் பண்பைப் பயன்படுத்து" +"Apply variable" = "வேரியபிளைப் பயன்படுத்து" +"Apply variable to text" = "உரைக்கு வேரியபிளைப் பயன்படுத்து" +"Apply variable to visibility" = "தெரிவுநிலைக்கு வேரியபிளைப் பயன்படுத்து" +"Apps" = "ஆப்கள்" +"Apr" = "ஏப்" +"Arc" = "வில்" +"Arc ratio" = "வில் விகிதம்" +"Arc start" = "வில் தொடக்கம்" +"Arc sweep" = "வில் பரப்பு" +"Archive" = "காப்பகப்படுத்து" +"Archived" = "காப்பகப்படுத்தப்பட்டது" +"Arrange" = "ஒழுங்குபடுத்து" +"Arrow" = "அம்பு" +"Arrow left" = "இடது அம்பு" +"Arrow right" = "வலது அம்பு" +"As typed" = "தட்டச்சு செய்தபடி" +"Asking the server…" = "சர்வரிடம் கேட்கிறது…" +"Assets" = "அசெட்கள்" +"Aug" = "ஆக" +"Auto" = "ஆட்டோ" +"Auto (space around)" = "ஆட்டோ (சுற்றி இடைவெளி)" +"Auto (space between)" = "ஆட்டோ (இடையில் இடைவெளி)" +"Auto (space evenly)" = "ஆட்டோ (சம இடைவெளி)" +"Auto ({mode})" = "ஆட்டோ ({mode})" +"Auto columns" = "ஆட்டோ நெடுவரிசைகள்" +"Auto gap" = "ஆட்டோ இடைவெளி" +"Auto height" = "ஆட்டோ உயரம்" +"Auto layout" = "ஆட்டோ லேஅவுட்" +"Auto rows" = "ஆட்டோ வரிசைகள்" +"Auto width" = "ஆட்டோ அகலம்" +"Auto: as many words as fit on each line" = "ஆட்டோ: ஒவ்வொரு வரியிலும் பொருந்தும் அளவு சொற்கள்" +"Auto: by the first letter with a direction" = "ஆட்டோ: திசையுள்ள முதல் எழுத்தின்படி" +"Back" = "பின்" +"Back to Ready for dev" = "டெவ்-க்குத் தயார் நிலைக்குத் திரும்பு" +"Back to Ready for dev: the next change compares with how it is now" = "டெவ்-க்குத் தயார் நிலைக்குத் திரும்பு: அடுத்த மாற்றம் தற்போதைய நிலையுடன் ஒப்பிடப்படும்" +"Back to assets" = "அசெட்களுக்குத் திரும்பு" +"Back to current" = "தற்போதையதற்குத் திரும்பு" +"Back to styles" = "ஸ்டைல்களுக்குத் திரும்பு" +"Back to the FigCraft server" = "FigCraft சர்வருக்குத் திரும்பு" +"Back to the canvas from a focused region" = "கவனப் பகுதியிலிருந்து கேன்வாஸுக்குத் திரும்பு" +"Back to the current version" = "தற்போதைய பதிப்புக்குத் திரும்பு" +"Back to the font's value" = "எழுத்துருவின் மதிப்புக்குத் திரும்பு" +"Back to the values the font style implies" = "எழுத்துரு ஸ்டைல் குறிக்கும் மதிப்புகளுக்குத் திரும்பு" +"Background" = "பின்னணி" +"Background blur" = "பின்னணி மங்கல்" +"Balance" = "சமநிலை" +"Balance: every line close to the same length" = "சமநிலை: ஒவ்வொரு வரியும் ஏறக்குறைய ஒரே நீளம்" +"Basics" = "அடிப்படைகள்" +"Before" = "முன்" +"Bend" = "வளை" +"Best effort" = "இயன்றவரை" +"Between the selected layers" = "தேர்ந்தெடுத்த லேயர்களுக்கு இடையில்" +"Bevel" = "சாய்விளிம்பு" +"Binary assets added" = "சேர்க்கப்பட்ட பைனரி அசெட்கள்" +"Binary assets removed" = "நீக்கப்பட்ட பைனரி அசெட்கள்" +"Black & white" = "கருப்பு வெள்ளை" +"Bleed" = "ப்ளீட்" +"Bleed marks" = "ப்ளீட் குறிகள்" +"Bleed marks need a bleed" = "ப்ளீட் குறிகளுக்கு ப்ளீட் தேவை" +"Blend" = "கலப்பு" +"Blend mode" = "கலப்பு முறை" +"Blue" = "நீலம்" +"Blur" = "மங்கல்" +"Board grid" = "போர்டு கட்டம்" +"Boolean" = "பூலியன்" +"Boolean groups" = "பூலியன் குழுக்கள்" +"Both directions" = "இரு திசைகளிலும்" +"Bottom" = "கீழ்" +"Bottom left radius" = "கீழ் இடது ஆரம்" +"Bottom padding" = "கீழ் பேடிங்" +"Bottom right radius" = "கீழ் வலது ஆரம்" +"Bound to {name}. Click to detach the variable." = "{name} உடன் இணைக்கப்பட்டுள்ளது. வேரியபிளைப் பிரிக்கக் கிளிக் செய்யவும்." +"Brainstorm" = "கருத்துதிர்ப்பு" +"Branch" = "கிளை" +"Branch archived" = "கிளை காப்பகப்படுத்தப்பட்டது" +"Branch merged" = "கிளை இணைக்கப்பட்டது" +"Branch name" = "கிளையின் பெயர்" +"Branch of {file}" = "{file} இன் கிளை" +"Branch of {file} · merged or archived" = "{file} இன் கிளை · இணைக்கப்பட்டது அல்லது காப்பகப்படுத்தப்பட்டது" +"Branch updated from main" = "main இலிருந்து கிளை புதுப்பிக்கப்பட்டது" +"Branch {name}" = "கிளை {name}" +"Branches" = "கிளைகள்" +"Bring forward" = "முன்னே கொண்டு வா" +"Bring the main file's changes into the branch" = "முதன்மைக் கோப்பின் மாற்றங்களைக் கிளைக்குள் கொண்டு வா" +"Bring to front" = "முன்பக்கம் கொண்டு வா" +"Bristle" = "முட்கள்" +"Browse" = "உலாவு" +"Brush" = "தூரிகை" +"Brush rotation jitter" = "தூரிகைச் சுழற்சி மாறுபாடு" +"Brush scatter" = "தூரிகைச் சிதறல்" +"Brush size jitter" = "தூரிகை அளவு மாறுபாடு" +"Brush spacing" = "தூரிகை இடைவெளி" +"Bulleted list" = "புள்ளிப் பட்டியல்" +"C or Shift+C" = "C அல்லது Shift+C" +"C or ⇧C" = "C அல்லது ⇧C" +"CMYK colour" = "CMYK நிறம்" +"CSS custom properties…" = "CSS தனிப்பயன் பண்புகள்…" +"Calculated from other variables; it follows them" = "மற்ற வேரியபிள்களிலிருந்து கணக்கிடப்படுகிறது; அவற்றைப் பின்பற்றும்" +"Can comment" = "கருத்து தெரிவிக்கலாம்" +"Can comment: you see every change as it happens and can comment, but can't edit. Leave to keep a copy you can edit." = "கருத்து தெரிவிக்கலாம்: ஒவ்வொரு மாற்றத்தையும் நடக்கும்போதே பார்த்துக் கருத்து தெரிவிக்கலாம், ஆனால் திருத்த முடியாது. திருத்தக்கூடிய நகலை வைத்திருக்க வெளியேறவும்." +"Can edit" = "திருத்தலாம்" +"Can view" = "பார்க்கலாம்" +"Can't read this library: {e}" = "இந்த லைப்ரரியைப் படிக்க முடியவில்லை: {e}" +"Cancel" = "ரத்துசெய்" +"Canvas" = "கேன்வாஸ்" +"Canvas stacking" = "கேன்வாஸ் அடுக்கு வரிசை" +"Cap height to baseline" = "கேப் உயரம் முதல் அடிக்கோடு வரை" +"Case" = "எழுத்துவகை" +"Case-sensitive forms" = "பெரிய எழுத்துக்கு ஏற்ற வடிவங்கள்" +"Categories" = "வகைகள்" +"Center" = "மையம்" +"Change alias" = "மாற்றுப்பெயரை மாற்று" +"Change resolved" = "மாற்றம் தீர்க்கப்பட்டது" +"Change style" = "ஸ்டைலை மாற்று" +"Change to" = "இதற்கு மாற்று" +"Change to needs a layer inside a variant" = "\"இதற்கு மாற்று\" க்கு வேரியன்டுக்குள் ஒரு லேயர் தேவை" +"Changed" = "மாற்றப்பட்டது" +"Changed on both sides: keep one" = "இரு பக்கங்களிலும் மாற்றப்பட்டது: ஒன்றை வைத்திருக்கவும்" +"Changed {date}" = "{date} அன்று மாற்றப்பட்டது" +"Changes on main" = "main இல் மாற்றங்கள்" +"Changes on the branch" = "கிளையில் மாற்றங்கள்" +"Changes unknown" = "மாற்றங்கள் தெரியவில்லை" +"Check" = "சரிபார்" +"Check for Updates" = "புதுப்பிப்புகளைச் சரிபார்" +"Check for updates" = "புதுப்பிப்புகளைச் சரிபார்" +"Check for updates…" = "புதுப்பிப்புகளைச் சரிபார்…" +"Checking the fonts installed on this computer…" = "இந்தக் கணினியில் நிறுவப்பட்ட எழுத்துருக்களைச் சரிபார்க்கிறது…" +"Checking the server…" = "சர்வரைச் சரிபார்க்கிறது…" +"Chevron" = "செவ்ரான்" +"Choose React, Leptos, Vue, SwiftUI, Compose, ArkUI or Flutter above to connect this component to its code." = "இந்தக் காம்போனென்டை அதன் குறியீட்டுடன் இணைக்க மேலே React, Leptos, Vue, SwiftUI, Compose, ArkUI அல்லது Flutter ஐத் தேர்ந்தெடுக்கவும்." +"Choose another profile to change it." = "அதை மாற்ற வேறொரு சுயவிவரத்தைத் தேர்ந்தெடுக்கவும்." +"Choose collection" = "தொகுப்பைத் தேர்ந்தெடு" +"Choose image" = "படத்தைத் தேர்ந்தெடு" +"Choose mode" = "மோடைத் தேர்ந்தெடு" +"Choose variable" = "வேரியபிளைத் தேர்ந்தெடு" +"Circle" = "வட்டம்" +"Clear from this list" = "இந்தப் பட்டியலிலிருந்து அழி" +"Clear recent" = "சமீபத்தியவற்றை அழி" +"Clear results" = "முடிவுகளை அழி" +"Click + to replace mixed content" = "கலப்பு உள்ளடக்கத்தை மாற்ற + ஐக் கிளிக் செய்யவும்" +"Click anywhere on the canvas to leave one." = "ஒன்றை இட கேன்வாஸில் எங்காவது கிளிக் செய்யவும்." +"Click objects to vote; click your badge to take a vote back" = "வாக்களிக்கப் பொருள்களைக் கிளிக் செய்யவும்; வாக்கைத் திரும்பப் பெற உங்கள் பேட்ஜைக் கிளிக் செய்யவும்" +"Click or drag to merge · {alt} removes" = "இணைக்கக் கிளிக் செய்யவும் அல்லது இழுக்கவும் · {alt} நீக்கும்" +"Click or drag to remove · {alt} merges" = "நீக்கக் கிளிக் செய்யவும் அல்லது இழுக்கவும் · {alt} இணைக்கும்" +"Click to record a key" = "விசையைப் பதிவுசெய்யக் கிளிக் செய்யவும்" +"Clip content" = "உள்ளடக்கத்தை வெட்டு" +"Clip to shape" = "வடிவத்திற்கு வெட்டு" +"Close" = "மூடு" +"Close overlay" = "ஓவர்லேவை மூடு" +"Close preview" = "முன்னோட்டத்தை மூடு" +"Close tab" = "தாவலை மூடு" +"Close version history" = "பதிப்பு வரலாற்றை மூடு" +"Close when clicking outside" = "வெளியே கிளிக் செய்யும்போது மூடு" +"Code" = "குறியீடு" +"Code or invite link" = "குறியீடு அல்லது அழைப்பு இணைப்பு" +"Code syntax" = "குறியீட்டு தொடரியல்" +"Collapse" = "சுருக்கு" +"Collection" = "தொகுப்பு" +"Collections" = "தொகுப்புகள்" +"Color" = "நிறம்" +"Color burn" = "நிற எரிப்பு" +"Color dodge" = "நிற ஒளிர்வு" +"Color format" = "நிற வடிவம்" +"Color profile" = "நிறச் சுயவிவரம்" +"Color profile: {name}" = "நிறச் சுயவிவரம்: {name}" +"Color styles" = "நிற ஸ்டைல்கள்" +"Color values in this file are in this color space." = "இந்தக் கோப்பின் நிற மதிப்புகள் இந்த நிற வெளியில் உள்ளன." +"Color variables" = "நிற வேரியபிள்கள்" +"Colour" = "நிறம்" +"Colour and text styles, Light and Dark variables, buttons, inputs and cards" = "நிற மற்றும் உரை ஸ்டைல்கள், Light மற்றும் Dark வேரியபிள்கள், பொத்தான்கள், உள்ளீடுகள் மற்றும் கார்டுகள்" +"Column" = "நெடுவரிசை" +"Column gap" = "நெடுவரிசை இடைவெளி" +"Column sizes" = "நெடுவரிசை அளவுகள்" +"Column span" = "நெடுவரிசை பரவல்" +"Columns" = "நெடுவரிசைகள்" +"Columns {count}" = "நெடுவரிசைகள் {count}" +"Comment" = "கருத்து" +"Comments" = "கருத்துகள்" +"Commits" = "கமிட்கள்" +"Company" = "நிறுவனம்" +"Compare changes" = "மாற்றங்களை ஒப்பிடு" +"Compare with" = "இதனுடன் ஒப்பிடு" +"Compatibility" = "இணக்கத்தன்மை" +"Compatibility notes" = "இணக்கத்தன்மைக் குறிப்புகள்" +"Completed" = "முடிந்தது" +"Component" = "காம்போனென்ட்" +"Component name" = "காம்போனென்ட் பெயர்" +"Component property" = "காம்போனென்ட் பண்பு" +"Component set" = "காம்போனென்ட் தொகுப்பு" +"Component sets" = "காம்போனென்ட் தொகுப்புகள்" +"Components" = "காம்போனென்ட்கள்" +"Conditional" = "நிபந்தனை" +"Confetti" = "வண்ணக் காகிதத் துகள்" +"Conflicts" = "முரண்பாடுகள்" +"Connect to code" = "குறியீட்டுடன் இணை" +"Connected" = "இணைக்கப்பட்டது" +"Connected to code: {from}" = "குறியீட்டுடன் இணைக்கப்பட்டது: {from}" +"Connection lost, reconnecting (attempt {attempt})…" = "இணைப்பு துண்டிக்கப்பட்டது, மீண்டும் இணைக்கிறது (முயற்சி {attempt})…" +"Connector" = "கனெக்டர்" +"Constrain proportions" = "விகிதங்களைக் கட்டுப்படுத்து" +"Constraints" = "கட்டுப்பாடுகள்" +"Content" = "உள்ளடக்கம்" +"Contents hidden" = "உள்ளடக்கம் மறைக்கப்பட்டது" +"Contextual alternates" = "சூழல் மாற்றுருக்கள்" +"Contrast" = "மாறுபாடு" +"Contributors" = "பங்களிப்பாளர்கள்" +"Contributors: {people} · Commits: {commits}" = "பங்களிப்பாளர்கள்: {people} · கமிட்கள்: {commits}" +"Controller" = "கட்டுப்படுத்தி" +"Convert to frame" = "ஃப்ரேமாக மாற்று" +"Convert to section" = "செக்ஷனாக மாற்று" +"Cool" = "குளிர்" +"Copied as CSS" = "CSS ஆக நகலெடுக்கப்பட்டது" +"Copied as PNG" = "PNG ஆக நகலெடுக்கப்பட்டது" +"Copied as SVG" = "SVG ஆக நகலெடுக்கப்பட்டது" +"Copied as text" = "உரையாக நகலெடுக்கப்பட்டது" +"Copied comments for AI" = "AI க்காகக் கருத்துகள் நகலெடுக்கப்பட்டன" +"Copied {value}" = "{value} நகலெடுக்கப்பட்டது" +"Copy" = "நகலெடு" +"Copy as" = "இவ்வாறு நகலெடு" +"Copy as CSS" = "CSS ஆக நகலெடு" +"Copy as PNG" = "PNG ஆக நகலெடு" +"Copy as SVG" = "SVG ஆக நகலெடு" +"Copy browser link" = "உலாவி இணைப்பை நகலெடு" +"Copy code" = "குறியீட்டை நகலெடு" +"Copy effect" = "எஃபெக்டை நகலெடு" +"Copy fill" = "ஃபில்லை நகலெடு" +"Copy for AI" = "AI க்காக நகலெடு" +"Copy link" = "இணைப்பை நகலெடு" +"Copy stroke" = "ஸ்ட்ரோக்கை நகலெடு" +"Copy the {label}" = "{label} ஐ நகலெடு" +"Copy {value}" = "{value} ஐ நகலெடு" +"Corner radius" = "மூலை ஆரம்" +"Corner smoothing" = "மூலை மென்மையாக்கல்" +"Couldn't download the variables" = "வேரியபிள்களைப் பதிவிறக்க முடியவில்லை" +"Couldn't download {name}" = "{name} ஐப் பதிவிறக்க முடியவில்லை" +"Couldn't reach {server} for its team list." = "அணிப் பட்டியலுக்காக {server} ஐ அணுக முடியவில்லை." +"Couldn't reach {server}: showing what this computer remembers." = "{server} ஐ அணுக முடியவில்லை: இந்தக் கணினி நினைவில் வைத்திருப்பதைக் காட்டுகிறது." +"Couldn't read {name}." = "{name} ஐப் படிக்க முடியவில்லை." +"Couldn't save automatically: {error}" = "தானாகச் சேமிக்க முடியவில்லை: {error}" +"Couldn't save the file" = "கோப்பைச் சேமிக்க முடியவில்லை" +"Count" = "எண்ணிக்கை" +"Create" = "உருவாக்கு" +"Create a variable collection first" = "முதலில் ஒரு வேரியபிள் தொகுப்பை உருவாக்கவும்" +"Create a variable first" = "முதலில் ஒரு வேரியபிளை உருவாக்கவும்" +"Create alias" = "மாற்றுப்பெயர் உருவாக்கு" +"Create branch" = "கிளை உருவாக்கு" +"Create collection" = "தொகுப்பு உருவாக்கு" +"Create component" = "காம்போனென்ட் உருவாக்கு" +"Create component property" = "காம்போனென்ட் பண்பு உருவாக்கு" +"Create components, styles or variables to publish them as a library." = "லைப்ரரியாக வெளியிட காம்போனென்ட்கள், ஸ்டைல்கள் அல்லது வேரியபிள்களை உருவாக்கவும்." +"Create from color" = "நிறத்திலிருந்து உருவாக்கு" +"Create property…" = "பண்பு உருவாக்கு…" +"Create style" = "ஸ்டைல் உருவாக்கு" +"Create style from the selected text" = "தேர்ந்தெடுத்த உரையிலிருந்து ஸ்டைல் உருவாக்கு" +"Created" = "உருவாக்கப்பட்டது" +"Crop" = "செதுக்கு" +"Crop image" = "படத்தைச் செதுக்கு" +"Crop marks" = "செதுக்கல் குறிகள்" +"Ctrl+Alt+← ↑ → ↓" = "Ctrl+Alt+← ↑ → ↓" +"Ctrl+arrows" = "Ctrl+அம்புகள்" +"Ctrl+click" = "Ctrl+கிளிக்" +"Ctrl+click a padding field" = "ஒரு பேடிங் புலத்தை Ctrl+கிளிக் செய்யவும்" +"Ctrl+scroll" = "Ctrl+ஸ்க்ரோல்" +"Current name" = "தற்போதைய பெயர்" +"Current version" = "தற்போதைய பதிப்பு" +"Cursor chat" = "கர்சர் அரட்டை" +"Curved" = "வளைவு" +"Custom" = "தனிப்பயன்" +"Custom size" = "தனிப்பயன் அளவு" +"Cut" = "வெட்டு" +"Dark" = "இருண்ட" +"Darken" = "கருமையாக்கு" +"Dart constants for Flutter…" = "Flutter க்கான Dart மாறிலிகள்…" +"Dash" = "கோடு" +"Dash cap" = "கோட்டு முனை" +"Dashboard" = "டாஷ்போர்டு" +"Dashes" = "கோடுகள்" +"Dashes take numbers separated by commas" = "கோடுகளுக்கு காற்புள்ளியால் பிரிக்கப்பட்ட எண்கள் தேவை" +"Database" = "தரவுத்தளம்" +"Date created" = "உருவாக்கிய தேதி" +"Dec" = "டிச" +"Decoration" = "அலங்காரம்" +"Decoration style" = "அலங்கார ஸ்டைல்" +"Deep select" = "ஆழமான தேர்வு" +"Default" = "இயல்புநிலை" +"Default content" = "இயல்புநிலை உள்ளடக்கம்" +"Default value (the top-left variant)" = "இயல்புநிலை மதிப்பு (மேல்-இடது வேரியன்ட்)" +"Delay" = "தாமதம்" +"Delete" = "நீக்கு" +"Delete category (its annotations stay)" = "வகையை நீக்கு (அதன் குறிப்புரைகள் இருக்கும்)" +"Delete collection" = "தொகுப்பை நீக்கு" +"Delete group" = "குழுவை நீக்கு" +"Delete mode" = "மோடை நீக்கு" +"Delete page" = "பக்கத்தை நீக்கு" +"Delete preset" = "முன்னமைவை நீக்கு" +"Delete property" = "பண்பை நீக்கு" +"Delete results" = "முடிவுகளை நீக்கு" +"Delete the style (layers keep their values)" = "ஸ்டைலை நீக்கு (லேயர்கள் அவற்றின் மதிப்புகளை வைத்திருக்கும்)" +"Delete thread" = "இழையை நீக்கு" +"Delete variable" = "வேரியபிளை நீக்கு" +"Delete {n} variables" = { one = "{n} வேரியபிளை நீக்கு", other = "{n} வேரியபிள்களை நீக்கு" } +"Delete “{name}”? This can't be undone." = "“{name}” ஐ நீக்கவா? இதைச் செயல்தவிர்க்க முடியாது." +"Density" = "அடர்த்தி" +"Depth" = "ஆழம்" +"Describe how and when to use this component" = "இந்த காம்போனென்ட்டை எப்படி, எப்போது பயன்படுத்துவது என்று விவரிக்கவும்" +"Describe what changed" = "என்ன மாறியது என்று விவரிக்கவும்" +"Description" = "விளக்கம்" +"Description (optional)" = "விளக்கம் (விருப்பத்தேர்வு)" +"Design" = "டிசைன்" +"Design panel" = "டிசைன் பேனல்" +"Design system starter" = "வடிவமைப்பு அமைப்புத் தொடக்கம்" +"Desktop" = "டெஸ்க்டாப்" +"Destination" = "சேருமிடம்" +"Detach alias" = "மாற்றுப்பெயரைப் பிரி" +"Detach calculation" = "கணக்கீட்டைப் பிரி" +"Detach instance" = "இன்ஸ்டன்ஸைப் பிரி" +"Detach property" = "பண்பைப் பிரி" +"Detach style" = "ஸ்டைலைப் பிரி" +"Detach styles" = "ஸ்டைல்களைப் பிரி" +"Detach variable" = "வேரியபிளைப் பிரி" +"Details" = "விவரங்கள்" +"Dev resources" = "டெவ் ஆதாரங்கள்" +"Developer Mode" = "டெவலப்பர் மோட்" +"Developer Mode only inspects: switch to Design (Shift+D) to edit" = "டெவலப்பர் மோட் ஆய்வு மட்டுமே செய்யும்: திருத்த வடிவமைப்புக்கு மாறவும் (Shift+D)" +"Development" = "மேம்பாடு" +"Device" = "சாதனம்" +"Device at 100%" = "சாதனம் 100% அளவில்" +"Diamond" = "வைரம்" +"Difference" = "வேறுபாடு" +"Dimensions" = "பரிமாணங்கள்" +"Direction" = "திசை" +"Disconnect from code" = "குறியீட்டிலிருந்து துண்டி" +"Disconnected. Reconnecting…" = "இணைப்பு துண்டிக்கப்பட்டது. மீண்டும் இணைக்கிறது…" +"Disconnected. Your edits stay here and sync when the connection returns. Reconnecting…" = "இணைப்பு துண்டிக்கப்பட்டது. உங்கள் திருத்தங்கள் இங்கேயே இருக்கும், இணைப்பு திரும்பியதும் ஒத்திசைக்கப்படும். மீண்டும் இணைக்கிறது…" +"Dismiss" = "நிராகரி" +"Dispersion" = "சிதறல்" +"Display name" = "காட்சிப் பெயர்" +"Dissolve" = "கரை" +"Distribute and tidy" = "பகிர்ந்து ஒழுங்குபடுத்து" +"Distribute horizontal spacing" = "கிடைமட்ட இடைவெளியைப் பகிர்" +"Distribute vertical spacing" = "செங்குத்து இடைவெளியைப் பகிர்" +"Divider" = "பிரிகோடு" +"Document" = "ஆவணம்" +"Don't Save" = "சேமிக்க வேண்டாம்" +"Don't show this again" = "இதை மீண்டும் காட்ட வேண்டாம்" +"Don't truncate" = "சுருக்க வேண்டாம்" +"Done" = "முடிந்தது" +"Done editing" = "திருத்தி முடி" +"Dots" = "புள்ளிகள்" +"Dotted" = "புள்ளிக்கோடு" +"Double-click an edge of an auto layout frame" = "ஆட்டோ லேஅவுட் ஃப்ரேமின் ஓரத்தை இருமுறை கிளிக் செய்யவும்" +"Down" = "கீழே" +"Download" = "பதிவிறக்கு" +"Downloading… {percent}%" = "பதிவிறக்குகிறது… {percent}%" +"Drafts" = "வரைவுகள்" +"Drag the stroke to add a width point" = "அகலப் புள்ளியைச் சேர்க்க ஸ்ட்ரோக்கை இழுக்கவும்" +"Draw" = "வரை" +"Draw a frame" = "ஃப்ரேம் வரை" +"Drawing tools" = "வரைதல் கருவிகள்" +"Drop a .figcraft, .fig, .jam, .sketch, .json, .svg or image file." = ".figcraft, .fig, .jam, .sketch, .json, .svg அல்லது படக் கோப்பை இங்கே விடவும்." +"Drop shadow" = "டிராப் ஷேடோ" +"Drop to import" = "இறக்குமதி செய்ய விடவும்" +"Drop to open" = "திறக்க விடவும்" +"Drop to use this image" = "இந்தப் படத்தைப் பயன்படுத்த விடவும்" +"Dual-licensed MIT OR Apache-2.0. Made by the ArtCraft team and community." = "MIT அல்லது Apache-2.0 இரட்டை உரிமம். ArtCraft குழுவும் சமூகமும் உருவாக்கியது." +"Duo" = "இரட்டை" +"Duplicate" = "நகல்செய்" +"Duplicate by dragging" = "இழுத்து நகலெடு" +"Duplicate mode" = "நகல் மோட்" +"Duplicate page" = "பக்கத்தை நகல்செய்" +"Edit" = "திருத்து" +"Edit as an expression" = "எக்ஸ்பிரஷனாகத் திருத்து" +"Edit colour" = "நிறத்தைத் திருத்து" +"Edit comment" = "கருத்தைத் திருத்து" +"Edit dev resource" = "டெவ் ஆதாரத்தைத் திருத்து" +"Edit link" = "திருத்த இணைப்பு" +"Edit link copied" = "திருத்த இணைப்பு நகலெடுக்கப்பட்டது" +"Edit padding on all sides" = "எல்லாப் பக்கங்களிலும் பேடிங்கைத் திருத்து" +"Edit style" = "ஸ்டைலைத் திருத்து" +"Edit variable" = "வேரியபிளைத் திருத்து" +"Edit with the builder" = "பில்டரில் திருத்து" +"Edited {when}" = "{when} திருத்தப்பட்டது" +"Effect settings" = "எஃபெக்ட் அமைப்புகள்" +"Effect styles" = "எஃபெக்ட் ஸ்டைல்கள்" +"Effects" = "எஃபெக்ட்கள்" +"Elbow" = "செங்கோணம்" +"Ellipse" = "நீள்வட்டம்" +"Ellipses" = "நீள்வட்டங்கள்" +"Else" = "இல்லையெனில்" +"Else if" = "இல்லையெனில் என்றால்" +"Embedded profile" = "உட்பொதிந்த சுயவிவரம்" +"Empty" = "காலி" +"End" = "முடிவு" +"End point" = "முடிவுப் புள்ளி" +"End vote" = "வாக்கெடுப்பை முடி" +"Ends the session; everyone keeps their copy" = "அமர்வை முடிக்கும்; ஒவ்வொருவரும் தங்கள் நகலை வைத்திருப்பார்கள்" +"Enter" = "Enter" +"Enter / Shift+Enter" = "Enter / Shift+Enter" +"Enter the address of a figcraft-server and press Browse to see the plugins it offers." = "figcraft-server முகவரியை உள்ளிட்டு, அது வழங்கும் ப்ளகின்களைக் காண உலாவவும்." +"Enter to save · Esc to cancel" = "சேமிக்க Enter · ரத்துசெய்ய Esc" +"Eraser" = "அழிப்பான்" +"Esc" = "Esc" +"Essential" = "அத்தியாவசியம்" +"Every conflict has a choice." = "ஒவ்வொரு முரண்பாட்டுக்கும் ஒரு தேர்வு உள்ளது." +"Every top-level frame already starts a flow" = "ஒவ்வொரு மேல்நிலை ஃப்ரேமும் ஏற்கனவே ஒரு ஃப்ளோவைத் தொடங்குகிறது" +"Everyone who reaches this server can open these files while they are shared." = "இந்தச் சர்வரை அணுகும் எவரும் இந்தக் கோப்புகள் பகிரப்பட்டிருக்கும்வரை அவற்றைத் திறக்கலாம்." +"Exact only" = "சரியானவை மட்டும்" +"Exact opacity (4 then 5: 45%)" = "சரியான ஒளிபுகாமை (4 பிறகு 5: 45%)" +"Exclude" = "விலக்கு" +"Excluded" = "விலக்கப்பட்டது" +"Excluded from layout" = "லேஅவுட்டிலிருந்து விலக்கப்பட்டது" +"Excludes" = "விலக்குகிறது" +"Exclusion" = "விலக்கல்" +"Exit focus view (Esc)" = "ஃபோகஸ் காட்சியிலிருந்து வெளியேறு (Esc)" +"Expand" = "விரி" +"Expand the interface" = "இடைமுகத்தை விரி" +"Export" = "ஏற்றுமதி" +"Export all" = "அனைத்தையும் ஏற்றுமதி செய்" +"Export frames and layers as PNG, JPG, SVG or PDF" = "ஃப்ரேம்களையும் லேயர்களையும் PNG, JPG, SVG அல்லது PDF ஆக ஏற்றுமதி செய்" +"Export page as PNG" = "பக்கத்தை PNG ஆக ஏற்றுமதி செய்" +"Export settings" = "ஏற்றுமதி அமைப்புகள்" +"Export variables" = "வேரியபிள்களை ஏற்றுமதி செய்" +"Export {name}" = "{name} ஐ ஏற்றுமதி செய்" +"Export {n} layers" = { one = "{n} லேயரை ஏற்றுமதி செய்", other = "{n} லேயர்களை ஏற்றுமதி செய்" } +"Exported {file}" = "{file} ஏற்றுமதி செய்யப்பட்டது" +"Exported {name}" = "{name} ஏற்றுமதி செய்யப்பட்டது" +"Exported {name}; {n} kinds of content were changed or left out" = { one = "{name} ஏற்றுமதி செய்யப்பட்டது; {n} வகை உள்ளடக்கம் மாற்றப்பட்டது அல்லது விடுபட்டது", other = "{name} ஏற்றுமதி செய்யப்பட்டது; {n} வகை உள்ளடக்கங்கள் மாற்றப்பட்டன அல்லது விடுபட்டன" } +"Exported {name}; {n} kinds of content were left out" = { one = "{name} ஏற்றுமதி செய்யப்பட்டது; {n} வகை உள்ளடக்கம் விடுபட்டது", other = "{name} ஏற்றுமதி செய்யப்பட்டது; {n} வகை உள்ளடக்கங்கள் விடுபட்டன" } +"Exported {n} files" = { one = "{n} கோப்பு ஏற்றுமதி செய்யப்பட்டது", other = "{n} கோப்புகள் ஏற்றுமதி செய்யப்பட்டன" } +"Exported {n} files; some content was changed or left out" = { one = "{n} கோப்பு ஏற்றுமதி செய்யப்பட்டது; சில உள்ளடக்கம் மாற்றப்பட்டது அல்லது விடுபட்டது", other = "{n} கோப்புகள் ஏற்றுமதி செய்யப்பட்டன; சில உள்ளடக்கம் மாற்றப்பட்டது அல்லது விடுபட்டது" } +"Export…" = "ஏற்றுமதி…" +"Expose properties to instances" = "பண்புகளை இன்ஸ்டன்ஸ்களுக்குக் காட்டு" +"Exposure" = "எக்ஸ்போஷர்" +"Expression" = "எக்ஸ்பிரஷன்" +"Extend collection" = "தொகுப்பை நீட்டு" +"Extends \"{name}\": overridden values are marked" = "\"{name}\" ஐ நீட்டிக்கிறது: மாற்றியமைத்த மதிப்புகள் குறிக்கப்பட்டுள்ளன" +"Eye" = "கண்" +"F" = "F" +"Fade" = "மங்கல்" +"False" = "தவறு" +"Feb" = "பிப்" +"Fetching from the server…" = "சர்வரிலிருந்து பெறுகிறது…" +"FigCraft couldn't open its window: {error}" = "FigCraft அதன் சாளரத்தைத் திறக்க முடியவில்லை: {error}" +"FigCraft doesn't support every feature of these files yet. The notes list what was left out or changed in the imported copy; the original file is unchanged." = "இந்தக் கோப்புகளின் எல்லா அம்சங்களையும் FigCraft இன்னும் ஆதரிக்கவில்லை. இறக்குமதி செய்த நகலில் விடுபட்டவை அல்லது மாற்றப்பட்டவை குறிப்புகளில் உள்ளன; அசல் கோப்பு மாறவில்லை." +"FigCraft stopped because of an internal error." = "உள் பிழை காரணமாக FigCraft நின்றுவிட்டது." +"FigCraft tried {apis}, then again with lower requirements on the power-saving GPU. Updating the graphics driver often helps." = "FigCraft {apis} ஐ முயன்றது, பின்னர் மின்சேமிப்பு GPU இல் குறைந்த தேவைகளுடன் மீண்டும் முயன்றது. கிராஃபிக்ஸ் டிரைவரைப் புதுப்பிப்பது பெரும்பாலும் உதவும்." +"File" = "கோப்பு" +"File name" = "கோப்புப் பெயர்" +"File not found" = "கோப்பு கிடைக்கவில்லை" +"File published" = "கோப்பு வெளியிடப்பட்டது" +"Files aren't end-to-end encrypted: the server's operator can read them." = "கோப்புகள் முழுமையாக மறையாக்கம் செய்யப்படவில்லை: சர்வர் இயக்குநர் அவற்றைப் படிக்க முடியும்." +"Files nobody opens for {n} days are deleted." = { one = "{n} நாள் யாரும் திறக்காத கோப்புகள் நீக்கப்படும்.", other = "{n} நாட்கள் யாரும் திறக்காத கோப்புகள் நீக்கப்படும்." } +"Fill" = "ஃபில்" +"Fill (fr)" = "ஃபில் (fr)" +"Fill container" = "கண்டெய்னரை நிரப்பு" +"Fill window" = "சாளரத்தை நிரப்பு" +"Fills" = "ஃபில்கள்" +"Fill|sizing" = "நிரப்பு" +"Filter and sort" = "வடிகட்டி வரிசைப்படுத்து" +"Find" = "தேடு" +"Find and replace" = "தேடி மாற்று" +"Find layers" = "லேயர்களைத் தேடு" +"First" = "முதல்" +"First commit" = "முதல் கமிட்" +"First on top" = "முதலாவது மேலே" +"Fit" = "பொருத்து" +"Fit device to window" = "சாதனத்தைச் சாளரத்துக்குப் பொருத்து" +"Fit to contents" = "உள்ளடக்கத்துக்குப் பொருத்து" +"Fit to window" = "சாளரத்துக்குப் பொருத்து" +"Fit width" = "அகலத்துக்குப் பொருத்து" +"Fixed" = "நிலையானது" +"Fixed gap" = "நிலையான இடைவெளி" +"Fixed size" = "நிலையான அளவு" +"Flatten" = "தட்டையாக்கு" +"Flip" = "புரட்டு" +"Flip horizontal" = "கிடைமட்டமாகப் புரட்டு" +"Flip text to the other side" = "உரையை மறுபக்கத்துக்குப் புரட்டு" +"Flip vertical" = "செங்குத்தாகப் புரட்டு" +"Flip width profile" = "அகல சுயவிவரத்தைப் புரட்டு" +"Flow chart" = "ஃப்ளோ சார்ட்" +"Flow starting point" = "ஃப்ளோ தொடக்கப் புள்ளி" +"Flow starting points" = "ஃப்ளோ தொடக்கப் புள்ளிகள்" +"Flows" = "ஃப்ளோக்கள்" +"Focus view" = "ஃபோகஸ் காட்சி" +"Fold autosaves" = "தானியங்கு சேமிப்புகளைச் சுருக்கு" +"Folder: click to collapse" = "கோப்புறை: சுருக்க கிளிக் செய்யவும்" +"Folder: click to expand" = "கோப்புறை: விரிக்க கிளிக் செய்யவும்" +"Follow" = "பின்தொடர்" +"Follow {name}" = "{name} ஐப் பின்தொடர்" +"Following" = "பின்தொடர்கிறீர்கள்" +"Following {name} · {key} to stop" = "{name} ஐப் பின்தொடர்கிறீர்கள் · நிறுத்த {key}" +"Font" = "எழுத்துரு" +"Font not installed" = "எழுத்துரு நிறுவப்படவில்லை" +"Font size" = "எழுத்துரு அளவு" +"Font style" = "எழுத்துரு ஸ்டைல்" +"Forget on this computer" = "இந்தக் கணினியில் மறந்துவிடு" +"Format" = "வடிவம்" +"Four screens of a trail app with components and a prototype flow" = "காம்போனென்ட்களும் ப்ரோட்டோடைப் ஃப்ளோவும் கொண்ட மலையேற்ற ஆப்பின் நான்கு திரைகள்" +"Fractions" = "பின்னங்கள்" +"Frame" = "ஃப்ரேம்" +"Frame selection" = "தேர்வை ஃப்ரேம் செய்" +"Frame tools" = "ஃப்ரேம் கருவிகள்" +"Frames" = "ஃப்ரேம்கள்" +"Free fonts come from Google Fonts and Noto, through jsDelivr and GitHub. Each file is checked against the font index before it is installed into the font folder the Craft apps share. Nothing is downloaded until you allow it." = "இலவச எழுத்துருக்கள் Google Fonts, Noto ஆகியவற்றிலிருந்து jsDelivr, GitHub வழியாக வருகின்றன. Craft ஆப்கள் பகிரும் எழுத்துருக் கோப்புறையில் நிறுவும் முன் ஒவ்வொரு கோப்பும் எழுத்துரு அட்டவணையுடன் சரிபார்க்கப்படும். நீங்கள் அனுமதிக்கும்வரை எதுவும் பதிவிறக்கப்படாது." +"From the library \"{name}\": read-only" = "\"{name}\" லைப்ரரியிலிருந்து: படிக்க மட்டும்" +"From {name}" = "{name} இலிருந்து" +"From {server}" = "{server} இலிருந்து" +"Frost" = "பனிமூட்டம்" +"Gap" = "இடைவெளி" +"Gap between columns" = "நெடுவரிசைகளுக்கு இடையிலான இடைவெளி" +"Gap between items" = "உருப்படிகளுக்கு இடையிலான இடைவெளி" +"Gap between rows" = "வரிசைகளுக்கு இடையிலான இடைவெளி" +"Getting started" = "தொடங்குதல்" +"Give the address of a server open to the public, or a server's address with its key (`figcraft-server key` prints it)." = "பொதுமக்களுக்குத் திறந்த சர்வரின் முகவரியை, அல்லது சர்வரின் முகவரியை அதன் கீயுடன் தரவும் (`figcraft-server key` அதை அச்சிடும்)." +"Glass" = "கண்ணாடி" +"Go to main component" = "முதன்மை காம்போனென்ட்டுக்குச் செல்" +"Go to {name}" = "{name} க்குச் செல்" +"Grab bag" = "கலவைப் பை" +"Gradient" = "கிரேடியன்ட்" +"Graph paper" = "வரைபடத் தாள்" +"Gray" = "சாம்பல்" +"Green" = "பச்சை" +"Greyscale components and two example screens to sketch a flow with" = "ஃப்ளோவை வரைய சாம்பல்நிற காம்போனென்ட்களும் இரண்டு மாதிரித் திரைகளும்" +"Grid" = "கட்டம்" +"Grid ({size})" = "கட்டம் ({size})" +"Grid styles" = "கட்ட ஸ்டைல்கள்" +"Grid {size}" = "கட்டம் {size}" +"Group" = "குழு" +"Group selection" = "தேர்வைக் குழுவாக்கு" +"Groups" = "குழுக்கள்" +"Gutter" = "கட்டர்" +"Hand tool" = "கைக் கருவி" +"Hanging list" = "தொங்கும் பட்டியல்" +"Hanging punctuation" = "தொங்கும் நிறுத்தக்குறிகள்" +"Hard light" = "கடின ஒளி" +"Heart" = "இதயம்" +"Height" = "உயரம்" +"Help" = "உதவி" +"Help and resources" = "உதவியும் ஆதாரங்களும்" +"Help page" = "உதவிப் பக்கம்" +"Here: {names}" = "இங்கே: {names}" +"Hexagon" = "அறுகோணம்" +"Hidden" = "மறைக்கப்பட்டது" +"Hide UI" = "UI ஐ மறை" +"Hide contents" = "உள்ளடக்கத்தை மறை" +"Hide from publishing" = "வெளியீட்டிலிருந்து மறை" +"Hide section contents" = "செக்ஷன் உள்ளடக்கத்தை மறை" +"Hide these tips (Getting started in the Help menu shows them again)" = "இந்தக் குறிப்புகளை மறை (உதவி மெனுவில் உள்ள தொடங்குதல் அவற்றை மீண்டும் காட்டும்)" +"Hide when publishing" = "வெளியிடும்போது மறை" +"Highlight layers on hover" = "ஹோவர் செய்யும்போது லேயர்களை முன்னிலைப்படுத்து" +"Highlighter" = "ஹைலைட்டர்" +"Highlights" = "ஒளிப்பகுதிகள்" +"Hold Alt" = "Alt ஐ அழுத்திப் பிடிக்கவும்" +"Hold Alt+Z" = "Alt+Z ஐ அழுத்திப் பிடிக்கவும்" +"Hold Ctrl" = "Ctrl ஐ அழுத்திப் பிடிக்கவும்" +"Hold Z" = "Z ஐ அழுத்திப் பிடிக்கவும்" +"Hold ⌃ or ⌘" = "⌃ அல்லது ⌘ ஐ அழுத்திப் பிடிக்கவும்" +"Hold ⌥" = "⌥ ஐ அழுத்திப் பிடிக்கவும்" +"Hold ⌥Z" = "⌥Z ஐ அழுத்திப் பிடிக்கவும்" +"Home" = "முகப்பு" +"Horizontal" = "கிடைமட்டம்" +"Horizontal align" = "கிடைமட்ட சீரமைப்பு" +"Horizontal hex" = "கிடைமட்ட அறுகோணம்" +"Horizontal padding" = "கிடைமட்ட பேடிங்" +"Horizontal spacing" = "கிடைமட்ட இடைவெளி" +"Hosted by {operator}" = "{operator} வழங்குகிறது" +"Hover a layer to see its properties" = "பண்புகளைக் காண ஒரு லேயர் மீது ஹோவர் செய்யவும்" +"Hover other layers to measure the distance" = "தூரத்தை அளக்க மற்ற லேயர்கள் மீது ஹோவர் செய்யவும்" +"Hue" = "சாயல்" +"Hug" = "ஹக்" +"Hug contents" = "உள்ளடக்கத்தை ஹக் செய்" +"Icon components on a 24 px grid with keylines and a size preview" = "கீலைன்களும் அளவு முன்னோட்டமும் கொண்ட 24 px கட்டத்தில் ஐகான் காம்போனென்ட்கள்" +"Icon set starter" = "ஐகான் தொகுப்புத் தொடக்கம்" +"If" = "என்றால்" +"If it keeps happening, please report it at {link} with this message." = "இது தொடர்ந்து நடந்தால், இந்தச் செய்தியுடன் {link} இல் புகாரளிக்கவும்." +"If {condition}" = "{condition} என்றால்" +"Ignore auto layout (absolute position)" = "ஆட்டோ லேஅவுட்டைப் புறக்கணி (முழுமையான நிலை)" +"Ignore overlapping layers" = "மேற்பொருந்தும் லேயர்களைப் புறக்கணி" +"Ignore unsupported" = "ஆதரிக்கப்படாதவற்றைப் புறக்கணி" +"Image" = "படம்" +"Images" = "படங்கள்" +"Import" = "இறக்குமதி" +"Import path" = "இறக்குமதிப் பாதை" +"Import plugin from manifest" = "மேனிஃபெஸ்டிலிருந்து ப்ளகினை இறக்குமதி செய்" +"Import plugin from manifest…" = "மேனிஃபெஸ்டிலிருந்து ப்ளகினை இறக்குமதி செய்…" +"Import report" = "இறக்குமதி அறிக்கை" +"Import variables" = "வேரியபிள்களை இறக்குமதி செய்" +"Imported document" = "இறக்குமதி செய்த ஆவணம்" +"Imported {name}" = "{name} இறக்குமதி செய்யப்பட்டது" +"Imported {n} new variables, updated {updated}" = { one = "{n} புதிய வேரியபிள் இறக்குமதி செய்யப்பட்டது, {updated} புதுப்பிக்கப்பட்டது", other = "{n} புதிய வேரியபிள்கள் இறக்குமதி செய்யப்பட்டன, {updated} புதுப்பிக்கப்பட்டன" } +"Import…" = "இறக்குமதி…" +"In an instance, this comes from the main component" = "இன்ஸ்டன்ஸில், இது முதன்மை காம்போனென்ட்டிலிருந்து வருகிறது" +"In the browser you can join sessions the desktop app hosts and files on a FigCraft server. A page opened over https reaches other computers only through wss:// links (a server behind TLS)." = "உலாவியில், டெஸ்க்டாப் ஆப் நடத்தும் அமர்வுகளிலும் FigCraft சர்வரில் உள்ள கோப்புகளிலும் சேரலாம். https வழியாகத் திறந்த பக்கம் wss:// இணைப்புகள் (TLS பின்னால் உள்ள சர்வர்) மூலம் மட்டுமே பிற கணினிகளை அடையும்." +"Include bounding box" = "எல்லைப் பெட்டியைச் சேர்" +"Include id attribute" = "id பண்புக்கூறைச் சேர்" +"Included" = "சேர்க்கப்பட்டது" +"Included in layout" = "லேஅவுட்டில் சேர்க்கப்பட்டது" +"Individual corners" = "தனித்தனி மூலைகள்" +"Individual padding" = "தனித்தனி பேடிங்" +"Individual strokes" = "தனித்தனி ஸ்ட்ரோக்குகள்" +"Ink" = "மை" +"Inner shadow" = "உள் நிழல்" +"Inside" = "உள்ளே" +"Inspect" = "ஆய்வு செய்" +"Inspect the layer under the pointer: size, colours, typography" = "சுட்டியின் கீழ் உள்ள லேயரை ஆய்வு செய்: அளவு, நிறங்கள், அச்சுக்கலை" +"Install" = "நிறுவு" +"Install plugin" = "ப்ளகினை நிறுவு" +"Installed" = "நிறுவப்பட்டது" +"Installed {name}" = "{name} நிறுவப்பட்டது" +"Installing…" = "நிறுவுகிறது…" +"Instance" = "இன்ஸ்டன்ஸ்" +"Instance properties" = "இன்ஸ்டன்ஸ் பண்புகள்" +"Instance swap" = "இன்ஸ்டன்ஸ் மாற்று" +"Instance swap (no other component)" = "இன்ஸ்டன்ஸ் மாற்று (வேறு காம்போனென்ட் இல்லை)" +"Instances" = "இன்ஸ்டன்ஸ்கள்" +"Instant" = "உடனடி" +"Intensity" = "தீவிரம்" +"Interaction" = "இன்டராக்ஷன்" +"Interactions" = "இன்டராக்ஷன்கள்" +"Interface design and prototyping. A free, open-source, clean-room design tool written from scratch in Rust, part of the ArtCraft Crafting Apps." = "இடைமுக வடிவமைப்பும் ப்ரோட்டோடைப்பிங்கும். Rust இல் புதிதாக எழுதப்பட்ட, இலவச, திறந்த மூல, கிளீன்-ரூம் வடிவமைப்புக் கருவி; ArtCraft Crafting Apps இன் ஒரு பகுதி." +"Interface size" = "இடைமுக அளவு" +"Internal storage" = "உள் சேமிப்பகம்" +"Intersect" = "குறுக்கிடு" +"Intersects" = "குறுக்கிடுகிறது" +"Invalid color" = "தவறான நிறம்" +"Invite link" = "அழைப்பு இணைப்பு" +"Invite link copied" = "அழைப்பு இணைப்பு நகலெடுக்கப்பட்டது" +"It asks permission to:" = "இது இவற்றுக்கு அனுமதி கேட்கிறது:" +"Jan" = "ஜன" +"Join" = "சேர்" +"Join code copied" = "சேரும் குறியீடு நகலெடுக்கப்பட்டது" +"Join code or invite link" = "சேரும் குறியீடு அல்லது அழைப்பு இணைப்பு" +"Join live session" = "நேரலை அமர்வில் சேர்" +"Join us on Discord" = "Discord இல் எங்களுடன் சேரவும்" +"Join with a code" = "குறியீட்டுடன் சேர்" +"Joined" = "சேர்ந்தது" +"Joined {file}" = "{file} இல் சேர்ந்தது" +"Joining live session…" = "நேரலை அமர்வில் சேர்கிறது…" +"Joining…" = "சேர்கிறது…" +"Join|stroke" = "இணைப்பு" +"Jul" = "ஜூலை" +"Jun" = "ஜூன்" +"Just now" = "இப்போதுதான்" +"Justify" = "இருபுறச் சீரமை" +"Kanban board" = "கான்பன் பலகை" +"Keep a measurement on the canvas for developers" = "டெவலப்பர்களுக்காக அளவீட்டைக் கேன்வாஸில் வை" +"Keep appearance" = "தோற்றத்தை வை" +"Keep appearance converts every color value to {profile} so colors look the same. Keep values leaves the numbers as they are, so colors shift." = "தோற்றத்தை வை என்பது நிறங்கள் ஒரே மாதிரி தெரிய ஒவ்வொரு நிற மதிப்பையும் {profile} ஆக மாற்றும். மதிப்புகளை வை என்பது எண்களை அப்படியே விடும், அதனால் நிறங்கள் மாறும்." +"Keep tool selected after use" = "பயன்படுத்திய பின் கருவியைத் தேர்விலேயே வை" +"Keep values" = "மதிப்புகளை வை" +"Key/Gamepad" = "விசை/கேம்பேட்" +"Key/Gamepad {key}" = "விசை/கேம்பேட் {key}" +"Keyboard shortcuts" = "விசைப்பலகை குறுக்குவழிகள்" +"Kits" = "கிட்கள்" +"Landing page" = "லேண்டிங் பக்கம்" +"Language" = "மொழி" +"Lasso" = "லாசோ" +"Last" = "கடைசி" +"Last change: {note}" = "கடைசி மாற்றம்: {note}" +"Last commit" = "கடைசி கமிட்" +"Last modified" = "கடைசியாக மாற்றியது" +"Last on top" = "கடைசியானது மேலே" +"Layer blur" = "லேயர் மங்கல்" +"Layer name" = "லேயர் பெயர்" +"Layers" = "லேயர்கள்" +"Layers in an instance take their position from the main component" = "இன்ஸ்டன்ஸில் உள்ள லேயர்கள் முதன்மை காம்போனென்ட்டிலிருந்து நிலையைப் பெறுகின்றன" +"Layout" = "லேஅவுட்" +"Layout grid" = "லேஅவுட் கட்டம்" +"Layout grid settings" = "லேஅவுட் கட்ட அமைப்புகள்" +"Layout grids" = "லேஅவுட் கட்டங்கள்" +"Leave session" = "அமர்விலிருந்து வெளியேறு" +"Leaves" = "இலைகள்" +"Leaving the prototype" = "ப்ரோட்டோடைப்பிலிருந்து வெளியேறுகிறது" +"Left" = "இடது" +"Left & right" = "இடது & வலது" +"Left padding" = "இடது பேடிங்" +"Left side" = "இடது பக்கம்" +"Left side width" = "இடது பக்க அகலம்" +"Left to right" = "இடமிருந்து வலம்" +"Letter case" = "எழுத்து வடிவு" +"Letter spacing" = "எழுத்து இடைவெளி" +"Libraries" = "லைப்ரரிகள்" +"Libraries in this file" = "இந்தக் கோப்பில் உள்ள லைப்ரரிகள்" +"Library updates available" = "லைப்ரரி புதுப்பிப்புகள் உள்ளன" +"Library: click to collapse" = "லைப்ரரி: சுருக்க கிளிக் செய்யவும்" +"Library: click to expand" = "லைப்ரரி: விரிக்க கிளிக் செய்யவும்" +"Library: its variables are read-only here; edit them in the library file and publish it" = "லைப்ரரி: இதன் வேரியபிள்களை இங்கே படிக்க மட்டுமே முடியும்; லைப்ரரி கோப்பில் திருத்தி வெளியிடவும்" +"Light" = "ஒளிர்வான" +"Lighten" = "ஒளிரச்செய்" +"Light|glass" = "ஒளி" +"Line" = "கோடு" +"Line arrow" = "கோட்டு அம்பு" +"Line delta" = "வரி மாற்றம்" +"Line height" = "வரி உயரம்" +"Linear" = "நேரியல்" +"Lines" = "வரிகள்" +"Lines +/−" = "வரிகள் +/−" +"Lines added" = "சேர்த்த வரிகள்" +"Lines deleted" = "நீக்கிய வரிகள்" +"Link" = "இணைப்பு" +"Link copied" = "இணைப்பு நகலெடுக்கப்பட்டது" +"Link copied: it opens the file in FigCraft" = "இணைப்பு நகலெடுக்கப்பட்டது: இது கோப்பை FigCraft இல் திறக்கும்" +"Link copied: it opens the file in the browser" = "இணைப்பு நகலெடுக்கப்பட்டது: இது கோப்பை உலாவியில் திறக்கும்" +"Link docs, code or tickets for developers." = "டெவலப்பர்களுக்காக ஆவணங்கள், குறியீடு அல்லது டிக்கெட்டுகளை இணைக்கவும்." +"Link frames on the Prototype tab, then present the flow" = "ப்ரோட்டோடைப் தாவலில் ஃப்ரேம்களை இணைத்து, பின் ஃப்ளோவை வழங்கவும்" +"Link this component to its code component: instances then show your real snippet with their values." = "இந்த காம்போனென்ட்டை அதன் குறியீட்டு காம்போனென்ட்டுடன் இணைக்கவும்: பின் இன்ஸ்டன்ஸ்கள் உங்கள் உண்மையான ஸ்னிப்பெட்டை அவற்றின் மதிப்புகளுடன் காட்டும்." +"List spacing" = "பட்டியல் இடைவெளி" +"List style" = "பட்டியல் ஸ்டைல்" +"Live session" = "நேரலை அமர்வு" +"Live · {people}" = "நேரலை · {people}" +"Local components" = "லோக்கல் காம்போனென்ட்கள்" +"Local network" = "லோக்கல் நெட்வொர்க்" +"Local styles" = "லோக்கல் ஸ்டைல்கள்" +"Local variables" = "லோக்கல் வேரியபிள்கள்" +"Lock/Unlock" = "பூட்டு/திற" +"Locked" = "பூட்டப்பட்டது" +"Lowercase" = "சிற்றெழுத்து" +"Luminance" = "ஒளிர்வு" +"Luminosity" = "ஒளிர்மை" +"Main" = "முதன்மை" +"Main component deleted" = "முதன்மை காம்போனென்ட் நீக்கப்பட்டது" +"Main menu" = "முதன்மை மெனு" +"Make a component" = "காம்போனென்ட் உருவாக்கு" +"Make slot" = "ஸ்லாட் உருவாக்கு" +"Manual input" = "கைமுறை உள்ளீடு" +"Mar" = "மார்" +"Margin" = "ஓரம்" +"Mark all as read" = "அனைத்தையும் படித்ததாகக் குறி" +"Mark as resolved" = "தீர்க்கப்பட்டதாகக் குறி" +"Mark as unread" = "படிக்காததாகக் குறி" +"Mark as unresolved" = "தீர்க்கப்படாததாகக் குறி" +"Marker" = "மார்க்கர்" +"Mask" = "மாஸ்க்" +"Mass · Stiffness · Damping" = "நிறை · விறைப்பு · தணிப்பு" +"Match (empty: the whole name)" = "பொருத்து (காலி: முழுப் பெயர்)" +"Max H" = "அதி. உ" +"Max W" = "அதி. அ" +"Max lines" = "அதிகபட்ச வரிகள்" +"Maximize" = "அதிகபட்சமாக்கு" +"May" = "மே" +"Measure to the selection" = "தேர்வு வரை அளவிடு" +"Measurements" = "அளவீடுகள்" +"Merge into main" = "முதன்மையில் இணை" +"Merge regions" = "பகுதிகளை இணை" +"Merge the branch into the main file (one undo step) and archive it" = "கிளையை முதன்மைக் கோப்பில் இணைத்து (ஒரே செயல்தவிர்ப் படி) அதைக் காப்பகப்படுத்து" +"Merged" = "இணைக்கப்பட்டது" +"Merged PRs" = "இணைக்கப்பட்ட PRகள்" +"Min H" = "குறை. உ" +"Min W" = "குறைந்தபட்ச அகலம்" +"Minimize" = "சிறிதாக்கு" +"Minutes" = "நிமிடங்கள்" +"Mirror angle" = "கோணத்தைப் பிரதிபலி" +"Mirror angle and length" = "கோணம் மற்றும் நீளத்தைப் பிரதிபலி" +"Mirroring" = "பிரதிபலிப்பு" +"Missing" = "காணவில்லை" +"Missing fonts" = "காணாத எழுத்துருக்கள்" +"Missing layer" = "காணாத லேயர்" +"Missing style" = "காணாத ஸ்டைல்" +"Missing variable" = "காணாத வேரியபிள்" +"Miter" = "மைட்டர்" +"Miter angle" = "மைட்டர் கோணம்" +"Mixed" = "கலப்பு" +"Mixed fonts" = "கலப்பு எழுத்துருக்கள்" +"Mixed interactions: click + to replace them" = "கலப்பு இன்டராக்ஷன்கள்: மாற்ற + ஐக் கிளிக் செய்யவும்" +"Mobile app" = "மொபைல் ஆப்" +"Mode" = "மோட்" +"Model" = "மாடல்" +"Models" = "மாடல்கள்" +"Mono" = "மோனோ" +"More" = "மேலும்" +"More instance actions" = "மேலும் இன்ஸ்டன்ஸ் செயல்கள்" +"Mouse down" = "மவுஸ் அழுத்தம்" +"Mouse enter" = "மவுஸ் நுழைவு" +"Mouse leave" = "மவுஸ் வெளியேற்றம்" +"Mouse up" = "மவுஸ் விடுவிப்பு" +"Move" = "நகர்த்து" +"Move along the toolbar or the layer rows" = "கருவிப்பட்டி அல்லது லேயர் வரிசைகளில் நகரவும்" +"Move column left" = "நெடுவரிசையை இடப்புறம் நகர்த்து" +"Move column right" = "நெடுவரிசையை வலப்புறம் நகர்த்து" +"Move down" = "கீழே நகர்த்து" +"Move in" = "உள்ளே நகர்த்து" +"Move out" = "வெளியே நகர்த்து" +"Move out of any group" = "எந்தக் குழுவிலிருந்தும் வெளியே நகர்த்து" +"Move to group {group}" = "{group} குழுவுக்கு நகர்த்து" +"Move tools" = "நகர்த்தும் கருவிகள்" +"Move up" = "மேலே நகர்த்து" +"Move up or down while dragging its label" = "அதன் லேபிளை இழுக்கும்போது மேலே அல்லது கீழே நகர்த்தவும்" +"Moved to {name}" = "{name} க்கு நகர்த்தப்பட்டது" +"Multi" = "பல" +"Multiply" = "பெருக்கல்" +"Muted" = "ஒலியடக்கப்பட்டது" +"Name" = "பெயர்" +"Name (A–Z)" = "பெயர் (A–Z)" +"Named instance" = "பெயரிடப்பட்ட இன்ஸ்டன்ஸ்" +"Navigate to" = "இதற்குச் செல்" +"Nested instance" = "உள்ளமைந்த இன்ஸ்டன்ஸ்" +"New board" = "புதிய போர்டு" +"New collection" = "புதிய தொகுப்பு" +"New design file" = "புதிய வடிவமைப்புக் கோப்பு" +"Newest first" = "புதியவை முதலில்" +"Next frame" = "அடுத்த ஃப்ரேம்" +"Next or previous control in the focused region" = "கவனத்திலுள்ள பகுதியில் அடுத்த அல்லது முந்தைய கட்டுப்பாடு" +"Next ready for dev" = "அடுத்த டெவ்-க்குத் தயார்" +"Next size option" = "அடுத்த அளவு விருப்பம்" +"No assets: no export settings, icons or images. Add export settings in the Design tab." = "அசெட்கள் இல்லை: ஏற்றுமதி அமைப்புகள், ஐகான்கள் அல்லது படங்கள் இல்லை. டிசைன் தாவலில் ஏற்றுமதி அமைப்புகளைச் சேர்க்கவும்." +"No boolean variables fit here." = "இங்கு பொருந்தும் பூலியன் வேரியபிள்கள் இல்லை." +"No boolean variables yet. Create them in Local variables." = "இன்னும் பூலியன் வேரியபிள்கள் இல்லை. லோக்கல் வேரியபிள்களில் அவற்றை உருவாக்கவும்." +"No branches. A branch is a copy of the file to try changes in, then review and merge." = "கிளைகள் இல்லை. கிளை என்பது மாற்றங்களை முயன்று, பின் மதிப்பாய்வு செய்து இணைப்பதற்கான கோப்பின் நகல்." +"No category" = "வகை இல்லை" +"No changes" = "மாற்றங்கள் இல்லை" +"No color styles" = "நிற ஸ்டைல்கள் இல்லை" +"No colour variables fit here." = "இங்கு பொருந்தும் நிற வேரியபிள்கள் இல்லை." +"No colour variables yet. Create them in Local variables." = "இன்னும் நிற வேரியபிள்கள் இல்லை. லோக்கல் வேரியபிள்களில் அவற்றை உருவாக்கவும்." +"No comments to copy" = "நகலெடுக்கக் கருத்துகள் இல்லை" +"No comments yet" = "இன்னும் கருத்துகள் இல்லை" +"No compatibility warnings reported" = "பொருந்தக்கூடிய எச்சரிக்கைகள் எதுவும் இல்லை" +"No components yet. Select layers and press {keys}." = "இன்னும் காம்போனென்ட்கள் இல்லை. லேயர்களைத் தேர்ந்தெடுத்து {keys} அழுத்தவும்." +"No conflicts." = "முரண்பாடுகள் இல்லை." +"No contributor data was built into this copy." = "இந்த நகலில் பங்களிப்பாளர் தரவு சேர்க்கப்படவில்லை." +"No device" = "சாதனம் இல்லை" +"No files or templates match your search" = "உங்கள் தேடலுக்குப் பொருந்தும் கோப்புகளோ டெம்ப்ளேட்களோ இல்லை" +"No fonts match" = "பொருந்தும் எழுத்துருக்கள் இல்லை" +"No join code here (the server is older than join codes, or this address can't be put in one): share the link instead." = "இங்கு சேர் குறியீடு இல்லை (சர்வர் சேர் குறியீடுகளை விடப் பழையது, அல்லது இந்த முகவரியைக் குறியீட்டில் வைக்க முடியாது): அதற்குப் பதிலாக இணைப்பைப் பகிரவும்." +"No layer changes to show." = "காட்ட லேயர் மாற்றங்கள் இல்லை." +"No libraries yet. Add a .figcraft file that was published as a library, or paste a team library's link." = "இன்னும் லைப்ரரிகள் இல்லை. லைப்ரரியாக வெளியிடப்பட்ட .figcraft கோப்பைச் சேர்க்கவும், அல்லது குழு லைப்ரரியின் இணைப்பை ஒட்டவும்." +"No list" = "பட்டியல் இல்லை" +"No matching comments" = "பொருந்தும் கருத்துகள் இல்லை" +"No matching components" = "பொருந்தும் காம்போனென்ட்கள் இல்லை" +"No matching layers" = "பொருந்தும் லேயர்கள் இல்லை" +"No matching styles" = "பொருந்தும் ஸ்டைல்கள் இல்லை" +"No matching variables" = "பொருந்தும் வேரியபிள்கள் இல்லை" +"No mirroring" = "பிரதிபலிப்பு இல்லை" +"No model credits were built into this copy." = "இந்த நகலில் மாடல் கிரெடிட்கள் சேர்க்கப்படவில்லை." +"No number variables fit here." = "இங்கு பொருந்தும் எண் வேரியபிள்கள் இல்லை." +"No number variables yet. Create them in Local variables." = "இன்னும் எண் வேரியபிள்கள் இல்லை. லோக்கல் வேரியபிள்களில் அவற்றை உருவாக்கவும்." +"No other pages" = "வேறு பக்கங்கள் இல்லை" +"No paints" = "பெயிண்ட்கள் இல்லை" +"No plugins on {server}." = "{server} இல் ப்ளகின்கள் இல்லை." +"No plugins yet. Import a development plugin from its figcraft-plugin.json." = "இன்னும் ப்ளகின்கள் இல்லை. டெவலப்மென்ட் ப்ளகினை அதன் figcraft-plugin.json இலிருந்து இறக்குமதி செய்யவும்." +"No preferred components" = "விருப்பமான காம்போனென்ட்கள் இல்லை" +"No preset" = "முன்னமைவு இல்லை" +"No saved versions yet. Save a version to mark a point in your work you can come back to." = "இன்னும் சேமித்த பதிப்புகள் இல்லை. பின்னர் திரும்பி வரக்கூடிய ஒரு நிலையைக் குறிக்க ஒரு பதிப்பைச் சேமிக்கவும்." +"No scrolling" = "ஸ்க்ரோலிங் இல்லை" +"No shortcuts match" = "பொருந்தும் குறுக்குவழிகள் இல்லை" +"No status" = "நிலை இல்லை" +"No string variables fit here." = "இங்கு பொருந்தும் ஸ்ட்ரிங் வேரியபிள்கள் இல்லை." +"No string variables yet. Create them in Local variables." = "இன்னும் ஸ்ட்ரிங் வேரியபிள்கள் இல்லை. லோக்கல் வேரியபிள்களில் அவற்றை உருவாக்கவும்." +"No styles yet." = "இன்னும் ஸ்டைல்கள் இல்லை." +"No styles yet. Click + to create one from the selection." = "இன்னும் ஸ்டைல்கள் இல்லை. தேர்விலிருந்து ஒன்றை உருவாக்க + ஐக் கிளிக் செய்யவும்." +"No templates match your search" = "உங்கள் தேடலுக்குப் பொருந்தும் டெம்ப்ளேட்கள் இல்லை" +"No text styles yet. Click + to create one from the selected text." = "இன்னும் உரை ஸ்டைல்கள் இல்லை. தேர்ந்தெடுத்த உரையிலிருந்து ஒன்றை உருவாக்க + ஐக் கிளிக் செய்யவும்." +"No variables fit here." = "இங்கு பொருந்தும் வேரியபிள்கள் இல்லை." +"No variables yet. Create them in Local variables." = "இன்னும் வேரியபிள்கள் இல்லை. லோக்கல் வேரியபிள்களில் அவற்றை உருவாக்கவும்." +"No votes yet" = "இன்னும் வாக்குகள் இல்லை" +"Nobody else is here yet" = "இங்கு இன்னும் வேறு யாரும் இல்லை" +"Nobody shares a file there now." = "இப்போது அங்கு யாரும் கோப்பைப் பகிரவில்லை." +"Noise" = "இரைச்சல்" +"None" = "இல்லை" +"None." = "எதுவுமில்லை." +"Normal" = "இயல்பு" +"Not bound" = "இணைக்கப்படவில்லை" +"Not checked yet" = "இன்னும் சரிபார்க்கப்படவில்லை" +"Not connected: {reason}. Your work is still in this tab." = "இணைக்கப்படவில்லை: {reason}. உங்கள் வேலை இன்னும் இந்தத் தாவலில் உள்ளது." +"Not in a live session" = "நேரலை அமர்வில் இல்லை" +"Not in this font" = "இந்த எழுத்துருவில் இல்லை" +"Not now" = "இப்போது வேண்டாம்" +"Not properties, kept as written: {names}" = "பண்புகள் அல்ல, எழுதியபடியே வைக்கப்பட்டன: {names}" +"Not read yet" = "இன்னும் படிக்கப்படவில்லை" +"Not shared" = "பகிரப்படவில்லை" +"Note {n}" = "குறிப்பு {n}" +"Nothing changed since this version." = "இந்தப் பதிப்பிலிருந்து எதுவும் மாறவில்லை." +"Nothing changed since this was marked ready for dev." = "டெவ்-க்குத் தயார் எனக் குறித்ததிலிருந்து எதுவும் மாறவில்லை." +"Nothing counted yet" = "இன்னும் எதுவும் கணக்கிடப்படவில்லை" +"Nothing here yet. Set a frame's status to list it." = "இங்கு இன்னும் எதுவும் இல்லை. பட்டியலிட ஒரு ஃப்ரேமின் நிலையை அமைக்கவும்." +"Nothing online yet. Use Share on a file to put it online and it is listed here." = "இன்னும் எதுவும் ஆன்லைனில் இல்லை. ஒரு கோப்பை ஆன்லைனில் வைக்கப் பகிர் என்பதைப் பயன்படுத்தவும், அது இங்கே பட்டியலிடப்படும்." +"Nothing to export" = "ஏற்றுமதி செய்ய எதுவும் இல்லை" +"Nothing to pick: the page is empty" = "தேர்வு செய்ய எதுவும் இல்லை: பக்கம் காலியாக உள்ளது" +"Nov" = "நவ." +"Now" = "இப்போது" +"Nudge (Shift: big nudge)" = "சிறு நகர்வு (Shift: பெரிய நகர்வு)" +"Nudge amount" = "சிறு நகர்வு அளவு" +"Number" = "எண்" +"Number ↑" = "எண் ↑" +"Number ↓" = "எண் ↓" +"Numbered list" = "எண்ணிட்ட பட்டியல்" +"Object" = "பொருள்" +"Oct" = "அக்." +"Octagon" = "எண்கோணம்" +"Off" = "முடக்கு" +"Offered first when filling the slot (any content is allowed)" = "ஸ்லாட்டை நிரப்பும்போது முதலில் வழங்கப்படும் (எந்த உள்ளடக்கமும் அனுமதிக்கப்படும்)" +"Offered first when swapping the instance (any component is allowed)" = "இன்ஸ்டன்ஸை மாற்றும்போது முதலில் வழங்கப்படும் (எந்த காம்போனென்டும் அனுமதிக்கப்படும்)" +"Offset" = "ஆஃப்செட்" +"Oldest first" = "பழையவை முதலில்" +"On click" = "கிளிக் செய்யும்போது" +"On drag" = "இழுக்கும்போது" +"On this page" = "இந்தப் பக்கத்தில்" +"One announcement in five common sizes: square, portrait, story, link and banner" = "ஐந்து பொதுவான அளவுகளில் ஒரு அறிவிப்பு: சதுரம், போர்ட்ரெய்ட், ஸ்டோரி, இணைப்பு மற்றும் பேனர்" +"Online" = "ஆன்லைன்" +"Online files" = "ஆன்லைன் கோப்புகள்" +"Online sharing is off: files are shared on the local network only." = "ஆன்லைன் பகிர்வு முடக்கத்தில் உள்ளது: கோப்புகள் உள்ளூர் நெட்வொர்க்கில் மட்டுமே பகிரப்படும்." +"Online sharing is off: no server is set in Preferences. Here you can join a shared file." = "ஆன்லைன் பகிர்வு முடக்கத்தில் உள்ளது: விருப்பங்களில் சர்வர் அமைக்கப்படவில்லை. இங்கே பகிரப்பட்ட கோப்பில் சேரலாம்." +"Only the first changed layers are listed." = "மாற்றப்பட்ட முதல் லேயர்கள் மட்டுமே பட்டியலிடப்பட்டுள்ளன." +"Only the first {n} changed layers are listed." = "மாற்றப்பட்ட முதல் {n} லேயர்கள் மட்டுமே பட்டியலிடப்பட்டுள்ளன." +"Only your threads" = "உங்கள் த்ரெட்கள் மட்டும்" +"Opacity" = "ஒளிபுகாமை" +"Opacity & blend" = "ஒளிபுகாமை & கலப்பு" +"Opacity 10%…90%, 0: 100%" = "ஒளிபுகாமை 10%…90%, 0: 100%" +"Open" = "திற" +"Open .figcraft, .svg or images" = ".figcraft, .svg அல்லது படங்களைத் திற" +"Open branch" = "கிளையைத் திற" +"Open file" = "கோப்பைத் திற" +"Open files" = "கோப்புகளைத் திற" +"Open in focus view" = "ஃபோகஸ் காட்சியில் திற" +"Open in new tab" = "புதிய தாவலில் திற" +"Open in new window" = "புதிய சாளரத்தில் திற" +"Open invite links in FigCraft" = "அழைப்பு இணைப்புகளை FigCraft இல் திற" +"Open link" = "இணைப்பைத் திற" +"Open link {url}" = "{url} இணைப்பைத் திற" +"Open overlay" = "ஓவர்லேவைத் திற" +"Open presentations" = "விளக்கக்காட்சிகளைத் திற" +"Open prototype preview" = "ப்ரோட்டோடைப் முன்னோட்டத்தைத் திற" +"Open variables ({count})" = "வேரியபிள்களைத் திற ({count})" +"Opened as a new document" = "புதிய ஆவணமாகத் திறக்கப்பட்டது" +"Opened “{name}” in a new tab" = "“{name}” புதிய தாவலில் திறக்கப்பட்டது" +"Opening the file…" = "கோப்பு திறக்கப்படுகிறது…" +"Opening {n} files as new files" = { one = "புதிய கோப்பாகத் திறக்கப்படுகிறது", other = "{n} கோப்புகள் புதிய கோப்புகளாகத் திறக்கப்படுகின்றன" } +"Open|comments" = "திறந்தவை" +"Options" = "விருப்பங்கள்" +"Orange" = "ஆரஞ்சு" +"Order" = "வரிசை" +"Other" = "பிற" +"Other apps may not open every .fig file exported here." = "இங்கே ஏற்றுமதி செய்யப்படும் ஒவ்வொரு .fig கோப்பையும் பிற ஆப்கள் திறக்காமல் போகலாம்." +"Others lose access and keep their copy; the file stays on the server for you" = "மற்றவர்கள் அணுகலை இழப்பார்கள், அவர்களின் நகல் அவர்களிடம் இருக்கும்; கோப்பு உங்களுக்காக சர்வரில் இருக்கும்" +"Others type this under Share ▸ Join with a code" = "மற்றவர்கள் இதை பகிர் ▸ குறியீட்டுடன் சேர் என்பதன் கீழ் உள்ளிடுவார்கள்" +"Outline stroke" = "ஸ்ட்ரோக்கை அவுட்லைன் ஆக்கு" +"Outline text" = "உரையை அவுட்லைன் ஆக்கு" +"Outlines" = "அவுட்லைன்கள்" +"Outside" = "வெளியே" +"Overflow" = "ஓவர்ஃப்ளோ" +"Overlay" = "ஓவர்லே" +"Overlay position" = "ஓவர்லே நிலை" +"Overridden here (the collection it extends has another value)" = "இங்கே ஓவர்ரைடு செய்யப்பட்டது (இது நீட்டிக்கும் தொகுப்பில் வேறு மதிப்பு உள்ளது)" +"Overrides" = "ஓவர்ரைடுகள்" +"Owner token" = "உரிமையாளர் டோக்கன்" +"Owner token copied" = "உரிமையாளர் டோக்கன் நகலெடுக்கப்பட்டது" +"PDF print options" = "PDF அச்சு விருப்பங்கள்" +"PDF print settings" = "PDF அச்சு அமைப்புகள்" +"Padding" = "பேடிங்" +"Page" = "பக்கம்" +"Page deleted" = "பக்கம் நீக்கப்பட்டது" +"Pages" = "பக்கங்கள்" +"Pages added to the document" = "ஆவணத்தில் பக்கங்கள் சேர்க்கப்பட்டன" +"Pages: {pages}" = "பக்கங்கள்: {pages}" +"Paint bucket" = "பெயிண்ட் பக்கெட்" +"Pan the canvas" = "கேன்வாஸை நகர்த்து" +"Pan with nothing selected (Shift: farther)" = "எதுவும் தேர்ந்தெடுக்காதபோது நகர்த்து (Shift: அதிக தூரம்)" +"Panels" = "பேனல்கள்" +"Paper" = "காகிதம்" +"Paragraph indent" = "பத்தி உள்தள்ளல்" +"Paragraph indent applies to left-aligned text" = "பத்தி உள்தள்ளல் இடப்புறம் சீரமைத்த உரைக்கு மட்டும் பொருந்தும்" +"Paragraph spacing" = "பத்தி இடைவெளி" +"Parallelogram left" = "இடது இணைகரம்" +"Parallelogram right" = "வலது இணைகரம்" +"Pass through" = "பாஸ் த்ரூ" +"Past 30 days" = "கடந்த 30 நாட்கள்" +"Past 90 days" = "கடந்த 90 நாட்கள்" +"Past year" = "கடந்த ஆண்டு" +"Paste a link (https://…)" = "இணைப்பை ஒட்டவும் (https://…)" +"Paste a team library link (a view link)" = "குழு லைப்ரரி இணைப்பை ஒட்டவும் (பார்வை இணைப்பு)" +"Paste effect" = "எஃபெக்ட்டை ஒட்டு" +"Paste fill" = "ஃபில்லை ஒட்டு" +"Paste here" = "இங்கே ஒட்டு" +"Paste stroke" = "ஸ்ட்ரோக்கை ஒட்டு" +"Paste to replace" = "மாற்றீடாக ஒட்டு" +"Pasted design layers" = "ஒட்டிய வடிவமைப்பு லேயர்கள்" +"Pasted design layers; the clipboard didn't carry the images of: {layers}" = "வடிவமைப்பு லேயர்கள் ஒட்டப்பட்டன; இவற்றின் படங்களை கிளிப்போர்டு கொண்டுவரவில்லை: {layers}" +"Pasted design layers; {n} kinds of content were left out" = { one = "வடிவமைப்பு லேயர்கள் ஒட்டப்பட்டன; {n} வகை உள்ளடக்கம் விடுபட்டது", other = "வடிவமைப்பு லேயர்கள் ஒட்டப்பட்டன; {n} வகை உள்ளடக்கங்கள் விடுபட்டன" } +"Pattern" = "பேட்டர்ன்" +"Pattern alignment" = "பேட்டர்ன் சீரமைவு" +"Pattern scale" = "பேட்டர்ன் அளவு" +"Pattern source" = "பேட்டர்ன் மூலம்" +"Pause" = "இடைநிறுத்து" +"Pen" = "பேனா" +"Pencil" = "பென்சில்" +"Pentagon" = "ஐங்கோணம்" +"People in this file" = "இந்தக் கோப்பில் உள்ளவர்கள்" +"People join from anywhere with a code. The file is kept on {server} while you share it." = "குறியீட்டுடன் எங்கிருந்தும் சேரலாம். நீங்கள் பகிரும் வரை கோப்பு {server} இல் வைக்கப்படும்." +"People on your network join with a code. Nothing goes through a server." = "உங்கள் நெட்வொர்க்கில் உள்ளவர்கள் குறியீட்டுடன் சேரலாம். எதுவும் சர்வர் வழியாகச் செல்லாது." +"Phone" = "ஃபோன்" +"Pick color" = "நிறத்தைத் தேர்ந்தெடு" +"Pick color (I)" = "நிறத்தைத் தேர்ந்தெடு (I)" +"Pick one font family first" = "முதலில் ஒரு எழுத்துருக் குடும்பத்தைத் தேர்ந்தெடுக்கவும்" +"Pick select: Tab and Shift+Tab move between layers, Enter goes into one, Shift+Enter out, Space selects, Escape cancels" = "பிக் தேர்வு: Tab, Shift+Tab லேயர்களுக்கு இடையே நகர்த்தும், Enter உள்ளே செல்லும், Shift+Enter வெளியே, Space தேர்ந்தெடுக்கும், Escape ரத்துசெய்யும்" +"Pick select: into a layer, out to its parent" = "பிக் தேர்வு: லேயருக்குள், அதன் பேரன்ட் லேயருக்கு வெளியே" +"Pick select: next or previous layer" = "பிக் தேர்வு: அடுத்த அல்லது முந்தைய லேயர்" +"Pick select: select the picked layer" = "பிக் தேர்வு: தேர்ந்த லேயரைத் தேர்ந்தெடு" +"Pick the Frame tool, then drag on the canvas or choose a device size" = "ஃப்ரேம் கருவியைத் தேர்ந்தெடுத்து, கேன்வாஸில் இழுக்கவும் அல்லது சாதன அளவைத் தேர்வுசெய்யவும்" +"Pin a property" = "ஒரு பண்பைப் பின் செய்" +"Pinch" = "பிஞ்ச்" +"Pink" = "இளஞ்சிவப்பு" +"Pixel grid" = "பிக்சல் கட்டம்" +"Pixel preview 1x" = "பிக்சல் முன்னோட்டம் 1x" +"Pixel preview 2x" = "பிக்சல் முன்னோட்டம் 2x" +"Place a shape or frame (its tool chosen)" = "வடிவம் அல்லது ஃப்ரேமை வை (அதன் கருவி தேர்ந்தெடுக்கப்பட்டிருக்கும்போது)" +"Place automatically" = "தானாக வை" +"Place image" = "படத்தை வை" +"Placed on the current page" = "தற்போதைய பக்கத்தில் வைக்கப்பட்டது" +"Playground" = "பயிற்சிக் களம்" +"Plugin" = "ப்ளகின்" +"Plugins" = "ப்ளகின்கள்" +"Plugins & widgets" = "ப்ளகின்கள் & விட்ஜெட்கள்" +"Plugins run in FigCraft's sandbox, without files, network or clock. Install only plugins you trust." = "ப்ளகின்கள் FigCraft இன் சாண்ட்பாக்ஸில் கோப்புகள், நெட்வொர்க் அல்லது கடிகாரம் இல்லாமல் இயங்கும். நீங்கள் நம்பும் ப்ளகின்களை மட்டும் நிறுவவும்." +"Plus" = "கூட்டல்" +"Plus darker" = "பிளஸ் டார்க்கர்" +"Plus lighter" = "பிளஸ் லைட்டர்" +"Plus one" = "பிளஸ் ஒன்" +"Point" = "புள்ளி" +"Points" = "புள்ளிகள்" +"Polygon" = "பலகோணம்" +"Polygons" = "பலகோணங்கள்" +"Port" = "போர்ட்" +"Position" = "இடம்" +"Post" = "பதிவிடு" +"Predefined process" = "முன்வரையறுத்த செயல்முறை" +"Preferences" = "விருப்பங்கள்" +"Preferred" = "விருப்பமானவை" +"Present" = "வழங்கு" +"Present or preview" = "வழங்கு அல்லது முன்னோட்டம்" +"Present this flow" = "இந்த ஃப்ளோவை வழங்கு" +"Presentation" = "விளக்கக்காட்சி" +"Presentation slides" = "விளக்கக்காட்சி ஸ்லைடுகள்" +"Presenting: comments" = "வழங்குதல்: கருத்துகள்" +"Presenting: cycle the size options" = "வழங்குதல்: அளவு விருப்பங்களை மாற்று" +"Presenting: full screen" = "வழங்குதல்: முழுத் திரை" +"Presenting: next frame" = "வழங்குதல்: அடுத்த ஃப்ரேம்" +"Presenting: previous frame" = "வழங்குதல்: முந்தைய ஃப்ரேம்" +"Presenting: restart" = "வழங்குதல்: மீண்டும் தொடங்கு" +"Preserve scroll position" = "ஸ்க்ரோல் நிலையைத் தக்கவை" +"Presets" = "முன்னமைவுகள்" +"Press a key…" = "ஒரு விசையை அழுத்தவும்…" +"Pretty" = "அழகான" +"Pretty: full lines, no one word alone on the last" = "அழகான: முழு வரிகள், கடைசி வரியில் தனிச் சொல் இல்லை" +"Preview" = "முன்னோட்டம்" +"Preview this flow" = "இந்த ஃப்ளோவை முன்னோட்டமிடு" +"Preview this frame" = "இந்த ஃப்ரேமை முன்னோட்டமிடு" +"Previous frame" = "முந்தைய ஃப்ரேம்" +"Previous ready for dev" = "முந்தைய டெவ்-க்குத் தயார்" +"Progressive" = "படிப்படியான" +"Properties" = "பண்புகள்" +"Properties copied" = "பண்புகள் நகலெடுக்கப்பட்டன" +"Prototype" = "ப்ரோட்டோடைப்" +"Prototype preview" = "ப்ரோட்டோடைப் முன்னோட்டம்" +"Prototype settings" = "ப்ரோட்டோடைப் அமைப்புகள்" +"Publish" = "வெளியிடு" +"Publish changes" = "மாற்றங்களை வெளியிடு" +"Publish to another server…" = "வேறு சர்வரில் வெளியிடு…" +"Publish to server" = "சர்வரில் வெளியிடு" +"Published version {v}" = "பதிப்பு {v} வெளியிடப்பட்டது" +"Published version {v} to the server" = "பதிப்பு {v} சர்வரில் வெளியிடப்பட்டது" +"Published version {v}: save the file so other files can use it" = "பதிப்பு {v} வெளியிடப்பட்டது: பிற கோப்புகள் பயன்படுத்த இந்தக் கோப்பைச் சேமிக்கவும்" +"Published · {people}" = "வெளியிடப்பட்டது · {people}" +"Publishing with the server's key." = "சர்வரின் விசையுடன் வெளியிடப்படுகிறது." +"Publishing…" = "வெளியிடப்படுகிறது…" +"Push" = "புஷ்" +"Push changes to main component" = "மாற்றங்களை முதன்மை காம்போனென்ட்டுக்கு புஷ் செய்" +"Put text on path" = "உரையைப் பாதையில் வை" +"Question" = "கேள்வி" +"R" = "R" +"Radial" = "ரேடியல்" +"Radius" = "ஆரம்" +"Ratio" = "விகிதம்" +"Reading the library…" = "லைப்ரரி படிக்கப்படுகிறது…" +"Ready for dev" = "டெவ்-க்குத் தயார்" +"Real name" = "உண்மைப் பெயர்" +"Recent" = "சமீபத்தியவை" +"Recent files" = "சமீபத்திய கோப்புகள்" +"Recents" = "சமீபத்தியவை" +"Recovered {n} unsaved files after the app quit unexpectedly: save them to keep them" = { one = "ஆப் எதிர்பாராமல் மூடியதால் சேமிக்காத ஒரு கோப்பு மீட்கப்பட்டது: அதை வைத்திருக்கச் சேமிக்கவும்", other = "ஆப் எதிர்பாராமல் மூடியதால் சேமிக்காத {n} கோப்புகள் மீட்கப்பட்டன: அவற்றை வைத்திருக்கச் சேமிக்கவும்" } +"Rectangle" = "செவ்வகம்" +"Rectangles" = "செவ்வகங்கள்" +"Red" = "சிவப்பு" +"Reduce motion" = "இயக்கத்தைக் குறை" +"Refraction" = "ஒளிவிலகல்" +"Regular expression" = "ரெகுலர் எக்ஸ்பிரஷன்" +"Relative to" = "இதைப் பொறுத்து" +"Relative to your system's display scaling (100% is the system's own size). Document zoom is separate." = "உங்கள் கணினியின் காட்சி அளவிடலைப் பொறுத்து (100% என்பது கணினியின் சொந்த அளவு). ஆவண ஜூம் தனியானது." +"Reload the page to get back the unsaved files the browser had room for." = "உலாவியில் இடம் இருந்த சேமிக்காத கோப்புகளைத் திரும்பப் பெறப் பக்கத்தை மீண்டும் ஏற்றவும்." +"Reload the page to get your unsaved files back." = "சேமிக்காத கோப்புகளைத் திரும்பப் பெறப் பக்கத்தை மீண்டும் ஏற்றவும்." +"Reload the page to start again." = "மீண்டும் தொடங்கப் பக்கத்தை மீண்டும் ஏற்றவும்." +"Remove" = "அகற்று" +"Remove all" = "அனைத்தையும் அகற்று" +"Remove all auto layout" = "எல்லா ஆட்டோ லேஅவுட்டையும் அகற்று" +"Remove annotation" = "குறிப்புரையை அகற்று" +"Remove auto layout" = "ஆட்டோ லேஅவுட்டை அகற்று" +"Remove column" = "நெடுவரிசையை அகற்று" +"Remove dev resource" = "டெவ் ஆதாரத்தை அகற்று" +"Remove export setting" = "ஏற்றுமதி அமைப்பை அகற்று" +"Remove from recents" = "சமீபத்தியவற்றிலிருந்து அகற்று" +"Remove from server" = "சர்வரிலிருந்து அகற்று" +"Remove from server…" = "சர்வரிலிருந்து அகற்று…" +"Remove guide" = "வழிகாட்டியை அகற்று" +"Remove interaction" = "இன்டராக்ஷனை அகற்று" +"Remove library from this file" = "இந்தக் கோப்பிலிருந்து லைப்ரரியை அகற்று" +"Remove measurement" = "அளவீட்டை அகற்று" +"Remove min and max" = "குறைந்தபட்ச, அதிகபட்சத்தை அகற்று" +"Remove min and max height" = "குறைந்தபட்ச, அதிகபட்ச உயரத்தை அகற்று" +"Remove min and max width" = "குறைந்தபட்ச, அதிகபட்ச அகலத்தை அகற்று" +"Remove regions" = "பகுதிகளை அகற்று" +"Remove row" = "வரிசையை அகற்று" +"Remove slot" = "ஸ்லாட்டை அகற்று" +"Remove starting point" = "தொடக்கப் புள்ளியை அகற்று" +"Remove stop" = "நிறுத்தத்தை அகற்று" +"Remove text from path" = "பாதையிலிருந்து உரையை அகற்று" +"Remove the else and its actions" = "else மற்றும் அதன் செயல்களை அகற்று" +"Remove these results from the file" = "இந்த முடிவுகளைக் கோப்பிலிருந்து நீக்கு" +"Remove this condition and its actions" = "இந்த நிபந்தனையையும் அதன் செயல்களையும் அகற்று" +"Remove this file from the server? It can't be shared or opened from there again. Your copy stays open here." = "இந்தக் கோப்பைச் சர்வரிலிருந்து அகற்றவா? அங்கிருந்து அதை மீண்டும் பகிரவோ திறக்கவோ முடியாது. உங்கள் நகல் இங்கே திறந்தே இருக்கும்." +"Remove {name} from session" = "{name} ஐ அமர்விலிருந்து அகற்று" +"Remove {name} from {server}?" = "{name} ஐ {server} இலிருந்து அகற்றவா?" +"Removed" = "அகற்றப்பட்டது" +"Removed from the server" = "சர்வரிலிருந்து அகற்றப்பட்டது" +"Removed since it was marked" = "குறித்ததிலிருந்து அகற்றப்பட்டது" +"Removed since this version" = "இந்தப் பதிப்பிலிருந்து அகற்றப்பட்டது" +"Rename" = "மறுபெயரிடு" +"Rename duplicated layers" = "நகலெடுத்த லேயர்களை மறுபெயரிடு" +"Rename folder" = "கோப்புறையை மறுபெயரிடு" +"Rename group" = "குழுவை மறுபெயரிடு" +"Rename layers" = "லேயர்களை மறுபெயரிடு" +"Rename mode" = "மோடை மறுபெயரிடு" +"Rename on the server" = "சர்வரில் மறுபெயரிடு" +"Rename on the server…" = "சர்வரில் மறுபெயரிடு…" +"Rename page" = "பக்கத்தை மறுபெயரிடு" +"Rename to" = "இவ்வாறு மறுபெயரிடு" +"Reorder selection" = "தேர்வை மறுவரிசைப்படுத்து" +"Replace all" = "அனைத்தையும் மாற்று" +"Replace mixed export settings" = "கலப்பு ஏற்றுமதி அமைப்புகளை மாற்று" +"Replace with" = "இதனால் மாற்று" +"Replace with a new interaction" = "புதிய இன்டராக்ஷனால் மாற்று" +"Reply" = "பதிலளி" +"Report" = "புகாரளி" +"Report this file…" = "இந்தக் கோப்பைப் புகாரளி…" +"Reset" = "மீட்டமை" +"Reset adjustments" = "சரிசெய்தல்களை மீட்டமை" +"Reset all changes" = "எல்லா மாற்றங்களையும் மீட்டமை" +"Reset all overrides on this layer" = "இந்த லேயரின் எல்லா ஓவர்ரைடுகளையும் மீட்டமை" +"Reset grid" = "கட்டத்தை மீட்டமை" +"Reset overrides" = "ஓவர்ரைடுகளை மீட்டமை" +"Reset slot" = "ஸ்லாட்டை மீட்டமை" +"Reset this override" = "இந்த ஓவர்ரைடை மீட்டமை" +"Reset to style" = "ஸ்டைலுக்கு மீட்டமை" +"Reset to the inherited value" = "மரபுரிமை மதிப்புக்கு மீட்டமை" +"Resize by the nudge amount" = "சிறு நகர்வு அளவால் அளவு மாற்று" +"Resize frames to the device's screen (or the window without a device): their constraints and auto layout respond" = "ஃப்ரேம்களைச் சாதனத்தின் திரைக்கு (சாதனம் இல்லையெனில் சாளரத்திற்கு) அளவு மாற்று: அவற்றின் கட்டுப்பாடுகளும் ஆட்டோ லேஅவுட்டும் பதிலளிக்கும்" +"Resize to fit" = "பொருந்தும்படி அளவு மாற்று" +"Resizing" = "அளவு மாற்றம்" +"Resolve" = "தீர்த்துவை" +"Resolve change" = "மாற்றத்தைத் தீர்த்துவை" +"Resolved" = "தீர்க்கப்பட்டது" +"Responsive" = "ரெஸ்பான்சிவ்" +"Restart" = "மீண்டும் தொடங்கு" +"Restore" = "மீட்டெடு" +"Restore main component" = "முதன்மை காம்போனென்ட்டை மீட்டெடு" +"Restore this version" = "இந்தப் பதிப்பை மீட்டெடு" +"Restored “{name}”" = "“{name}” மீட்டெடுக்கப்பட்டது" +"Results" = "முடிவுகள்" +"Resume" = "தொடர்" +"Retrospective" = "பின்னோக்கு" +"Retry now" = "இப்போது மீண்டும் முயல்" +"Reverse the order" = "வரிசையைத் தலைகீழாக்கு" +"Reversed triangle" = "தலைகீழ் முக்கோணம்" +"Review and merge" = "மதிப்பாய்வு செய்து இணை" +"Ribbon" = "ரிப்பன்" +"Right" = "வலது" +"Right padding" = "வலது பேடிங்" +"Right side" = "வலது பக்கம்" +"Right side width" = "வலது பக்க அகலம்" +"Right to left" = "வலமிருந்து இடம்" +"Rotate 90°" = "90° சுழற்று" +"Rotate 90° right" = "வலப்புறம் 90° சுழற்று" +"Rotate a degree (Shift: 15)" = "ஒரு டிகிரி சுழற்று (Shift: 15)" +"Rotate to landscape" = "லேண்ட்ஸ்கேப்பாகச் சுழற்று" +"Rotate to portrait" = "போர்ட்ரெய்ட்டாகச் சுழற்று" +"Rotation" = "சுழற்சி" +"Rotation jitter" = "சுழற்சி நடுக்கம்" +"Round" = "வட்டமான" +"Rounded" = "வளைந்த" +"Rounded rectangle" = "வளைந்த மூலைச் செவ்வகம்" +"Row" = "வரிசை" +"Row gap" = "வரிசை இடைவெளி" +"Row sizes" = "வரிசை அளவுகள்" +"Row span" = "வரிசை நீட்டிப்பு" +"Rows" = "வரிசைகள்" +"Rows {count}" = "வரிசைகள் {count}" +"Rulers" = "அளவுகோல்கள்" +"Run" = "இயக்கு" +"Run {label}" = "{label} ஐ இயக்கு" +"SHA-256: {sha}…" = "SHA-256: {sha}…" +"Same as file ({profile})" = "கோப்பைப் போலவே ({profile})" +"Same as layer" = "லேயரைப் போலவே" +"Saturation" = "செறிவு" +"Save" = "சேமி" +"Save a copy…" = "நகலைச் சேமி…" +"Save as" = "இவ்வாறு சேமி" +"Save as preset…" = "முன்னமைவாகச் சேமி…" +"Save file" = "கோப்பைச் சேமி" +"Save files automatically" = "கோப்புகளைத் தானாகச் சேமி" +"Save version {key}" = "பதிப்பைச் சேமி {key}" +"Saved" = "சேமிக்கப்பட்டது" +"Saved {name}" = "{name} சேமிக்கப்பட்டது" +"Say something" = "ஏதாவது சொல்லுங்கள்" +"Scale" = "அளவு" +"Scatter" = "சிதறல்" +"Scope: all supported properties" = "வரம்பு: ஆதரிக்கப்படும் அனைத்து பண்புகள்" +"Scope: hidden from pickers" = "வரம்பு: தேர்வுப் பட்டியல்களில் மறைக்கப்பட்டது" +"Scope: only {scope}" = "வரம்பு: {scope} மட்டும்" +"Scoping: where pickers offer it" = "வரம்பு: தேர்வுக்கருவிகள் இதை வழங்கும் இடம்" +"Screen" = "ஸ்கிரீன்" +"Scroll behavior" = "ஸ்க்ரோல் நடத்தை" +"Scroll to" = "இதற்கு ஸ்க்ரோல் செய்" +"Scroll to layer" = "லேயருக்கு ஸ்க்ரோல் செய்" +"Scroll wheel zoom" = "ஸ்க்ரோல் வீல் ஜூம்" +"Scroll with parent" = "பேரன்ட்டுடன் ஸ்க்ரோல் செய்" +"Scrub a field faster (2x) or slower (1/2, 1/4)" = "புலத்தை வேகமாக (2x) அல்லது மெதுவாக (1/2, 1/4) இழுத்து மாற்றவும்" +"Scrubbing at 1/2" = "1/2 வேகத்தில் இழுக்கிறது" +"Scrubbing at 1/4" = "1/4 வேகத்தில் இழுக்கிறது" +"Scrubbing at 1x" = "1x வேகத்தில் இழுக்கிறது" +"Scrubbing at 2x" = "2x வேகத்தில் இழுக்கிறது" +"Search" = "தேடு" +"Search actions, layers and tools" = "செயல்கள், லேயர்கள் மற்றும் கருவிகளைத் தேடு" +"Search assets" = "அசெட்களைத் தேடு" +"Search comments" = "கருத்துகளைத் தேடு" +"Search files and templates" = "கோப்புகளையும் டெம்ப்ளேட்களையும் தேடு" +"Search fonts" = "எழுத்துருக்களைத் தேடு" +"Search layers" = "லேயர்களைத் தேடு" +"Search pages" = "பக்கங்களைத் தேடு" +"Search plugins" = "ப்ளகின்களைத் தேடு" +"Search results" = "தேடல் முடிவுகள்" +"Search shortcuts" = "குறுக்குவழிகளைத் தேடு" +"Search templates" = "டெம்ப்ளேட்களைத் தேடு" +"Section" = "செக்ஷன்" +"Section color" = "செக்ஷன் நிறம்" +"Sections" = "செக்ஷன்கள்" +"See all templates" = "எல்லா டெம்ப்ளேட்களையும் காண்க" +"Select a frame and add a starting point to present it as a flow." = "ஃப்ளோவாகக் காட்ட, ஒரு ஃப்ரேமைத் தேர்ந்தெடுத்து தொடக்கப் புள்ளியைச் சேர்க்கவும்." +"Select a frame to preview it" = "முன்னோட்டம் பார்க்க ஒரு ஃப்ரேமைத் தேர்ந்தெடுக்கவும்" +"Select a layer to see its properties and code" = "பண்புகளையும் குறியீட்டையும் பார்க்க ஒரு லேயரைத் தேர்ந்தெடுக்கவும்" +"Select all" = "அனைத்தையும் தேர்ந்தெடு" +"Select all with same" = "ஒரே மாதிரியானவற்றைத் தேர்ந்தெடு" +"Select layer" = "லேயரைத் தேர்ந்தெடு" +"Select layers and they space themselves as their content changes" = "லேயர்களைத் தேர்ந்தெடுக்கவும், அவற்றின் உள்ளடக்கம் மாறும்போது அவை தாமாக இடைவெளி அமைத்துக்கொள்ளும்" +"Select layers to apply the style to" = "ஸ்டைலைப் பயன்படுத்த லேயர்களைத் தேர்ந்தெடுக்கவும்" +"Select layers with this color" = "இந்த நிறம் உள்ள லேயர்களைத் தேர்ந்தெடு" +"Select overlapping shapes" = "ஒன்றின்மேல் ஒன்றான வடிவங்களைத் தேர்ந்தெடு" +"Select points to edit their position, radius and mirroring" = "நிலை, ஆரம், மிரரிங் ஆகியவற்றைத் திருத்தப் புள்ளிகளைத் தேர்ந்தெடுக்கவும்" +"Select slot" = "ஸ்லாட்டைத் தேர்ந்தெடு" +"Selection" = "தேர்வு" +"Selection box, {w} by {h} at {x}, {y}: arrows move it, Shift+arrows or {cmd}+arrows size it, Enter selects, Escape cancels" = "தேர்வுப் பெட்டி, {w} × {h}, இடம் {x}, {y}: அம்புகள் நகர்த்தும், Shift+அம்புகள் அல்லது {cmd}+அம்புகள் அளவை மாற்றும், Enter தேர்ந்தெடுக்கும், Escape ரத்துசெய்யும்" +"Selection box: arrows move it, Shift+arrows or {cmd}+arrows size it, Enter selects, Escape cancels" = "தேர்வுப் பெட்டி: அம்புகள் நகர்த்தும், Shift+அம்புகள் அல்லது {cmd}+அம்புகள் அளவை மாற்றும், Enter தேர்ந்தெடுக்கும், Escape ரத்துசெய்யும்" +"Selection box: switch to pick select" = "தேர்வுப் பெட்டி: பிக் தேர்வுக்கு மாறு" +"Selection colors" = "தேர்வின் நிறங்கள்" +"Send backward" = "பின்னால் அனுப்பு" +"Send report" = "அறிக்கையை அனுப்பு" +"Send to back" = "மிகப் பின்னால் அனுப்பு" +"Sep" = "செப்" +"Server address" = "சர்வர் முகவரி" +"Server address (ws://host:47900/)" = "சர்வர் முகவரி (ws://host:47900/)" +"Server for online sharing" = "ஆன்லைன் பகிர்வுக்கான சர்வர்" +"Server key" = "சர்வர் கீ" +"Set as default" = "இயல்பாக அமை" +"Set corner smoothing to 60%" = "மூலை மென்மையை 60% ஆக அமை" +"Set fill container" = "கண்டெய்னரை நிரப்பு என அமை" +"Set hug contents" = "உள்ளடக்கத்தை ஹக் செய் என அமை" +"Set variable" = "வேரியபிளை அமை" +"Set variable mode" = "வேரியபிள் மோடை அமை" +"Set variable {name}" = "{name} வேரியபிளை அமை" +"Set {name} to {value}" = "{name} ஐ {value} ஆக அமை" +"Shadows" = "நிழல்கள்" +"Shape" = "வடிவம்" +"Shape builder" = "வடிவ உருவாக்கி" +"Shape tools" = "வடிவக் கருவிகள்" +"Shapes" = "வடிவங்கள்" +"Share" = "பகிர்" +"Share this file" = "இந்தக் கோப்பைப் பகிர்" +"Share with a code" = "குறியீடு மூலம் பகிர்" +"Share: live session, export" = "பகிர்: நேரலை அமர்வு, ஏற்றுமதி" +"Shared" = "பகிரப்பட்டது" +"Shared by your team on {server}" = "{server} இல் உங்கள் குழு பகிர்ந்தது" +"Shared: copy its code from the file's menu" = "பகிரப்பட்டது: கோப்பு மெனுவிலிருந்து அதன் குறியீட்டை நகலெடுக்கவும்" +"Sharing on the local network (online sharing is off: no server is set in Preferences)." = "உள்ளூர் நெட்வொர்க்கில் பகிர்கிறது (ஆன்லைன் பகிர்வு முடக்கத்தில் உள்ளது: விருப்பங்களில் சர்வர் அமைக்கப்படவில்லை)." +"Sharing on your network · {people}" = "உங்கள் நெட்வொர்க்கில் பகிர்கிறது · {people}" +"Sharing online · {people}" = "ஆன்லைனில் பகிர்கிறது · {people}" +"Sharing stopped: the file stays on the server, open only to you" = "பகிர்வு நிறுத்தப்பட்டது: கோப்பு சர்வரில் இருக்கும், உங்களுக்கு மட்டுமே திறந்திருக்கும்" +"Show" = "காட்டு" +"Show all templates" = "எல்லா டெம்ப்ளேட்களையும் காட்டு" +"Show and move the placement crosshair (its tool chosen, nothing selected)" = "வைப்புக் குறுக்குக்குறியைக் காட்டி நகர்த்து (அதன் கருவி தேர்ந்தெடுக்கப்பட்டு, எதுவும் தேர்ந்தெடுக்கப்படாதபோது)" +"Show as grid" = "கட்டமாகக் காட்டு" +"Show as list" = "பட்டியலாகக் காட்டு" +"Show autosaves" = "தானியங்கு சேமிப்புகளைக் காட்டு" +"Show behind transparent areas" = "ஒளிபுகும் பகுதிகளுக்குப் பின்னால் காட்டு" +"Show comments (Shift+C)" = "கருத்துகளைக் காட்டு (Shift+C)" +"Show device frame" = "சாதன ஃப்ரேமைக் காட்டு" +"Show dimensions on objects" = "பொருள்களில் அளவுகளைக் காட்டு" +"Show hotspot hints" = "ஹாட்ஸ்பாட் குறிப்புகளைக் காட்டு" +"Show in Explorer" = "Explorer இல் காட்டு" +"Show in Finder" = "Finder இல் காட்டு" +"Show in folder" = "கோப்புறையில் காட்டு" +"Show only this on the canvas" = "இதை மட்டும் கேன்வாஸில் காட்டு" +"Show open" = "திறந்தவற்றைக் காட்டு" +"Show section contents" = "செக்ஷன் உள்ளடக்கத்தைக் காட்டு" +"Show this layer" = "இந்த லேயரைக் காட்டு" +"Show usage" = "பயன்பாட்டைக் காட்டு" +"Show/Hide" = "காட்டு/மறை" +"Show/Hide UI" = "UI ஐக் காட்டு/மறை" +"Side by side" = "பக்கவாட்டில்" +"Sidebar" = "பக்கப்பட்டி" +"Simplify stroke" = "ஸ்ட்ரோக்கை எளிதாக்கு" +"Size" = "அளவு" +"Size jitter" = "அளவு மாறுபாடு" +"Skip ink" = "மையைத் தவிர்" +"Slashed zero" = "குறுக்குக்கோட்டுப் பூஜ்ஜியம்" +"Slice" = "ஸ்லைஸ்" +"Slices" = "ஸ்லைஸ்கள்" +"Slide in" = "உள்ளே நழுவு" +"Slide out" = "வெளியே நழுவு" +"Slot" = "ஸ்லாட்" +"Slot content" = "ஸ்லாட் உள்ளடக்கம்" +"Slot name" = "ஸ்லாட் பெயர்" +"Small capitals" = "சிறிய பெரிய எழுத்துகள்" +"Small caps" = "சிறிய கேப்ஸ்" +"Smart animate" = "ஸ்மார்ட் அனிமேட்" +"Snap to pixel grid" = "பிக்சல் கட்டத்துடன் ஒட்டு" +"Social and slides" = "சமூக ஊடகம் மற்றும் ஸ்லைடுகள்" +"Social media" = "சமூக ஊடகம்" +"Social post sizes" = "சமூக இடுகை அளவுகள்" +"Soft light" = "மென் ஒளி" +"Solid" = "திடம்" +"Some variants have the same property values: give each one a unique combination" = "சில வேரியன்ட்களுக்கு ஒரே பண்பு மதிப்புகள் உள்ளன: ஒவ்வொன்றுக்கும் தனித்துவமான சேர்க்கையைக் கொடுக்கவும்" +"Someone who left" = "வெளியேறிய ஒருவர்" +"Sort" = "வரிசைப்படுத்து" +"Sort by" = "இதன்படி வரிசைப்படுத்து" +"Sort by date" = "தேதிப்படி வரிசைப்படுத்து" +"Sort by page" = "பக்கப்படி வரிசைப்படுத்து" +"Sort by {column}" = "{column} படி வரிசைப்படுத்து" +"Space" = "Space" +"Space around" = "சுற்றிலும் இடைவெளி" +"Space between" = "இடையே இடைவெளி" +"Space drag" = "Space இழுத்தல்" +"Space evenly" = "சம இடைவெளி" +"Space+drag" = "Space+இழு" +"Spacing" = "இடைவெளி" +"Spam, stolen work, abuse…" = "ஸ்பேம், திருடிய படைப்பு, துஷ்பிரயோகம்…" +"Speech bubble" = "பேச்சுக் குமிழி" +"Splay" = "விரிப்பு" +"Spotlight me" = "என்னை ஸ்பாட்லைட் செய்" +"Spread" = "பரவல்" +"Square" = "சதுரம்" +"Stamp" = "ஸ்டாம்ப்" +"Stamps" = "ஸ்டாம்ப்கள்" +"Standard" = "நிலையானது" +"Standard ligatures" = "நிலையான லிகேச்சர்கள்" +"Star" = "நட்சத்திரம்" +"Stars" = "நட்சத்திரங்கள்" +"Start" = "தொடங்கு" +"Start ascending from / stop descending at" = "ஏறுமுகம் தொடங்குமிடம் / இறங்குமுகம் நிற்குமிடம்" +"Start from a blank canvas" = "வெற்று கேன்வாஸிலிருந்து தொடங்கு" +"Start from a template" = "டெம்ப்ளேட்டிலிருந்து தொடங்கு" +"Start on path" = "பாதையில் தொடங்கு" +"Start on the Home screen" = "முகப்புத் திரையில் தொடங்கு" +"Start point" = "தொடக்கப் புள்ளி" +"Start sharing" = "பகிரத் தொடங்கு" +"Start sharing with the Share button, then pass on the code it gives" = "பகிர் பொத்தானில் பகிரத் தொடங்கி, அது தரும் குறியீட்டை அனுப்பவும்" +"Start vote" = "வாக்கெடுப்பைத் தொடங்கு" +"Starting to share…" = "பகிரத் தொடங்குகிறது…" +"Status" = "நிலை" +"Sticky" = "ஸ்டிக்கி" +"Sticky note" = "ஸ்டிக்கி நோட்" +"Sticky note colors" = "ஸ்டிக்கி நோட் நிறங்கள்" +"Sticky notes" = "ஸ்டிக்கி நோட்கள்" +"Sticky notes, shapes and connectors" = "ஸ்டிக்கி நோட்கள், வடிவங்கள், கனெக்டர்கள்" +"Stop" = "நிறுத்து" +"Stop following {name}" = "{name} ஐப் பின்தொடர்வதை நிறுத்து" +"Stop session" = "அமர்வை நிறுத்து" +"Stop sharing" = "பகிர்வதை நிறுத்து" +"Stop spotlighting" = "ஸ்பாட்லைட்டை நிறுத்து" +"Stop timer" = "டைமரை நிறுத்து" +"Stop {n} {hex}" = "நிறுத்தம் {n} {hex}" +"Straight" = "நேர்" +"Stretch" = "நீட்டு" +"Strikethrough" = "அடித்தல்" +"String" = "சரம்" +"Stroke" = "ஸ்ட்ரோக்" +"Stroke style" = "ஸ்ட்ரோக் ஸ்டைல்" +"Stroke weight" = "ஸ்ட்ரோக் தடிமன்" +"Strokes" = "ஸ்ட்ரோக்குகள்" +"Strong line every" = "தடித்த கோடு ஒவ்வொரு" +"Style" = "ஸ்டைல்" +"Styles" = "ஸ்டைல்கள்" +"Stylistic set 1" = "ஸ்டைலிஸ்டிக் தொகுப்பு 1" +"Stylistic set 2" = "ஸ்டைலிஸ்டிக் தொகுப்பு 2" +"Stylistic set 3" = "ஸ்டைலிஸ்டிக் தொகுப்பு 3" +"Stylistic set 4" = "ஸ்டைலிஸ்டிக் தொகுப்பு 4" +"Stylistic set 5" = "ஸ்டைலிஸ்டிக் தொகுப்பு 5" +"Subtract" = "கழி" +"Subtracts" = "கழிப்புகள்" +"Suffix" = "பின்னொட்டு" +"Suspend snapping while dragging" = "இழுக்கும்போது ஸ்னாப்பிங்கை நிறுத்திவை" +"Swap instance" = "இன்ஸ்டன்ஸை மாற்று" +"Swap library: use another library's assets of the same names" = "லைப்ரரியை மாற்று: அதே பெயருள்ள மற்றொரு லைப்ரரியின் அசெட்களைப் பயன்படுத்து" +"Swap orientation" = "திசையமைவை மாற்று" +"Swap overlay" = "ஓவர்லேயை மாற்று" +"Swap to {name}" = "{name} க்கு மாற்று" +"Swap width and height" = "அகலத்தையும் உயரத்தையும் இடமாற்று" +"Swapped instance" = "மாற்றிய இன்ஸ்டன்ஸ்" +"Swapped {n} assets" = { one = "{n} அசெட் மாற்றப்பட்டது", other = "{n} அசெட்கள் மாற்றப்பட்டன" } +"Swapped {n} assets; {missed} had no match and still use the old library" = { one = "{n} அசெட் மாற்றப்பட்டது; {missed} பொருந்தவில்லை, இன்னும் பழைய லைப்ரரியைப் பயன்படுத்துகின்றன", other = "{n} அசெட்கள் மாற்றப்பட்டன; {missed} பொருந்தவில்லை, இன்னும் பழைய லைப்ரரியைப் பயன்படுத்துகின்றன" } +"Sweep" = "சுழல்" +"System" = "சிஸ்டம்" +"Tab / Shift+Tab" = "Tab / Shift+Tab" +"Tab or Ctrl+Space again" = "Tab அல்லது Ctrl+Space மீண்டும்" +"Table" = "அட்டவணை" +"Tablet" = "டேப்லெட்" +"Tabular numbers" = "அட்டவணை எண்கள்" +"Take the results off the board; they stay in the file" = "முடிவுகளை போர்டிலிருந்து அகற்று; அவை கோப்பில் இருக்கும்" +"Take the values from the first selected layer" = "முதலில் தேர்ந்தெடுத்த லேயரிலிருந்து மதிப்புகளை எடு" +"Taper" = "குறுக்கம்" +"Taper both ends" = "இரு முனைகளையும் குறுக்கு" +"Tell the server's operator what is wrong with it" = "இதில் என்ன தவறு என்று சர்வர் இயக்குநருக்குத் தெரிவிக்கவும்" +"Temperature" = "வெப்பநிலை" +"Template" = "டெம்ப்ளேட்" +"Templates" = "டெம்ப்ளேட்கள்" +"Terms" = "விதிமுறைகள்" +"Text" = "உரை" +"Text align" = "உரை சீரமைப்பு" +"Text content" = "உரை உள்ளடக்கம்" +"Text direction" = "உரைத் திசை" +"Text on a path" = "பாதையில் உரை" +"Text size" = "உரை அளவு" +"Text style" = "உரை ஸ்டைல்" +"Text styles" = "உரை ஸ்டைல்கள்" +"Texts" = "உரைகள்" +"Texture" = "அமைப்பு" +"The bars are hidden. {shortcut} shows them again" = "பட்டைகள் மறைக்கப்பட்டுள்ளன. {shortcut} அவற்றை மீண்டும் காட்டும்" +"The canvas previews colors in sRGB; exported PNG, JPG and WebP files are tagged Display P3." = "கேன்வாஸ் நிறங்களை sRGB இல் காட்டுகிறது; ஏற்றுமதி செய்த PNG, JPG, WebP கோப்புகள் Display P3 எனக் குறிக்கப்படும்." +"The destination document is unavailable. Nothing was imported." = "இலக்கு ஆவணம் கிடைக்கவில்லை. எதுவும் இறக்குமதி செய்யப்படவில்லை." +"The destination document was closed. Nothing was imported." = "இலக்கு ஆவணம் மூடப்பட்டது. எதுவும் இறக்குமதி செய்யப்படவில்லை." +"The destination page was removed. Nothing was imported." = "இலக்குப் பக்கம் அகற்றப்பட்டது. எதுவும் இறக்குமதி செய்யப்படவில்லை." +"The file is deleted from the server: nobody can open or join it from there again, and this can't be undone. Copies that are open stay with whoever has them." = "கோப்பு சர்வரிலிருந்து நீக்கப்படும்: இனி யாரும் அங்கிருந்து அதைத் திறக்கவோ சேரவோ முடியாது, இதைச் செயல்தவிர்க்க முடியாது. திறந்திருக்கும் நகல்கள் அவற்றை வைத்திருப்பவர்களிடமே இருக்கும்." +"The file now holds another library" = "கோப்பில் இப்போது வேறொரு லைப்ரரி உள்ளது" +"The file now holds another library (\"{name}\")" = "கோப்பில் இப்போது வேறொரு லைப்ரரி உள்ளது (\"{name}\")" +"The files you shared or published online from this computer. They stay on their server until you remove them." = "இந்தக் கணினியிலிருந்து நீங்கள் ஆன்லைனில் பகிர்ந்த அல்லது வெளியிட்ட கோப்புகள். நீங்கள் அகற்றும் வரை அவை அவற்றின் சர்வரில் இருக்கும்." +"The link carries the session's secret: share it only with people you invite." = "இணைப்பில் அமர்வின் ரகசியம் உள்ளது: நீங்கள் அழைக்கும் நபர்களுடன் மட்டும் பகிரவும்." +"The name in your online files and on the server. The document inside keeps its own name." = "உங்கள் ஆன்லைன் கோப்புகளிலும் சர்வரிலும் காட்டப்படும் பெயர். உள்ளே உள்ள ஆவணம் தன் பெயரையே வைத்திருக்கும்." +"The selection uses several text styles: click to apply one" = "தேர்வில் பல உரை ஸ்டைல்கள் உள்ளன: ஒன்றைப் பயன்படுத்தக் கிளிக் செய்யவும்" +"The server deletes this file if nobody opens it before {date}." = "{date} க்குள் யாரும் திறக்காவிட்டால் சர்வர் இந்தக் கோப்பை நீக்கும்." +"The whole file" = "முழுக் கோப்பு" +"The window is too small for {size}%, so the interface is drawn at {drawn}%. Make the window larger to use {size}%." = "{size}% க்குச் சாளரம் மிகச் சிறியது, எனவே இடைமுகம் {drawn}% இல் வரையப்படுகிறது. {size}% ஐப் பயன்படுத்தச் சாளரத்தைப் பெரிதாக்கவும்." +"Theme" = "தீம்" +"There's no destination for that action" = "அந்தச் செயலுக்கு இலக்கு இல்லை" +"Thickness" = "தடிமன்" +"This branch can't be reviewed: {e}" = "இந்தக் கிளையை மதிப்பாய்வு செய்ய முடியாது: {e}" +"This branch was merged or archived." = "இந்தக் கிளை இணைக்கப்பட்டது அல்லது காப்பகப்படுத்தப்பட்டது." +"This computer only" = "இந்தக் கணினி மட்டும்" +"This computer remembers the owner token, so the file can be managed from the home screen's Online list. Copy it to manage the file from somewhere else: it is a password for this file and won't be shown again." = "இந்தக் கணினி உரிமையாளர் டோக்கனை நினைவில் வைத்திருப்பதால், முகப்புத் திரையின் ஆன்லைன் பட்டியலிலிருந்து கோப்பை நிர்வகிக்கலாம். வேறு இடத்திலிருந்து நிர்வகிக்க அதை நகலெடுக்கவும்: இது இந்தக் கோப்பின் கடவுச்சொல், மீண்டும் காட்டப்படாது." +"This condition is edited as an expression" = "இந்த நிபந்தனை எக்ஸ்பிரஷனாகத் திருத்தப்படுகிறது" +"This file" = "இந்தக் கோப்பு" +"This file is on {server}, open only to you. Share it to let others in with a new code." = "இந்தக் கோப்பு {server} இல் உள்ளது, உங்களுக்கு மட்டுமே திறந்திருக்கும். புதிய குறியீட்டுடன் மற்றவர்களை அனுமதிக்க அதைப் பகிரவும்." +"This file is too large to join here (up to {mb} MB)" = "இங்கே சேர இந்தக் கோப்பு மிகப் பெரியது (அதிகபட்சம் {mb} MB)" +"This file uses fonts that aren't installed on this computer. Their text is drawn in a fallback font until you install them." = "இந்தக் கணினியில் நிறுவப்படாத எழுத்துருக்களை இந்தக் கோப்பு பயன்படுத்துகிறது. அவற்றை நிறுவும் வரை உரை மாற்று எழுத்துருவில் வரையப்படும்." +"This file uses team libraries on servers you haven't used here. They aren't contacted until you check them." = "இங்கே நீங்கள் பயன்படுத்தாத சர்வர்களில் உள்ள டீம் லைப்ரரிகளை இந்தக் கோப்பு பயன்படுத்துகிறது. நீங்கள் சரிபார்க்கும் வரை அவை தொடர்புகொள்ளப்படாது." +"This frame is new on the branch." = "இந்த ஃப்ரேம் கிளையில் புதியது." +"This frame isn't on the branch." = "இந்த ஃப்ரேம் கிளையில் இல்லை." +"This link opens a website outside the prototype:" = "இந்த இணைப்பு ப்ரோட்டோடைப்புக்கு வெளியே ஒரு இணையதளத்தைத் திறக்கும்:" +"This link opens your mail app to write a message:" = "இந்த இணைப்பு செய்தி எழுத உங்கள் மின்னஞ்சல் ஆப்பைத் திறக்கும்:" +"This page keeps the owner token only while it is open. Copy it to manage the file later: it is a password for this file and won't be shown again." = "இந்தப் பக்கம் திறந்திருக்கும் வரை மட்டுமே உரிமையாளர் டோக்கனை வைத்திருக்கும். பின்னர் கோப்பை நிர்வகிக்க அதை நகலெடுக்கவும்: இது இந்தக் கோப்பின் கடவுச்சொல், மீண்டும் காட்டப்படாது." +"This server doesn't count detached instances" = "இந்த சர்வர் பிரிக்கப்பட்ட இன்ஸ்டன்ஸ்களைக் கணக்கிடாது" +"This server doesn't count insertions" = "இந்த சர்வர் செருகல்களைக் கணக்கிடாது" +"This server doesn't count styles and variables" = "இந்த சர்வர் ஸ்டைல்களையும் வேரியபிள்களையும் கணக்கிடாது" +"This server is open to the public: no key needed." = "இந்த சர்வர் பொதுமக்களுக்குத் திறந்துள்ளது: கீ தேவையில்லை." +"This server needs its key: add ?key=… to the address (`figcraft-server key` prints it on the server's machine)." = "இந்த சர்வருக்கு அதன் கீ தேவை: முகவரியில் ?key=… ஐச் சேர்க்கவும் (`figcraft-server key` சர்வரின் கணினியில் அதைக் காட்டும்)." +"This server takes files only with its key: see Advanced." = "இந்த சர்வர் அதன் கீ இருந்தால் மட்டுமே கோப்புகளை ஏற்கும்: மேம்பட்டவை பார்க்கவும்." +"This version can't be read." = "இந்தப் பதிப்பைப் படிக்க முடியாது." +"This version doesn't have it: all of it is new." = "இந்தப் பதிப்பில் இது இல்லை: முழுவதும் புதியது." +"Thumbs up" = "கட்டைவிரல் உயர்த்து" +"Tidy up" = "ஒழுங்குபடுத்து" +"Tile" = "டைல்" +"Tile type" = "டைல் வகை" +"Timer" = "டைமர்" +"Tint" = "சாயல்" +"Title" = "தலைப்பு" +"Title case" = "தலைப்பு எழுத்துவடிவம்" +"To share this library with your team, publish the file to a server (Share ▸ Publish to server…), then publish the library there." = "இந்த லைப்ரரியை உங்கள் டீமுடன் பகிர, கோப்பை ஒரு சர்வரில் வெளியிட்டு (பகிர் ▸ சர்வரில் வெளியிடு…), பின்னர் லைப்ரரியை அங்கே வெளியிடவும்." +"To the layer around it" = "சுற்றியுள்ள லேயருக்கு" +"Toggle" = "மாற்று" +"Toggle light/dark theme" = "ஒளிர்வான/இருண்ட தீமை மாற்று" +"Toggle visibility" = "தெரிவுநிலையை மாற்று" +"Tools" = "கருவிகள்" +"Top" = "மேல்" +"Top & bottom" = "மேலும் கீழும்" +"Top left radius" = "மேல் இடது ஆரம்" +"Top padding" = "மேல் பேடிங்" +"Top right radius" = "மேல் வலது ஆரம்" +"Transform" = "உருமாற்றம்" +"Trapezoid" = "சரிவகம்" +"Triangle" = "முக்கோணம்" +"Triangle arrow" = "முக்கோண அம்பு" +"Triangle down" = "கீழ்நோக்கு முக்கோணம்" +"Trigger" = "தூண்டல்" +"Trigger layer" = "தூண்டல் லேயர்" +"True" = "சரி" +"Truncate text" = "உரையைச் சுருக்கு" +"Truncate with an ellipsis" = "நீள்புள்ளியுடன் சுருக்கு" +"Try again" = "மீண்டும் முயல்" +"Try another search or filter." = "வேறு தேடல் அல்லது வடிகட்டியை முயலவும்." +"Try another search, or browse templates." = "வேறு தேடலை முயலவும், அல்லது டெம்ப்ளேட்களைப் பார்க்கவும்." +"Try another word, or look at every kind." = "வேறு சொல்லை முயலவும், அல்லது எல்லா வகைகளையும் பார்க்கவும்." +"Turn a layer into a component, reuse it, and change every copy at once" = "லேயரை காம்போனென்டாக மாற்றி, மீண்டும் பயன்படுத்தி, எல்லா நகல்களையும் ஒரே நேரத்தில் மாற்றவும்" +"Two digits" = "இரு இலக்கங்கள்" +"Type" = "வகை" +"Type settings" = "எழுத்து அமைப்புகள்" +"Type the join code you were given, or paste an invite link." = "உங்களுக்குக் கொடுத்த சேரும் குறியீட்டைத் தட்டச்சு செய்யவும், அல்லது அழைப்பு இணைப்பை ஒட்டவும்." +"Typography" = "எழுத்துக்கலை" +"Underline" = "அடிக்கோடு" +"Undo takes back only your own changes; what others changed since stays." = "செயல்தவிர் உங்கள் மாற்றங்களை மட்டுமே திரும்பப் பெறும்; இடையில் மற்றவர்கள் செய்தவை அப்படியே இருக்கும்." +"Ungroup" = "குழுவைப் பிரி" +"Uniform" = "சீரான" +"Union" = "ஒன்றிணை" +"Unions" = "இணைப்புகள்" +"Unknown — treated as sRGB" = "தெரியவில்லை — sRGB ஆகக் கருதப்படுகிறது" +"Unread" = "படிக்காதவை" +"Unresolve" = "தீர்வை நீக்கு" +"Unsaved changes" = "சேமிக்காத மாற்றங்கள்" +"Unsaved changes in {names}. Save them before closing?" = "{names} இல் சேமிக்காத மாற்றங்கள் உள்ளன. மூடும் முன் சேமிக்கவா?" +"Up" = "மேலே" +"Update" = "புதுப்பி" +"Update check is not supported in the web browser." = "இணைய உலாவியில் புதுப்பிப்புச் சரிபார்ப்பு ஆதரிக்கப்படவில்லை." +"Update from main" = "main இலிருந்து புதுப்பி" +"Update from selection" = "தேர்விலிருந்து புதுப்பி" +"Update plugin" = "ப்ளகினைப் புதுப்பி" +"Updated {components} and {styles}" = "{components}, {styles} புதுப்பிக்கப்பட்டன" +"Updated {name}" = "{name} புதுப்பிக்கப்பட்டது" +"Updating the graphics driver often helps. To use OpenGL only, start FigCraft from a Command Prompt with:" = "கிராஃபிக்ஸ் டிரைவரைப் புதுப்பிப்பது பெரும்பாலும் உதவும். OpenGL மட்டும் பயன்படுத்த, Command Prompt இலிருந்து FigCraft ஐ இவ்வாறு தொடங்கவும்:" +"Updating the graphics driver often helps. WGPU_BACKEND (vulkan, gl, metal) names another graphics API to try." = "கிராஃபிக்ஸ் டிரைவரைப் புதுப்பிப்பது பெரும்பாலும் உதவும். WGPU_BACKEND (vulkan, gl, metal) முயல வேண்டிய வேறொரு கிராஃபிக்ஸ் API ஐக் குறிப்பிடும்." +"Upload from computer" = "கணினியிலிருந்து பதிவேற்று" +"Uploads this file to a FigCraft server and keeps this tab in sync with it. You get a link to edit and a link to view." = "இந்தக் கோப்பை FigCraft சர்வரில் பதிவேற்றி, இந்தத் தாவலை அதனுடன் ஒத்திசைவில் வைக்கும். திருத்த ஒரு இணைப்பும் பார்க்க ஒரு இணைப்பும் கிடைக்கும்." +"Uppercase" = "பெரிய எழுத்து" +"Use a fixed value" = "நிலையான மதிப்பைப் பயன்படுத்து" +"Use an expression, e.g. count + 1" = "எக்ஸ்பிரஷனைப் பயன்படுத்து, எ.கா. count + 1" +"Use as mask" = "மாஸ்க்காகப் பயன்படுத்து" +"Use auto layout" = "ஆட்டோ லேஅவுட்டைப் பயன்படுத்து" +"Use fonts installed on this computer…" = "இந்தக் கணினியில் நிறுவிய எழுத்துருக்களைப் பயன்படுத்து…" +"Use number keys for opacity" = "ஒளிபுகாமைக்கு எண் விசைகளைப் பயன்படுத்து" +"Use the .figcraft or .fig extension." = ".figcraft அல்லது .fig நீட்டிப்பைப் பயன்படுத்தவும்." +"Use the layer's fill" = "லேயரின் ஃபில்லைப் பயன்படுத்து" +"Use your browser's zoom to change the interface size." = "இடைமுக அளவை மாற்ற உங்கள் உலாவியின் ஜூமைப் பயன்படுத்தவும்." +"Used in {files} · {instances}" = "{files} இல் பயன்படுகிறது · {instances}" +"Username" = "பயனர்பெயர்" +"Uses variables: each layer shows them in its own mode" = "வேரியபிள்களைப் பயன்படுத்துகிறது: ஒவ்வொரு லேயரும் தன் சொந்த மோடில் அவற்றைக் காட்டும்" +"Value" = "மதிப்பு" +"Variable" = "வேரியபிள்" +"Variable collections" = "வேரியபிள் தொகுப்புகள்" +"Variable modes" = "வேரியபிள் மோட்கள்" +"Variable width" = "மாறும் அகலம்" +"Variables" = "வேரியபிள்கள்" +"Variables JSON…" = "வேரியபிள்கள் JSON…" +"Variables store reusable values (colours, numbers, strings, booleans) with modes such as Light and Dark." = "வேரியபிள்கள் மீண்டும் பயன்படுத்தக்கூடிய மதிப்புகளை (நிறங்கள், எண்கள், சரங்கள், பூலியன்கள்) ஒளிர்வான, இருண்ட போன்ற மோட்களுடன் சேமிக்கும்." +"Variant" = "வேரியன்ட்" +"Vector" = "வெக்டர்" +"Vectors" = "வெக்டர்கள்" +"Version" = "பதிப்பு" +"Version history" = "பதிப்பு வரலாறு" +"Version {version}" = "பதிப்பு {version}" +"Version {v} · {components} · {styles} · {variables}" = "பதிப்பு {v} · {components} · {styles} · {variables}" +"Vertical" = "செங்குத்து" +"Vertical align" = "செங்குத்து சீரமைப்பு" +"Vertical hex" = "செங்குத்து அறுகோணம்" +"Vertical padding" = "செங்குத்து பேடிங்" +"Vertical spacing" = "செங்குத்து இடைவெளி" +"Vertical trim" = "செங்குத்து ட்ரிம்" +"View" = "பார்" +"View link" = "பார்வை இணைப்பு" +"View link copied" = "பார்வை இணைப்பு நகலெடுக்கப்பட்டது" +"View only" = "பார்வை மட்டும்" +"View only: you see every change as it happens but can't edit. Leave to keep a copy you can edit." = "பார்வை மட்டும்: ஒவ்வொரு மாற்றத்தையும் நடக்கும்போதே பார்க்கலாம், ஆனால் திருத்த முடியாது. திருத்தக்கூடிய நகலை வைத்திருக்க வெளியேறவும்." +"Viewing “{name}”" = "“{name}” ஐப் பார்க்கிறீர்கள்" +"Violet" = "ஊதா" +"Visibility" = "தெரிவுநிலை" +"Visible" = "தெரியும்" +"Vivid" = "அடர்" +"Votes per person" = "ஒருவருக்கான வாக்குகள்" +"Voting session" = "வாக்கெடுப்பு அமர்வு" +"WGPU_BACKEND is set and names the graphics API to use; unsetting it lets FigCraft choose." = "WGPU_BACKEND அமைக்கப்பட்டு, பயன்படுத்த வேண்டிய கிராஃபிக்ஸ் API ஐக் குறிப்பிடுகிறது; அதை நீக்கினால் FigCraft தானே தேர்ந்தெடுக்கும்." +"Warm" = "வெதுவெதுப்பு" +"Watch" = "கவனி" +"Wavy" = "அலை" +"Web" = "இணையம்" +"WebSocket URL" = "WebSocket URL" +"WebSocket URL copied" = "WebSocket URL நகலெடுக்கப்பட்டது" +"Websites" = "இணையதளங்கள்" +"Wedge" = "ஆப்பு" +"Weekly planner" = "வாராந்திரத் திட்டமிடல்" +"Weight" = "தடிமன்" +"What changed since a saved version" = "சேமித்த பதிப்பிலிருந்து என்ன மாறியது" +"What changed since it was marked ready for dev" = "டெவ்-க்குத் தயார் எனக் குறித்ததிலிருந்து என்ன மாறியது" +"What is wrong with this file? The server's operator gets your report." = "இந்தக் கோப்பில் என்ன தவறு? உங்கள் அறிக்கை சர்வர் இயக்குநருக்குச் செல்லும்." +"What it's for" = "இது எதற்காக" +"What this changed from isn't known: it changed before FigCraft kept a copy of ready-for-dev frames. Resolve the change (or mark it ready again) to compare from now on." = "இது எதிலிருந்து மாறியது எனத் தெரியவில்லை: டெவ்-க்குத் தயாரான ஃப்ரேம்களின் நகலை FigCraft வைக்கத் தொடங்கும் முன்பே இது மாறியது. இனிமேல் ஒப்பிட, மாற்றத்தைத் தீர்க்கவும் (அல்லது மீண்டும் தயார் எனக் குறிக்கவும்)." +"What you try here changes this preview and the code below, not the file" = "இங்கே முயல்வது இந்த முன்னோட்டத்தையும் கீழே உள்ள குறியீட்டையும் மாற்றும், கோப்பை அல்ல" +"When marked ready" = "தயார் எனக் குறித்தபோது" +"While hovering" = "ஹோவர் செய்யும்போது" +"While pressing" = "அழுத்தும்போது" +"White" = "வெள்ளை" +"Who runs it, its terms and how long it keeps files" = "யார் இயக்குகிறார்கள், விதிமுறைகள், கோப்புகளை எவ்வளவு காலம் வைத்திருக்கும்" +"Whole screen" = "முழுத் திரை" +"Why it changed" = "இது ஏன் மாறியது" +"Widget" = "விட்ஜெட்" +"Widgets" = "விட்ஜெட்கள்" +"Width" = "அகலம்" +"Width point" = "அகலப் புள்ளி" +"Width profile" = "அகல சுயவிவரம்" +"Wireframe kit" = "வயர்ஃப்ரேம் கிட்" +"With the layers' export settings" = "லேயர்களின் ஏற்றுமதி அமைப்புகளுடன்" +"Wrap" = "மடி" +"Wrap in new section" = "புதிய செக்ஷனில் வை" +"Wrap style" = "மடிப்பு ஸ்டைல்" +"Yellow" = "மஞ்சள்" +"Yesterday" = "நேற்று" +"You" = "நீங்கள்" +"You'll get the shared file as a new tab and edit it together." = "பகிரப்பட்ட கோப்பு புதிய தாவலாகக் கிடைக்கும், சேர்ந்து திருத்தலாம்." +"You're spotlighting: everyone follows your view" = "நீங்கள் ஸ்பாட்லைட் செய்கிறீர்கள்: அனைவரும் உங்கள் பார்வையைப் பின்தொடர்கிறார்கள்" +"Your copy of the file stays open" = "உங்கள் கோப்பு நகல் திறந்தே இருக்கும்" +"Your copy stays open; the file stays on the server" = "உங்கள் நகல் திறந்தே இருக்கும்; கோப்பு சர்வரில் இருக்கும்" +"Your name" = "உங்கள் பெயர்" +"Your system asks for reduced motion: animations stay off." = "உங்கள் சிஸ்டம் குறைந்த அசைவைக் கேட்கிறது: அனிமேஷன்கள் முடக்கத்தில் இருக்கும்." +"Your unsaved files were too large for the browser to keep." = "சேமிக்காத உங்கள் கோப்புகள் உலாவி வைத்திருக்க முடியாத அளவுக்குப் பெரியவை." +"Z" = "Z" +"Z to A" = "Z முதல் A வரை" +"Zoom" = "ஜூம்" +"Zoom around the pointer" = "பாயிண்டரைச் சுற்றி ஜூம் செய்" +"Zoom device to fill window" = "சாளரத்தை நிரப்ப சாதனத்தை ஜூம் செய்" +"Zoom in" = "பெரிதாக்கு" +"Zoom out" = "சிறிதாக்கு" +"Zoom to 100%" = "100% க்கு ஜூம் செய்" +"Zoom to 200%" = "200% க்கு ஜூம் செய்" +"Zoom to 50%" = "50% க்கு ஜூம் செய்" +"Zoom to fit" = "பொருந்தும்படி ஜூம் செய்" +"Zoom to selection" = "தேர்வுக்கு ஜூம் செய்" +"Zoom tool: click to zoom in, drag an area" = "ஜூம் கருவி: பெரிதாக்கக் கிளிக் செய்யவும், ஒரு பகுதியை இழுக்கவும்" +"Zoom tool: zoom out" = "ஜூம் கருவி: சிறிதாக்கு" +"and {n} more" = { one = "மேலும் {n}", other = "மேலும் {n}" } +"bleed marks" = "ப்ளீட் குறிகள்" +"by {author}" = "{author} உருவாக்கியது" +"call any command its access allows" = "அணுகல் அனுமதிக்கும் எந்தக் கட்டளையையும் அழைக்கலாம்" +"call only: {commands}" = "இவற்றை மட்டும் அழைக்கலாம்: {commands}" +"can edit the document" = "ஆவணத்தைத் திருத்தலாம்" +"can save files" = "கோப்புகளைச் சேமிக்கலாம்" +"conditional prototype actions nested too deeply were skipped" = "மிக ஆழமாக உள்ளமைந்த நிபந்தனை ப்ரோட்டோடைப் செயல்கள் தவிர்க்கப்பட்டன" +"conditional prototype actions with conditions that can't be evaluated were skipped" = "மதிப்பிட முடியாத நிபந்தனைகளுடன் உள்ள நிபந்தனை ப்ரோட்டோடைப் செயல்கள் தவிர்க்கப்பட்டன" +"connector label background was skipped: style data is missing" = "கனெக்டர் லேபிள் பின்னணி தவிர்க்கப்பட்டது: ஸ்டைல் தரவு இல்லை" +"connector label was skipped: background bounds are invalid" = "கனெக்டர் லேபிள் தவிர்க்கப்பட்டது: பின்னணி எல்லைகள் தவறானவை" +"connector label was skipped: background transform is invalid" = "கனெக்டர் லேபிள் தவிர்க்கப்பட்டது: பின்னணி உருமாற்றம் தவறானது" +"connector label was skipped: composed text transform is invalid" = "கனெக்டர் லேபிள் தவிர்க்கப்பட்டது: இணைந்த உரை உருமாற்றம் தவறானது" +"connector label was skipped: derived background bounds are missing" = "கனெக்டர் லேபிள் தவிர்க்கப்பட்டது: பெறப்பட்ட பின்னணி எல்லைகள் இல்லை" +"connector label was skipped: derived text bounds are missing" = "கனெக்டர் லேபிள் தவிர்க்கப்பட்டது: பெறப்பட்ட உரை எல்லைகள் இல்லை" +"connector label was skipped: text bounds are invalid" = "கனெக்டர் லேபிள் தவிர்க்கப்பட்டது: உரை எல்லைகள் தவறானவை" +"connector label was skipped: text style data is missing" = "கனெக்டர் லேபிள் தவிர்க்கப்பட்டது: உரை ஸ்டைல் தரவு இல்லை" +"connector label was skipped: text transform is invalid" = "கனெக்டர் லேபிள் தவிர்க்கப்பட்டது: உரை உருமாற்றம் தவறானது" +"connector labels were skipped" = "கனெக்டர் லேபிள்கள் தவிர்க்கப்பட்டன" +"connector labels without a saved snapshot are centred on the line, without their background" = "சேமித்த ஸ்னாப்ஷாட் இல்லாத கனெக்டர் லேபிள்கள் பின்னணி இல்லாமல் கோட்டின் மையத்தில் வைக்கப்படும்" +"connector layers import as static frame/vector snapshots with labels when present; live endpoint bindings are not retained" = "கனெக்டர் லேயர்கள் நிலையான ஃப்ரேம்/வெக்டர் ஸ்னாப்ஷாட்களாக, லேபிள்கள் இருந்தால் அவற்றுடன், இறக்குமதியாகும்; நேரடி முனை இணைப்புகள் தக்கவைக்கப்படாது" +"connector snapshot vector data is missing; connector was left empty" = "கனெக்டர் ஸ்னாப்ஷாட் வெக்டர் தரவு இல்லை; கனெக்டர் காலியாக விடப்பட்டது" +"connectors whose ends can't be placed are empty" = "முனைகளை வைக்க முடியாத கனெக்டர்கள் காலியாக இருக்கும்" +"crop marks" = "வெட்டுக் குறிகள்" +"damaged vector geometry was skipped" = "சேதமடைந்த வெக்டர் வடிவியல் தவிர்க்கப்பட்டது" +"damaged vector networks import as outlines" = "சேதமடைந்த வெக்டர் நெட்வொர்க்குகள் அவுட்லைன்களாக இறக்குமதியாகும்" +"development: {path}" = "டெவலப்மென்ட்: {path}" +"document children other than pages were skipped" = "பக்கங்கள் அல்லாத ஆவணச் சைல்ட் உறுப்புகள் தவிர்க்கப்பட்டன" +"duplicate grid track sizing entries use equal tracks" = "நகல் கட்ட டிராக் அளவு உள்ளீடுகள் சம டிராக்குகளைப் பயன்படுத்தும்" +"e.g. count + 1" = "எ.கா. count + 1" +"e.g. count >= 3 and not done" = "எ.கா. count >= 3 and not done" +"elbowed and curved connectors without a saved path follow FigCraft's own routing" = "சேமித்த பாதை இல்லாத வளைந்த மற்றும் மடிந்த கனெக்டர்கள் FigCraft-இன் சொந்த வழித்தடத்தைப் பின்பற்றும்" +"entries without a node type were skipped" = "நோட் வகை இல்லாத உள்ளீடுகள் தவிர்க்கப்பட்டன" +"figcraft:// links from a browser, chat or email open this app and join the session." = "உலாவி, அரட்டை அல்லது மின்னஞ்சலில் உள்ள figcraft:// இணைப்புகள் இந்த ஆப்ஸைத் திறந்து அமர்வில் சேர்க்கும்." +"from {server}" = "{server} இலிருந்து" +"gamepad triggers without exactly one known controller button were skipped" = "சரியாக ஒரு அறியப்பட்ட கன்ட்ரோலர் பொத்தான் இல்லாத கேம்பேட் ட்ரிகர்கள் தவிர்க்கப்பட்டன" +"grid track list exceeds 1000 entries; the tracks use the default equal sizing" = "கட்டத் தடப் பட்டியல் 1000 உள்ளீடுகளைத் தாண்டுகிறது; தடங்கள் இயல்புநிலை சம அளவைப் பயன்படுத்துகின்றன" +"grid track sizing is unsupported or malformed; affected tracks use equal sizing" = "கட்டத் தட அளவு ஆதரிக்கப்படவில்லை அல்லது தவறாக உள்ளது; பாதிக்கப்பட்ட தடங்கள் சம அளவைப் பயன்படுத்துகின்றன" +"grid track sizing list exceeds 1000 entries; the tracks use the default equal sizing" = "கட்டத் தட அளவுப் பட்டியல் 1000 உள்ளீடுகளைத் தாண்டுகிறது; தடங்கள் இயல்புநிலை சம அளவைப் பயன்படுத்துகின்றன" +"hidden" = "மறைக்கப்பட்டது" +"iOS" = "iOS" +"image fills whose image isn't in the file show a missing-image placeholder and keep its name" = "கோப்பில் இல்லாத படங்களைக் கொண்ட பட ஃபில்கள், விடுபட்ட-படக் குறியிடத்தைக் காட்டி அதன் பெயரை வைத்திருக்கும்" +"image filters are ambiguous because both filter containers are present; filter conversion was skipped" = "இரண்டு ஃபில்டர் கொள்கலன்களும் இருப்பதால் பட ஃபில்டர்கள் தெளிவற்றவை; ஃபில்டர் மாற்றம் தவிர்க்கப்பட்டது" +"image filters use FigCraft's approximate renderer" = "பட ஃபில்டர்கள் FigCraft-இன் தோராயமான ரெண்டரரைப் பயன்படுத்துகின்றன" +"instance swap properties whose default component isn't in the file were skipped" = "இயல்புநிலை காம்போனென்ட் கோப்பில் இல்லாத இன்ஸ்டன்ஸ் மாற்றுப் பண்புகள் தவிர்க்கப்பட்டன" +"instance swap properties whose default component was past the layer limit were skipped" = "இயல்புநிலை காம்போனென்ட் லேயர் வரம்பைத் தாண்டிய இன்ஸ்டன்ஸ் மாற்றுப் பண்புகள் தவிர்க்கப்பட்டன" +"instances inside their own main component were imported as frames" = "தங்கள் சொந்த முதன்மை காம்போனென்ட்டுக்குள் உள்ள இன்ஸ்டன்ஸ்கள் ஃப்ரேம்களாக இறக்குமதி செய்யப்பட்டன" +"instances of components that aren't in the file show no layers" = "கோப்பில் இல்லாத காம்போனென்ட்களின் இன்ஸ்டன்ஸ்கள் எந்த லேயரையும் காட்டாது" +"instances of components that aren't in the file were imported as frames" = "கோப்பில் இல்லாத காம்போனென்ட்களின் இன்ஸ்டன்ஸ்கள் ஃப்ரேம்களாக இறக்குமதி செய்யப்பட்டன" +"instances that would nest a component inside itself were imported as frames" = "ஒரு காம்போனென்ட்டை அதற்குள்ளேயே அடுக்கும் இன்ஸ்டன்ஸ்கள் ஃப்ரேம்களாக இறக்குமதி செய்யப்பட்டன" +"instances whose component was past the layer limit were imported as frames" = "காம்போனென்ட் லேயர் வரம்பைத் தாண்டிய இன்ஸ்டன்ஸ்கள் ஃப்ரேம்களாக இறக்குமதி செய்யப்பட்டன" +"instances without a main component were imported as empty frames" = "முதன்மை காம்போனென்ட் இல்லாத இன்ஸ்டன்ஸ்கள் வெற்று ஃப்ரேம்களாக இறக்குமதி செய்யப்பட்டன" +"invalid internal .fig text path data was ignored" = "தவறான உள் .fig உரைப் பாதைத் தரவு புறக்கணிக்கப்பட்டது" +"invalid or oversized vector networks import as outlines" = "தவறான அல்லது மிகப் பெரிய வெக்டர் நெட்வொர்க்குகள் அவுட்லைன்களாக இறக்குமதியாகும்" +"invalid or oversized vector path data was skipped" = "தவறான அல்லது மிகப் பெரிய வெக்டர் பாதைத் தரவு தவிர்க்கப்பட்டது" +"invalid vector region fill paint list; layer fill used" = "தவறான வெக்டர் பகுதி ஃபில் பெயிண்ட் பட்டியல்; லேயர் ஃபில் பயன்படுத்தப்பட்டது" +"invalid vector region paints were skipped" = "தவறான வெக்டர் பகுதி பெயிண்ட்கள் தவிர்க்கப்பட்டன" +"just now" = "இப்போதுதான்" +"key triggers without a supported key were skipped" = "ஆதரிக்கப்படும் விசை இல்லாத விசை ட்ரிகர்கள் தவிர்க்கப்பட்டன" +"key up triggers import as key presses" = "விசை விடுவிப்பு ட்ரிகர்கள் விசை அழுத்தங்களாக இறக்குமதியாகும்" +"layers without a position were placed at their parent's origin" = "நிலை இல்லாத லேயர்கள் அவற்றின் பேரன்ட் லேயரின் தொடக்கப் புள்ளியில் வைக்கப்பட்டன" +"layers without a type were skipped" = "வகை இல்லாத லேயர்கள் தவிர்க்கப்பட்டன" +"legacy image filter container is unsupported; filter conversion was skipped" = "பழைய பட ஃபில்டர் கொள்கலன் ஆதரிக்கப்படவில்லை; ஃபில்டர் மாற்றம் தவிர்க்கப்பட்டது" +"linked vector region fill styles keep resolved appearance; live style links were left out" = "இணைக்கப்பட்ட வெக்டர் பகுதி ஃபில் ஸ்டைல்கள் தீர்க்கப்பட்ட தோற்றத்தை வைத்திருக்கும்; நேரலை ஸ்டைல் இணைப்புகள் விடுபட்டன" +"links to shared styles that aren't in the file kept the layers' own values" = "கோப்பில் இல்லாத பகிர்ந்த ஸ்டைல்களுக்கான இணைப்புகள், லேயர்களின் சொந்த மதிப்புகளை வைத்திருந்தன" +"locked" = "பூட்டப்பட்டது" +"malformed image filters container was skipped" = "தவறான வடிவிலான பட ஃபில்டர் கொள்கலன் தவிர்க்கப்பட்டது" +"malformed image paintFilter container was skipped" = "தவறான வடிவிலான பட paintFilter கொள்கலன் தவிர்க்கப்பட்டது" +"malformed slot content assignment was skipped" = "தவறான வடிவிலான ஸ்லாட் உள்ளடக்க ஒதுக்கீடு தவிர்க்கப்பட்டது" +"no bleed" = "ப்ளீட் இல்லை" +"nobody else here yet" = "இங்கே இன்னும் வேறு யாரும் இல்லை" +"non-default slot settings are not represented and were skipped" = "இயல்புநிலை அல்லாத ஸ்லாட் அமைப்புகள் குறிப்பிடப்படவில்லை, அவை தவிர்க்கப்பட்டன" +"note or shape generated child has invalid bounds; child skipped" = "குறிப்பு அல்லது வடிவம் உருவாக்கிய துணை உறுப்பின் எல்லைகள் தவறானவை; துணை உறுப்பு தவிர்க்கப்பட்டது" +"note or shape generated child is missing its style or bounds; child skipped" = "குறிப்பு அல்லது வடிவம் உருவாக்கிய துணை உறுப்பில் ஸ்டைல் அல்லது எல்லைகள் இல்லை; துணை உறுப்பு தவிர்க்கப்பட்டது" +"note or shape generated children exceed the layer or nesting limit; remaining children skipped" = "குறிப்பு அல்லது வடிவம் உருவாக்கிய துணை உறுப்புகள் லேயர் அல்லது அடுக்கு வரம்பைத் தாண்டுகின்றன; மீதமுள்ளவை தவிர்க்கப்பட்டன" +"note or shape generated layout is missing or unsupported; using its outer frame" = "குறிப்பு அல்லது வடிவம் உருவாக்கிய லேஅவுட் இல்லை அல்லது ஆதரிக்கப்படவில்லை; வெளிப்புற ஃப்ரேம் பயன்படுத்தப்படுகிறது" +"now" = "இப்போது" +"offer files to save if it asks to (you choose where each one goes)" = "அது கேட்டால் சேமிக்கக் கோப்புகளை வழங்கும் (ஒவ்வொன்றும் எங்கே செல்லும் என்பதை நீங்கள் தேர்வுசெய்யலாம்)" +"only in a text style or variable" = "உரை ஸ்டைல் அல்லது வேரியபிளில் மட்டும்" +"or" = "அல்லது" +"point stroke joins were preserved; dashed or variable-width strokes render with the layer join" = "புள்ளி ஸ்ட்ரோக் இணைப்புகள் தக்கவைக்கப்பட்டன; கோடிட்ட அல்லது மாறும்-அகல ஸ்ட்ரோக்குகள் லேயர் இணைப்புடன் ரெண்டர் ஆகும்" +"preferred slot component keys cannot be resolved to file nodes and were skipped" = "விருப்ப ஸ்லாட் காம்போனென்ட் விசைகளைக் கோப்பு நோட்களுடன் பொருத்த முடியவில்லை, அவை தவிர்க்கப்பட்டன" +"prototype actions of unknown types were skipped" = "அறியப்படாத வகை ப்ரோட்டோடைப் செயல்கள் தவிர்க்கப்பட்டன" +"prototype actions without a destination in the file were skipped" = "கோப்பில் இலக்கு இல்லாத ப்ரோட்டோடைப் செயல்கள் தவிர்க்கப்பட்டன" +"prototype expressions on variables that aren't in the variables JSON were skipped" = "variables JSON-இல் இல்லாத வேரியபிள்கள் மீதான ப்ரோட்டோடைப் எக்ஸ்பிரஷன்கள் தவிர்க்கப்பட்டன" +"prototype expressions with unsupported functions were skipped" = "ஆதரிக்கப்படாத செயல்பாடுகளைக் கொண்ட ப்ரோட்டோடைப் எக்ஸ்பிரஷன்கள் தவிர்க்கப்பட்டன" +"prototype interactions without supported actions were skipped" = "ஆதரிக்கப்படும் செயல்கள் இல்லாத ப்ரோட்டோடைப் இன்டராக்ஷன்கள் தவிர்க்கப்பட்டன" +"prototype navigations of unknown types were skipped" = "அறியப்படாத வகை ப்ரோட்டோடைப் வழிசெலுத்தல்கள் தவிர்க்கப்பட்டன" +"prototype transitions of unknown types play instantly" = "அறியப்படாத வகை ப்ரோட்டோடைப் மாற்றங்கள் உடனடியாக இயங்கும்" +"prototype triggers of unknown types were skipped" = "அறியப்படாத வகை ப்ரோட்டோடைப் ட்ரிகர்கள் தவிர்க்கப்பட்டன" +"put a widget on the canvas" = "கேன்வாஸில் ஒரு விட்ஜெட்டை வைக்கும்" +"read and edit the document" = "ஆவணத்தைப் படித்துத் திருத்தும்" +"read the document" = "ஆவணத்தைப் படிக்கும்" +"reads the document" = "ஆவணத்தைப் படிக்கிறது" +"set-variable actions on variables that aren't in the variables JSON were skipped" = "variables JSON-இல் இல்லாத வேரியபிள்கள் மீதான வேரியபிள்-அமை செயல்கள் தவிர்க்கப்பட்டன" +"set-variable actions with values that can't be evaluated were skipped" = "மதிப்பிட முடியாத மதிப்புகளைக் கொண்ட வேரியபிள்-அமை செயல்கள் தவிர்க்கப்பட்டன" +"set-variable actions with values that don't fit the variable were skipped" = "வேரியபிளுக்குப் பொருந்தாத மதிப்புகளைக் கொண்ட வேரியபிள்-அமை செயல்கள் தவிர்க்கப்பட்டன" +"set-variable actions without a value were skipped" = "மதிப்பு இல்லாத வேரியபிள்-அமை செயல்கள் தவிர்க்கப்பட்டன" +"set-variable-mode actions on collections or modes that aren't in the variables JSON were skipped" = "variables JSON-இல் இல்லாத தொகுப்புகள் அல்லது மோட்கள் மீதான வேரியபிள்-மோட்-அமை செயல்கள் தவிர்க்கப்பட்டன" +"shape generated outline is missing or damaged; using its rectangle" = "வடிவம் உருவாக்கிய அவுட்லைன் இல்லை அல்லது சேதமடைந்துள்ளது; அதன் செவ்வகம் பயன்படுத்தப்படுகிறது" +"slot content assignment target is missing or is not slot content" = "ஸ்லாட் உள்ளடக்க ஒதுக்கீட்டு இலக்கு இல்லை அல்லது அது ஸ்லாட் உள்ளடக்கம் அல்ல" +"slot content assignment uses the empty GUID sentinel and was skipped" = "ஸ்லாட் உள்ளடக்க ஒதுக்கீடு வெற்று GUID குறியைப் பயன்படுத்துவதால் தவிர்க்கப்பட்டது" +"slot layers without a matching slot property were imported as frames" = "பொருந்தும் ஸ்லாட் பண்பு இல்லாத ஸ்லாட் லேயர்கள் ஃப்ரேம்களாக இறக்குமதி செய்யப்பட்டன" +"some vector points refer to point settings missing from the file; they use the layer's joins and plain corners" = "சில வெக்டர் புள்ளிகள் கோப்பில் இல்லாத புள்ளி அமைப்புகளைக் குறிக்கின்றன; அவை லேயரின் இணைப்புகளையும் சாதாரண மூலைகளையும் பயன்படுத்துகின்றன" +"some vector segments refer to style settings missing from the file; they use the layer's stroke" = "சில வெக்டர் பிரிவுகள் கோப்பில் இல்லாத ஸ்டைல் அமைப்புகளைக் குறிக்கின்றன; அவை லேயரின் ஸ்ட்ரோக்கைப் பயன்படுத்துகின்றன" +"stale or invalid grid track sizing entries were ignored" = "பழைய அல்லது தவறான கட்டத் தட அளவு உள்ளீடுகள் புறக்கணிக்கப்பட்டன" +"stars and polygons without point counts or geometry use the default point count" = "புள்ளி எண்ணிக்கை அல்லது வடிவியல் இல்லாத நட்சத்திரங்களும் பலகோணங்களும் இயல்புநிலை புள்ளி எண்ணிக்கையைப் பயன்படுத்துகின்றன" +"style settings of some vector segments aren't supported; those segments use the layer's stroke" = "சில வெக்டர் பிரிவுகளின் ஸ்டைல் அமைப்புகள் ஆதரிக்கப்படவில்லை; அந்தப் பிரிவுகள் லேயரின் ஸ்ட்ரோக்கைப் பயன்படுத்துகின்றன" +"text path underline or strikethrough decoration is not rendered" = "உரைப் பாதையின் அடிக்கோடு அல்லது குறுக்குக்கோடு அலங்காரம் ரெண்டர் செய்யப்படவில்லை" +"text style overrides refer to missing table entries" = "உரை ஸ்டைல் ஓவர்ரைடுகள் இல்லாத அட்டவணை உள்ளீடுகளைக் குறிக்கின்றன" +"the file has no pages" = "கோப்பில் பக்கங்கள் இல்லை" +"the plugin" = "ப்ளகின்" +"the variables JSON has no `variableCollections` (expected the local variables response) and was ignored" = "variables JSON-இல் `variableCollections` இல்லை (லோக்கல் வேரியபிள்கள் பதில் எதிர்பார்க்கப்பட்டது), எனவே புறக்கணிக்கப்பட்டது" +"this session only" = "இந்த அமர்வுக்கு மட்டும்" +"unknown component property types were skipped" = "அறியப்படாத காம்போனென்ட் பண்பு வகைகள் தவிர்க்கப்பட்டன" +"variable aliases to variables that aren't in the variables JSON (or of another type) were skipped" = "variables JSON-இல் இல்லாத (அல்லது வேறு வகையான) வேரியபிள்களுக்கான வேரியபிள் மாற்றுப்பெயர்கள் தவிர்க்கப்பட்டன" +"variable bindings to properties the layer doesn't have were skipped" = "லேயரில் இல்லாத பண்புகளுக்கான வேரியபிள் இணைப்புகள் தவிர்க்கப்பட்டன" +"variable bindings to variables that aren't in the variables JSON (library variables) were skipped" = "variables JSON-இல் இல்லாத வேரியபிள்களுக்கான (லைப்ரரி வேரியபிள்கள்) வேரியபிள் இணைப்புகள் தவிர்க்கப்பட்டன" +"variable bindings were skipped: the file JSON has no variable definitions (pass the local variables JSON as `variables`, or embed its `meta` next to the file JSON)" = "வேரியபிள் இணைப்புகள் தவிர்க்கப்பட்டன: கோப்பு JSON-இல் வேரியபிள் வரையறைகள் இல்லை (லோக்கல் variables JSON-ஐ `variables` ஆக வழங்கவும், அல்லது அதன் `meta`-வைக் கோப்பு JSON-உடன் சேர்க்கவும்)" +"variable bindings whose variable type doesn't fit the property were skipped" = "வேரியபிள் வகை பண்புக்குப் பொருந்தாத வேரியபிள் இணைப்புகள் தவிர்க்கப்பட்டன" +"variable collections without modes were skipped" = "மோட்கள் இல்லாத வேரியபிள் தொகுப்புகள் தவிர்க்கப்பட்டன" +"variable mode lookups in prototype expressions that aren't a variable and one of its modes were skipped" = "ப்ரோட்டோடைப் எக்ஸ்பிரஷன்களில் ஒரு வேரியபிளும் அதன் ஒரு மோடும் அல்லாத வேரியபிள் மோட் தேடல்கள் தவிர்க்கப்பட்டன" +"variable modes of collections that aren't in the file were skipped" = "கோப்பில் இல்லாத தொகுப்புகளின் வேரியபிள் மோட்கள் தவிர்க்கப்பட்டன" +"variable modes of collections that aren't in the variables JSON were skipped" = "variables JSON-இல் இல்லாத தொகுப்புகளின் வேரியபிள் மோட்கள் தவிர்க்கப்பட்டன" +"variable values that don't match their type (or composed colours) were skipped" = "வகைக்குப் பொருந்தாத வேரியபிள் மதிப்புகள் (அல்லது கலப்பு நிறங்கள்) தவிர்க்கப்பட்டன" +"variable-bound vector region paints keep resolved appearance; live bindings were left out" = "வேரியபிள் இணைந்த வெக்டர் பகுதி பெயிண்ட்கள் தீர்க்கப்பட்ட தோற்றத்தை வைத்திருக்கும்; நேரலை இணைப்புகள் விடுபட்டன" +"variables of unknown types were skipped" = "அறியப்படாத வகை வேரியபிள்கள் தவிர்க்கப்பட்டன" +"variables whose collection isn't in the variables JSON were skipped" = "தொகுப்பு variables JSON-இல் இல்லாத வேரியபிள்கள் தவிர்க்கப்பட்டன" +"variables without readable values were skipped" = "படிக்கக்கூடிய மதிப்புகள் இல்லாத வேரியபிள்கள் தவிர்க்கப்பட்டன" +"vector points with unknown stroke joins use the layer join" = "அறியப்படாத ஸ்ட்ரோக் இணைப்புகள் கொண்ட வெக்டர் புள்ளிகள் லேயர் இணைப்பைப் பயன்படுத்துகின்றன" +"vector region paint data exceeded import limits and was skipped" = "வெக்டர் பகுதி பெயிண்ட் தரவு இறக்குமதி வரம்புகளைத் தாண்டியதால் தவிர்க்கப்பட்டது" +"vector region references a missing fill style; layer fill used" = "வெக்டர் பகுதி இல்லாத ஃபில் ஸ்டைலைக் குறிக்கிறது; லேயர் ஃபில் பயன்படுத்தப்பட்டது" +"vectors without geometry are empty" = "வடிவியல் இல்லாத வெக்டர்கள் காலியாக உள்ளன" +"vectors without geometry are empty (export the file JSON with geometry=paths)" = "வடிவியல் இல்லாத வெக்டர்கள் காலியாக உள்ளன (கோப்பு JSON-ஐ geometry=paths உடன் ஏற்றுமதி செய்யவும்)" +"very long text was cut to 1,048,576 characters" = "மிக நீண்ட உரை 1,048,576 எழுத்துகளாகக் குறைக்கப்பட்டது" +"very long vector paths were skipped" = "மிக நீண்ட வெக்டர் பாதைகள் தவிர்க்கப்பட்டன" +"video actions are not supported and were skipped" = "வீடியோ செயல்கள் ஆதரிக்கப்படாததால் தவிர்க்கப்பட்டன" +"video triggers are not supported and were skipped" = "வீடியோ ட்ரிகர்கள் ஆதரிக்கப்படாததால் தவிர்க்கப்பட்டன" +"yesterday" = "நேற்று" +"{count} in it now · Changed {date}" = "இப்போது இதில் {count} · {date} அன்று மாற்றப்பட்டது" +"{insertions} · {detachments}" = "{insertions} · {detachments}" +"{instances} in {files}" = "{files} இல் {instances}" +"{language}: draft translation, waiting for a native speaker's review." = "{language}: வரைவு மொழிபெயர்ப்பு, தாய்மொழியாளர் மதிப்பாய்வுக்குக் காத்திருக்கிறது." +"{length} bleed" = "{length} ப்ளீட்" +"{month} {day}, {year}" = "{month} {day}, {year}" +"{name}\nClick to apply to the selection" = "{name}\nதேர்வுக்குப் பயன்படுத்தக் கிளிக் செய்யவும்" +"{name}\nDrag onto the canvas, or click to place in the middle of the view.\nHold Alt (Option) while dropping onto an instance to swap it." = "{name}\nகேன்வாஸுக்கு இழுக்கவும், அல்லது காட்சியின் நடுவில் வைக்கக் கிளிக் செய்யவும்.\nஒரு இன்ஸ்டன்ஸை மாற்ற, அதன் மீது விடும்போது Alt (Option) ஐ அழுத்திப் பிடிக்கவும்." +"{name} (from {library})" = "{name} ({library} இலிருந்து)" +"{name} (you)" = "{name} (நீங்கள்)" +"{name} ({layers} layers)" = "{name} ({layers} லேயர்கள்)" +"{name} ({tag}): {min} – {max}, default {default}. Double-click the slider to go back to the style's value; Escape while dragging cancels." = "{name} ({tag}): {min} – {max}, இயல்புநிலை {default}. ஸ்டைலின் மதிப்புக்குத் திரும்ப ஸ்லைடரை இருமுறை கிளிக் செய்யவும்; இழுக்கும்போது Escape அழுத்தினால் ரத்தாகும்." +"{name} cleared from the list" = "{name} பட்டியலிலிருந்து நீக்கப்பட்டது" +"{name} from {path}" = "{path} இலிருந்து {name}" +"{name} is forgotten on this computer; the file stays on {server}" = "{name} இந்தக் கணினியில் மறக்கப்பட்டது; கோப்பு {server} இல் இருக்கும்" +"{name} is on the server." = "{name} சர்வரில் உள்ளது." +"{name} is spotlighting" = "{name} ஸ்பாட்லைட் செய்கிறார்" +"{name} is too large to open in the browser (over 512 MB)." = "{name} உலாவியில் திறக்க மிகப் பெரியது (512 MB-க்கு மேல்)." +"{name} was removed from the server" = "{name} சர்வரிலிருந்து அகற்றப்பட்டது" +"{name} · deleted on main" = "{name} · main இல் நீக்கப்பட்டது" +"{name} · deleted on the branch" = "{name} · கிளையில் நீக்கப்பட்டது" +"{name} · not published" = "{name} · வெளியிடப்படவில்லை" +"{name} · on a server" = "{name} · சர்வரில்" +"{name} · published version {v}" = "{name} · வெளியிட்ட பதிப்பு {v}" +"{name} · version {v} on the server" = "{name} · சர்வரில் பதிப்பு {v}" +"{name} ×{n}" = "{name} ×{n}" +"{name}, disconnected from its live session" = "{name}, அதன் நேரலை அமர்விலிருந்து துண்டிக்கப்பட்டது" +"{name}, in a live session" = "{name}, நேரலை அமர்வில்" +"{name}, online, open only to you" = "{name}, ஆன்லைனில், உங்களுக்கு மட்டும் திறந்துள்ளது" +"{name}, {kind}, {w} by {h}, selected" = "{name}, {kind}, {w} × {h}, தேர்ந்தெடுக்கப்பட்டது" +"{n} added" = { one = "{n} சேர்க்கப்பட்டது", other = "{n} சேர்க்கப்பட்டன" } +"{n} autosave versions" = { one = "{n} தானியங்கு சேமிப்புப் பதிப்பு", other = "{n} தானியங்கு சேமிப்புப் பதிப்புகள்" } +"{n} changed" = { one = "{n} மாற்றப்பட்டது", other = "{n} மாற்றப்பட்டன" } +"{n} columns" = { one = "{n} நெடுவரிசை", other = "{n} நெடுவரிசைகள்" } +"{n} components" = { one = "{n} காம்போனென்ட்", other = "{n} காம்போனென்ட்கள்" } +"{n} components and styles have newer versions" = { one = "{n} காம்போனென்ட் அல்லது ஸ்டைலுக்குப் புதிய பதிப்பு உள்ளது", other = "{n} காம்போனென்ட்கள் மற்றும் ஸ்டைல்களுக்குப் புதிய பதிப்புகள் உள்ளன" } +"{n} conflicts to resolve" = { one = "தீர்க்க வேண்டிய {n} முரண்பாடு", other = "தீர்க்க வேண்டிய {n} முரண்பாடுகள்" } +"{n} days ago" = { one = "{n} நாள் முன்பு", other = "{n} நாட்கள் முன்பு" } +"{n} detached" = { one = "{n} பிரிக்கப்பட்டது", other = "{n} பிரிக்கப்பட்டன" } +"{n} files" = { one = "{n} கோப்பு", other = "{n} கோப்புகள்" } +"{n} hours ago" = { one = "{n} மணிநேரத்திற்கு முன்பு", other = "{n} மணிநேரத்திற்கு முன்பு" } +"{n} inserted" = { one = "{n} செருகப்பட்டது", other = "{n} செருகப்பட்டன" } +"{n} instances" = { one = "{n} இன்ஸ்டன்ஸ்", other = "{n} இன்ஸ்டன்ஸ்கள்" } +"{n} layers" = { one = "{n} லேயர்", other = "{n} லேயர்கள்" } +"{n} layers as one file" = { one = "ஒரே கோப்பாக {n} லேயர்", other = "ஒரே கோப்பாக {n} லேயர்கள்" } +"{n} layers selected" = { one = "{n} லேயர் தேர்ந்தெடுக்கப்பட்டது", other = "{n} லேயர்கள் தேர்ந்தெடுக்கப்பட்டன" } +"{n} layers · {parts}" = { one = "{n} லேயர் · {parts}", other = "{n} லேயர்கள் · {parts}" } +"{n} matches" = { one = "{n} பொருத்தம்", other = "{n} பொருத்தங்கள்" } +"{n} min" = "{n} நிமி" +"{n} minutes ago" = { one = "{n} நிமிடம் முன்பு", other = "{n} நிமிடங்கள் முன்பு" } +"{n} months ago" = { one = "{n} மாதம் முன்பு", other = "{n} மாதங்கள் முன்பு" } +"{n} more notes omitted from this report" = { one = "மேலும் {n} குறிப்பு இந்த அறிக்கையில் விடுபட்டது", other = "மேலும் {n} குறிப்புகள் இந்த அறிக்கையில் விடுபட்டன" } +"{n} of {total}" = "{total} இல் {n}" +"{n} people joined" = { one = "{n} நபர் சேர்ந்தார்", other = "{n} நபர்கள் சேர்ந்தனர்" } +"{n} preferred components" = { one = "{n} விருப்ப காம்போனென்ட்", other = "{n} விருப்ப காம்போனென்ட்கள்" } +"{n} ready" = { one = "{n} தயார்", other = "{n} தயார்" } +"{n} removed" = { one = "{n} அகற்றப்பட்டது", other = "{n} அகற்றப்பட்டன" } +"{n} replies" = { one = "{n} பதில்", other = "{n} பதில்கள்" } +"{n} rows" = { one = "{n} வரிசை", other = "{n} வரிசைகள்" } +"{n} styles" = { one = "{n} ஸ்டைல்", other = "{n} ஸ்டைல்கள்" } +"{n} text layers" = { one = "{n} உரை லேயர்", other = "{n} உரை லேயர்கள்" } +"{n} variables" = { one = "{n} வேரியபிள்", other = "{n} வேரியபிள்கள்" } +"{n} votes" = { one = "{n} வாக்கு", other = "{n} வாக்குகள்" } +"{n} votes left" = { one = "{n} வாக்கு மீதமுள்ளது", other = "{n} வாக்குகள் மீதமுள்ளன" } +"{n} weeks ago" = { one = "{n} வாரம் முன்பு", other = "{n} வாரங்கள் முன்பு" } +"{n} years ago" = { one = "{n} ஆண்டு முன்பு", other = "{n} ஆண்டுகள் முன்பு" } +"{n}d" = "{n}நா" +"{n}h" = "{n}மணி" +"{n}m" = "{n}நிமி" +"{n}w" = "{n}வா" +"{page}, nothing selected" = "{page}, எதுவும் தேர்ந்தெடுக்கப்படவில்லை" +"{percent}%" = "{percent}%" +"{period}: {counts}" = "{period}: {counts}" +"{profile} (current)" = "{profile} (தற்போதையது)" +"{property} is its value; {property ? \"a\" : \"b\"} picks a string. Other {…} stays as written." = "{property} அதன் மதிப்பு; {property ? \"a\" : \"b\"} ஒரு சரத்தைத் தேர்ந்தெடுக்கும். மற்ற {…} எழுதியபடியே இருக்கும்." +"{server} can't say what became of your files (it is older than this app)." = "உங்கள் கோப்புகளுக்கு என்ன ஆனது என்று {server} ஆல் சொல்ல முடியாது (அது இந்த ஆப்ஸை விடப் பழையது)." +"{server} · No longer on the server" = "{server} · இனி சர்வரில் இல்லை" +"{server} · {shared} · Opened {date}" = "{server} · {shared} · {date} அன்று திறக்கப்பட்டது" +"{tool} hold {key}" = "{tool} {key} ஐ அழுத்திப் பிடி" +"{used} · {detached}" = "{used} · {detached}" +"{used} · {inserted}" = "{used} · {inserted}" +"{value} isn't a colour" = "{value} ஒரு நிறம் அல்ல" +"{when} · edited" = "{when} · திருத்தப்பட்டது" +"←" = "←" +"← ↑ → ↓" = "← ↑ → ↓" +"← → ↑ ↓" = "← → ↑ ↓" +"→, Space or N" = "→, Space அல்லது N" +"↵" = "↵" +"↵ / ⇧↵" = "↵ / ⇧↵" +"⇥ / ⇧⇥" = "⇥ / ⇧⇥" +"⇥ or ⌥ Space again" = "⇥ அல்லது ⌥ Space மீண்டும்" +"⌘ arrows" = "⌘ அம்புகள்" +"⌘ click" = "⌘ கிளிக்" +"⌘ click a padding field" = "ஒரு பேடிங் புலத்தை ⌘ கிளிக் செய்யவும்" +"⌘ scroll" = "⌘ ஸ்க்ரோல்" +"⌥ double-click an edge of an auto layout child" = "ஆட்டோ லேஅவுட் சைல்டின் ஓரத்தை ⌥ இருமுறை கிளிக் செய்யவும்" +"⌥ drag" = "⌥ இழு" +"⌥⌘ ← ↑ → ↓" = "⌥⌘ ← ↑ → ↓" + +[commands] +"align.bottom" = "கீழே சீரமை" +"align.hcenter" = "கிடைமட்ட மையத்தில் சீரமை" +"align.left" = "இடதுபுறம் சீரமை" +"align.right" = "வலதுபுறம் சீரமை" +"align.top" = "மேலே சீரமை" +"align.vcenter" = "செங்குத்து மையத்தில் சீரமை" +"annotation.add" = "குறிப்புரை சேர்" +"annotation.addCategory" = "குறிப்புரை வகை சேர்" +"annotation.categories" = "குறிப்புரை வகைகள்" +"annotation.edit" = "குறிப்புரையைத் திருத்து" +"annotation.editCategory" = "குறிப்புரை வகையைத் திருத்து" +"annotation.list" = "குறிப்புரைகளைப் பட்டியலிடு" +"annotation.remove" = "குறிப்புரையை அகற்று" +"annotation.removeCategory" = "குறிப்புரை வகையை நீக்கு" +"app.actions" = "செயல்கள்" +"app.preferences" = "விருப்பங்கள்" +"arrange.back" = "பின்னுக்கு அனுப்பு" +"arrange.backward" = "ஒரு படி பின்னுக்கு அனுப்பு" +"arrange.forward" = "ஒரு படி முன்னுக்குக் கொண்டுவா" +"arrange.front" = "முன்னுக்குக் கொண்டுவா" +"arrange.packH" = "கிடைமட்டமாக அடுக்கு" +"arrange.packV" = "செங்குத்தாக அடுக்கு" +"arrange.reorder" = "தேர்வை மறுவரிசைப்படுத்து" +"arrange.roundToPixels" = "பிக்சல்களுக்கு முழுமையாக்கு" +"arrange.spacing" = "இடைவெளி" +"arrange.tidy" = "ஒழுங்குபடுத்து" +"board.addConnected" = "இணைந்த வடிவம் சேர்" +"board.connector" = "கனெக்டர்" +"board.ink" = "மார்க்கர் ஸ்ட்ரோக்" +"board.label" = "கனெக்டர் லேபிள்" +"board.nextSticky" = "அடுத்த ஸ்டிக்கி நோட்" +"board.reattach" = "கனெக்டரை மீண்டும் இணை" +"board.setColor" = "போர்டு நிறம்" +"board.setStyle" = "போர்டு ஸ்டைல்" +"board.shape" = "உரையுடன் வடிவம்" +"board.stamp" = "ஸ்டாம்ப்" +"board.sticky" = "ஸ்டிக்கி நோட்" +"board.table" = "அட்டவணை" +"board.tableEdit" = "அட்டவணையைத் திருத்து" +"board.template" = "போர்டு டெம்ப்ளேட்" +"board.templates" = "போர்டு டெம்ப்ளேட்களைப் பட்டியலிடு" +"board.timer" = "டைமர்" +"board.timerState" = "டைமர் நிலை" +"board.vote" = "வாக்கெடுப்பு அமர்வு" +"board.voteResults" = "வாக்கெடுப்பு முடிவுகள்" +"bool.exclude" = "தேர்வை விலக்கு" +"bool.flatten" = "பூலியனைத் தட்டையாக்கு" +"bool.intersect" = "தேர்வைக் குறுக்கிடு" +"bool.subtract" = "தேர்வைக் கழி" +"bool.union" = "தேர்வை ஒன்றிணை" +"branch.archive" = "கிளையைக் காப்பகப்படுத்து" +"branch.create" = "கிளையை உருவாக்கு" +"branch.list" = "கிளைகளைப் பட்டியலிடு" +"branch.merge" = "கிளையை இணை" +"branch.open" = "கிளையைத் திற" +"branch.review" = "கிளையை மதிப்பாய்வு செய்" +"branch.updateFromMain" = "main இலிருந்து புதுப்பி" +"codeConnect.export" = "குறியீட்டு இணைப்புகளை ஏற்றுமதி செய்" +"codeConnect.import" = "குறியீட்டு இணைப்புகளை இறக்குமதி செய்" +"codeConnect.remove" = "குறியீட்டிலிருந்து துண்டி" +"codeConnect.set" = "குறியீட்டுடன் இணை" +"collab.cursor" = "கர்சரை இங்கே காட்டு" +"collab.cursorChat" = "கர்சர் அரட்டை" +"collab.diff" = "ஒத்திசைவு மாற்றங்களைக் காட்டு" +"collab.files" = "உங்கள் ஆன்லைன் கோப்புகள்" +"collab.follow" = "பின்தொடர்" +"collab.forgetFile" = "ஆன்லைன் கோப்பை மற" +"collab.host" = "நேரலை அமர்வைத் தொடங்கு" +"collab.join" = "நேரலை அமர்வில் சேர்" +"collab.leave" = "நேரலை அமர்விலிருந்து வெளியேறு" +"collab.manageFile" = "வெளியிட்ட கோப்பை நிர்வகி" +"collab.openFile" = "ஆன்லைன் கோப்பைத் திற" +"collab.peers" = "இந்தக் கோப்பில் உள்ளவர்கள்" +"collab.publish" = "சர்வரில் வெளியிடு" +"collab.reconnect" = "நேரலை அமர்வை மீண்டும் இணை" +"collab.recoverFile" = "ஆன்லைன் கோப்பை மீட்டெடு" +"collab.registerLinks" = "அழைப்பு இணைப்புகளை FigCraft-இல் திற" +"collab.removePerson" = "அமர்விலிருந்து அகற்று" +"collab.report" = "கோப்பை சர்வர் இயக்குநரிடம் புகாரளி" +"collab.serverInfo" = "சர்வர் தகவல்" +"collab.share" = "சேர்வுக் குறியீட்டுடன் பகிர்" +"collab.spotlight" = "என்னை ஸ்பாட்லைட் செய்" +"collab.stop" = "நேரலை அமர்வை நிறுத்து" +"command.batch" = "பல கட்டளைகளை இயக்கு" +"comment.add" = "கருத்து சேர்" +"comment.delete" = "கருத்தை நீக்கு" +"comment.edit" = "கருத்தைத் திருத்து" +"comment.link" = "கருத்துக்கான இணைப்பை நகலெடு" +"comment.list" = "கருத்துகளைப் பட்டியலிடு" +"comment.markRead" = "கருத்தைப் படித்ததாகக் குறி" +"comment.move" = "கருத்தை நகர்த்து" +"comment.next" = "அடுத்த கருத்து" +"comment.open" = "கருத்தைத் திற" +"comment.people" = "கருத்துகளில் உள்ளவர்கள்" +"comment.prompt" = "AI-க்காகக் கருத்துகளை நகலெடு" +"comment.react" = "கருத்துக்கு எதிர்வினையாற்று" +"comment.reply" = "கருத்துக்குப் பதிலளி" +"comment.resolve" = "கருத்தைத் தீர்த்துவை" +"comment.zoom" = "கருத்துகளுக்கு ஜூம் செய்" +"component.addProperty" = "காம்போனென்ட் பண்பு சேர்" +"component.addVariant" = "வேரியன்ட் சேர்" +"component.bindProperty" = "லேயரைப் பண்புடன் இணை" +"component.combineVariants" = "வேரியன்ட்களாக இணை" +"component.create" = "காம்போனென்ட் உருவாக்கு" +"component.createMultiple" = "பல காம்போனென்ட்களை உருவாக்கு" +"component.deleteProperty" = "காம்போனென்ட் பண்பை நீக்கு" +"component.detach" = "இன்ஸ்டன்ஸைப் பிரி" +"component.editProperty" = "காம்போனென்ட் பண்பைத் திருத்து" +"component.exposeInstance" = "உள்ளமைந்த இன்ஸ்டன்ஸை வெளிப்படுத்து" +"component.goToMain" = "முதன்மை காம்போனென்ட்டுக்குச் செல்" +"component.hideWhenPublishing" = "வெளியிடும்போது மறை" +"component.list" = "காம்போனென்ட்களைப் பட்டியலிடு" +"component.makeSlot" = "ஸ்லாட் ஆக்கு" +"component.playground" = "காம்போனென்ட் சோதனைக்களம்" +"component.properties" = "காம்போனென்ட் பண்புகள்" +"component.pushChanges" = "மாற்றங்களை முதன்மை காம்போனென்ட்டுக்கு அனுப்பு" +"component.removeSlot" = "ஸ்லாட்டை அகற்று" +"component.resetInstance" = "எல்லா மாற்றங்களையும் மீட்டமை" +"component.resetOverride" = "ஓவர்ரைடை மீட்டமை" +"component.restoreMain" = "முதன்மை காம்போனென்ட்டை மீட்டெடு" +"data.fill" = "நகல்களைத் தரவால் நிரப்பு" +"dev.compare" = "மாற்றங்களை ஒப்பிடு" +"dev.focus" = "கவனக் காட்சி" +"dev.resolveChange" = "மாற்றத்தைத் தீர்த்துவை" +"dev.unfocus" = "கவனக் காட்சியிலிருந்து வெளியேறு" +"devMode.addMeasurement" = "அளவீடு சேர்" +"devMode.measurements" = "அளவீடுகளைப் பட்டியலிடு" +"devMode.removeMeasurement" = "அளவீட்டை அகற்று" +"devResource.add" = "டெவ் ஆதாரம் சேர்" +"devResource.edit" = "டெவ் ஆதாரத்தைத் திருத்து" +"devResource.list" = "டெவ் ஆதாரங்களைப் பட்டியலிடு" +"devResource.remove" = "டெவ் ஆதாரத்தை அகற்று" +"distribute.horizontal" = "கிடைமட்ட இடைவெளியைப் பகிர்ந்தளி" +"distribute.vertical" = "செங்குத்து இடைவெளியைப் பகிர்ந்தளி" +"doc.home" = "முகப்பு" +"doc.list" = "ஆவணங்களைப் பட்டியலிடு" +"doc.nextTab" = "அடுத்த தாவல்" +"doc.previousTab" = "முந்தைய தாவல்" +"doc.switch" = "ஆவணத்தை மாற்று" +"edit.copy" = "நகலெடு" +"edit.copyAsCss" = "CSS ஆக நகலெடு" +"edit.copyAsPng" = "PNG ஆக நகலெடு" +"edit.copyAsSvg" = "SVG ஆக நகலெடு" +"edit.copyAsText" = "உரையாக நகலெடு" +"edit.copyLink" = "தேர்வுக்கான இணைப்பை நகலெடு" +"edit.copyProperties" = "பண்புகளை நகலெடு" +"edit.cut" = "வெட்டு" +"edit.delete" = "நீக்கு" +"edit.duplicate" = "நகல்செய்" +"edit.findReplace" = "கண்டுபிடித்து மாற்று" +"edit.paste" = "ஒட்டு" +"edit.pasteDesignLayers" = "டிசைன் லேயர்களை ஒட்டு" +"edit.pasteOver" = "தேர்வின் மேல் ஒட்டு" +"edit.pasteProperties" = "பண்புகளை ஒட்டு" +"edit.pasteReplace" = "மாற்றாக ஒட்டு" +"edit.pickColor" = "நிறத்தைத் தேர்ந்தெடு" +"edit.redo" = "மீண்டும்செய்" +"edit.repeat" = "கடைசி கட்டளையை மீண்டும் இயக்கு" +"edit.setDefaultProperties" = "இயல்புநிலை பண்புகளை அமை" +"edit.undo" = "செயல்தவிர்" +"effect.add" = "எஃபெக்ட் சேர்" +"effect.copy" = "எஃபெக்ட்டை நகலெடு" +"effect.move" = "எஃபெக்ட்டை நகர்த்து" +"effect.paste" = "எஃபெக்ட்டை ஒட்டு" +"effect.remove" = "எஃபெக்ட்டை அகற்று" +"effect.set" = "எஃபெக்ட்டை அமை" +"export.add" = "ஏற்றுமதி அமைப்பு சேர்" +"export.remove" = "ஏற்றுமதி அமைப்பை அகற்று" +"export.update" = "ஏற்றுமதி அமைப்பைத் திருத்து" +"file.close" = "தாவலை மூடு" +"file.colorProfile" = "நிறச் சுயவிவரம்" +"file.duplicate" = "கோப்பை நகல்செய்" +"file.export" = "ஏற்றுமதி செய்" +"file.exportFramesPdf" = "ஃப்ரேம்களை PDF ஆக ஏற்றுமதி செய்" +"file.exportLayers" = "லேயர்களை ஏற்றுமதி செய்" +"file.exportSvg" = "தேர்வை SVG ஆக ஏற்றுமதி செய்" +"file.fontReport" = "ஆவண எழுத்துருக்களை ஆய்வு செய்" +"file.import" = "இறக்குமதி செய்" +"file.markSaved" = "சேமித்ததாகக் குறி" +"file.moveTab" = "தாவலை நகர்த்து" +"file.new" = "புதிய டிசைன் கோப்பு" +"file.newBoard" = "புதிய போர்டு" +"file.newFromTemplate" = "டெம்ப்ளேட்டிலிருந்து புதியது" +"file.open" = "திற" +"file.openRecent" = "சமீபத்தியதைத் திற" +"file.placeImage" = "படத்தை வை" +"file.recover" = "கோப்பை மீட்டெடு" +"file.rename" = "கோப்பின் பெயரை மாற்று" +"file.revert" = "சேமித்ததற்குத் திரும்பு" +"file.save" = "சேமி" +"file.saveAs" = "இவ்வாறு சேமி" +"file.saveVersion" = "பதிப்பு வரலாற்றில் சேமி" +"file.versionHistory" = "பதிப்பு வரலாற்றைக் காட்டு" +"fill.add" = "ஃபில் சேர்" +"fill.copy" = "ஃபில்லை நகலெடு" +"fill.move" = "ஃபில்லை நகர்த்து" +"fill.paste" = "ஃபில்லை ஒட்டு" +"fill.pattern" = "பேட்டர்ன் ஃபில்" +"fill.remove" = "ஃபில்லை அகற்று" +"fill.set" = "ஃபில்லை அமை" +"frame.create" = "ஃப்ரேம் உருவாக்கு" +"frame.presets" = "ஃப்ரேம் முன்னமைவுகளைப் பட்டியலிடு" +"frame.swapOrientation" = "திசையமைவை மாற்று" +"grid.add" = "லேஅவுட் கட்டம் சேர்" +"grid.move" = "லேஅவுட் கட்டத்தை நகர்த்து" +"grid.remove" = "லேஅவுட் கட்டத்தை அகற்று" +"guide.add" = "வழிகாட்டி சேர்" +"guide.clear" = "எல்லா வழிகாட்டிகளையும் அகற்று" +"guide.move" = "வழிகாட்டியை நகர்த்து" +"guide.remove" = "வழிகாட்டியை அகற்று" +"guide.select" = "வழிகாட்டியைத் தேர்ந்தெடு" +"help.about" = "FigCraft பற்றி" +"help.gettingStarted" = "தொடங்குதல்" +"help.page" = "உதவிப் பக்கம்" +"help.shortcuts" = "விசைப்பலகை குறுக்குவழிகள்" +"image.adjust" = "படத்தைச் சரிசெய்" +"image.deletePreset" = "பட முன்னமைவை நீக்கு" +"image.place" = "படத்தை வை" +"image.presets" = "பட முன்னமைவுகள்" +"image.savePreset" = "பட முன்னமைவைச் சேமி" +"inspect.assets" = "அசெட்களை ஆய்வுசெய்" +"inspect.code" = "லேயருக்கான குறியீடு" +"inspect.componentCode" = "காம்போனென்ட் குறியீடு" +"inspect.properties" = "பண்புகளை ஆய்வுசெய்" +"inspect.readyForDev" = "டெவ்-க்குத் தயார்" +"instance.create" = "இன்ஸ்டன்ஸை உருவாக்கு" +"instance.exposed" = "வெளிப்படுத்திய உள்ளமை இன்ஸ்டன்ஸ்கள்" +"instance.place" = "இன்ஸ்டன்ஸை வை" +"instance.resetSlot" = "ஸ்லாட்டை மீட்டமை" +"instance.setProperties" = "இன்ஸ்டன்ஸ் பண்புகளை அமை" +"instance.slotInsert" = "ஸ்லாட்டில் செருகு" +"instance.swap" = "இன்ஸ்டன்ஸை மாற்று" +"instance.swapAt" = "புள்ளியில் இன்ஸ்டன்ஸை மாற்று" +"layers.collapseAll" = "லேயர்களைச் சுருக்கு" +"layout.add" = "ஆட்டோ லேஅவுட் சேர்" +"layout.remove" = "ஆட்டோ லேஅவுட்டை அகற்று" +"layout.setTrack" = "கட்ட வரிசை அளவை அமை" +"layout.suggest" = "ஆட்டோ லேஅவுட்டைப் பரிந்துரை" +"libraries.open" = "லைப்ரரிகள்" +"libraries.publish" = "லைப்ரரியை வெளியிடு…" +"library.acceptUpdates" = "லைப்ரரி புதுப்பிப்புகளை ஏற்றுக்கொள்" +"library.add" = "லைப்ரரியைச் சேர்" +"library.aliasVariable" = "லைப்ரரி வேரியபிளுக்கு மாற்றுப்பெயரிடு" +"library.applyStyle" = "லைப்ரரி ஸ்டைலைப் பயன்படுத்து" +"library.bindVariable" = "லைப்ரரி வேரியபிளை இணை" +"library.extendCollection" = "லைப்ரரி தொகுப்பை நீட்டி" +"library.import" = "லைப்ரரி காம்போனென்டை இறக்குமதிசெய்" +"library.importVariable" = "லைப்ரரி வேரியபிளை இறக்குமதிசெய்" +"library.list" = "லைப்ரரிகளைப் பட்டியலிடு" +"library.place" = "லைப்ரரி காம்போனென்டை வை" +"library.publish" = "லைப்ரரியை வெளியிடு" +"library.publishToServer" = "லைப்ரரியைச் சர்வரில் வெளியிடு" +"library.remove" = "லைப்ரரியை அகற்று" +"library.setVariableMode" = "லைப்ரரி வேரியபிள் மோடை அமை" +"library.swap" = "லைப்ரரியை மாற்று" +"library.swapAt" = "இன்ஸ்டன்ஸை லைப்ரரி காம்போனென்டாக மாற்று" +"library.updates" = "லைப்ரரி புதுப்பிப்புகள்" +"library.usage" = "லைப்ரரி பயன்பாடு" +"measure.distances" = "இடைவெளிகளை அளவிடு" +"measure.padding" = "ஆட்டோ லேஅவுட் பேடிங்கை அளவிடு" +"node.create" = "லேயரை உருவாக்கு" +"node.find" = "லேயர்களைக் கண்டறி" +"node.get" = "லேயரைப் பெறு" +"node.reorder" = "லேயர் வரிசையை மாற்று" +"node.reparent" = "லேயரை உள்ளே நகர்த்து" +"node.set" = "பண்புகளை அமை" +"object.batchRename" = "மொத்தமாக மறுபெயரிடு" +"object.convertToFrame" = "ஃப்ரேமாக மாற்று" +"object.convertToGroup" = "குழுவாக மாற்று" +"object.convertToSection" = "செக்ஷனாக மாற்று" +"object.flipH" = "கிடைமட்டமாகப் புரட்டு" +"object.flipV" = "செங்குத்தாகப் புரட்டு" +"object.frameSelection" = "தேர்வை ஃப்ரேமில் வை" +"object.group" = "தேர்வைக் குழுவாக்கு" +"object.hideOthers" = "பிற லேயர்களை மறை" +"object.mask" = "மாஸ்க்காகப் பயன்படுத்து" +"object.moveToPage" = "பக்கத்துக்கு நகர்த்து" +"object.opacityKeys" = "எண் விசைகளால் ஒளிபுகாமை" +"object.rasterize" = "தேர்வை ராஸ்டராக்கு" +"object.releaseMask" = "மாஸ்க்கை விடுவி" +"object.removeFill" = "ஃபில்லை அகற்று" +"object.removeFrame" = "ஃப்ரேமை அகற்று" +"object.removeStroke" = "ஸ்ட்ரோக்கை அகற்று" +"object.rename" = "மறுபெயரிடு" +"object.resizeToFit" = "பொருந்தும்படி அளவுமாற்று" +"object.rotate180" = "180° சுழற்று" +"object.rotateLeft" = "90° இடப்புறம் சுழற்று" +"object.rotateRight" = "90° வலப்புறம் சுழற்று" +"object.setThumbnail" = "சிறுபடமாக அமை" +"object.swapFillStroke" = "ஃபில், ஸ்ட்ரோக்கை இடமாற்று" +"object.toggleLock" = "தேர்வைப் பூட்டு/திற" +"object.toggleVisible" = "தேர்வைக் காட்டு/மறை" +"object.ungroup" = "தேர்வின் குழுவைப் பிரி" +"object.wrapInSection" = "புதிய செக்ஷனில் வை" +"page.add" = "பக்கத்தைச் சேர்" +"page.delete" = "பக்கத்தை நீக்கு" +"page.duplicate" = "பக்கத்தை நகல்செய்" +"page.list" = "பக்கங்களைப் பட்டியலிடு" +"page.move" = "பக்கத்தை நகர்த்து" +"page.rename" = "பக்கத்தை மறுபெயரிடு" +"page.select" = "பக்கத்துக்குச் செல்" +"page.setBackground" = "பக்கப் பின்னணி" +"paint.documentColors" = "ஆவண நிறங்கள்" +"plugin.close" = "ப்ளகின் பேனலை மூடு" +"plugin.directory.install" = "கோப்பகத்திலிருந்து ப்ளகினை நிறுவு" +"plugin.directory.list" = "ப்ளகின் கோப்பகத்தை உலாவு" +"plugin.directory.publish" = "ப்ளகினைக் கோப்பகத்தில் வெளியிடு" +"plugin.directory.unpublish" = "ப்ளகினைக் கோப்பகத்திலிருந்து நீக்கு" +"plugin.event" = "ப்ளகின் பேனல் கட்டுப்பாட்டைப் பயன்படுத்து" +"plugin.import" = "மேனிஃபெஸ்டிலிருந்து ப்ளகினை இறக்குமதிசெய்…" +"plugin.list" = "ப்ளகின்களைப் பட்டியலிடு" +"plugin.remove" = "ப்ளகினை அகற்று" +"plugin.run" = "ப்ளகினை இயக்கு" +"plugin.ui" = "ப்ளகின் பேனல்" +"plugins.manage" = "ப்ளகின்களை நிர்வகி…" +"plugins.runLast" = "கடைசி ப்ளகினை இயக்கு" +"pref.autoSave" = "கோப்புகளைத் தானாகச் சேமி" +"pref.highlightHover" = "மேலே செல்லும்போது லேயர்களை முன்னிலைப்படுத்து" +"pref.keepTool" = "பயன்படுத்திய பின் கருவியைத் தேர்விலேயே வை" +"pref.language" = "இடைமுக மொழி" +"pref.nudge" = "நகர்த்தும் அளவு" +"pref.numberKeysOpacity" = "ஒளிபுகாமைக்கு எண் விசைகளைப் பயன்படுத்து" +"pref.publishServer" = "ஆன்லைன் பகிர்வுக்கான சர்வர்" +"pref.reduceMotion" = "அசைவைக் குறை" +"pref.renameDuplicates" = "நகலெடுத்த லேயர்களை மறுபெயரிடு" +"pref.scrollWheelZoom" = "ஸ்க்ரோல் வீல் ஜூம்" +"pref.showDimensions" = "பொருள்களில் அளவுகளைக் காட்டு" +"pref.startOnHome" = "முகப்புத் திரையில் தொடங்கு" +"pref.uiScale" = "இடைமுக அளவு" +"pref.userName" = "உங்கள் பெயர்" +"proto.action.add" = "ப்ரோட்டோடைப் செயலைச் சேர்" +"proto.action.move" = "ப்ரோட்டோடைப் செயலின் வரிசையை மாற்று" +"proto.action.remove" = "ப்ரோட்டோடைப் செயலை அகற்று" +"proto.action.set" = "ப்ரோட்டோடைப் செயலைத் திருத்து" +"proto.closePreview" = "ப்ரோட்டோடைப் முன்னோட்டத்தை மூடு" +"proto.conditional.addBlock" = "else if / else சேர்" +"proto.conditional.removeBlock" = "if / else if / else ஐ அகற்று" +"proto.conditional.setCondition" = "நிபந்தனையைத் திருத்து" +"proto.evaluate" = "ப்ரோட்டோடைப் எக்ஸ்பிரஷனை மதிப்பிடு" +"proto.flow.add" = "ஃப்ளோ தொடக்கப் புள்ளியைச் சேர்" +"proto.flow.remove" = "ஃப்ளோவை அகற்று" +"proto.flow.rename" = "ஃப்ளோவை மறுபெயரிடு" +"proto.interaction.add" = "இன்டராக்ஷனைச் சேர்" +"proto.interaction.clear" = "எல்லா இன்டராக்ஷன்களையும் அகற்று" +"proto.interaction.remove" = "இன்டராக்ஷனை அகற்று" +"proto.interaction.set" = "இன்டராக்ஷனைத் திருத்து" +"proto.present" = "வழங்கு" +"proto.presentOptions" = "விளக்கக்காட்சி விருப்பங்கள்" +"proto.preview" = "ப்ரோட்டோடைப் முன்னோட்டத்தைத் திற" +"proto.settings" = "ப்ரோட்டோடைப் அமைப்புகள்" +"section.toggleContents" = "செக்ஷன் உள்ளடக்கத்தை மறை/காட்டு" +"select.add" = "தேர்வில் சேர்" +"select.all" = "அனைத்தையும் தேர்ந்தெடு" +"select.area" = "பகுதியைத் தேர்ந்தெடு" +"select.byName" = "பெயரால் லேயர்களைத் தேர்ந்தெடு" +"select.children" = "சைல்ட் லேயர்களைத் தேர்ந்தெடு" +"select.inverse" = "தேர்வைத் தலைகீழாக்கு" +"select.layersAt" = "ஒரு புள்ளியிலுள்ள லேயர்கள்" +"select.matching" = "பொருந்தும் லேயர்களைத் தேர்ந்தெடு" +"select.next" = "அடுத்த லேயரைத் தேர்ந்தெடு" +"select.none" = "எதையும் தேர்ந்தெடுக்க வேண்டாம்" +"select.parent" = "பேரன்ட் லேயரைத் தேர்ந்தெடு" +"select.previous" = "முந்தைய லேயரைத் தேர்ந்தெடு" +"select.remove" = "தேர்விலிருந்து அகற்று" +"select.sameEffect" = "ஒரே எஃபெக்ட்டைத் தேர்ந்தெடு" +"select.sameFill" = "ஒரே ஃபில்லைத் தேர்ந்தெடு" +"select.sameFont" = "ஒரே எழுத்துருவைத் தேர்ந்தெடு" +"select.sameInstance" = "ஒரே இன்ஸ்டன்ஸைத் தேர்ந்தெடு" +"select.sameProperties" = "ஒரே பண்புகளைத் தேர்ந்தெடு" +"select.sameStroke" = "ஒரே ஸ்ட்ரோக்கைத் தேர்ந்தெடு" +"select.sameText" = "ஒரே உரைப் பண்புகளைத் தேர்ந்தெடு" +"select.set" = "தேர்ந்தெடு" +"selection.applyColorStyle" = "தேர்வின் நிற ஸ்டைலைப் பயன்படுத்து" +"selection.bindColorVariable" = "தேர்வின் நிற வேரியபிளைப் பயன்படுத்து" +"selection.colors" = "தேர்வின் நிறங்கள்" +"selection.createColorStyle" = "தேர்வின் நிற ஸ்டைலை உருவாக்கு" +"selection.detachColor" = "தேர்வின் நிறத்தைப் பிரி" +"selection.selectColor" = "இந்த நிறமுள்ள லேயர்களைத் தேர்ந்தெடு" +"selection.setPaint" = "தேர்வின் நிறத்தை மாற்று" +"shape.arrow" = "அம்புக்குறி" +"shape.ellipse" = "நீள்வட்டம்" +"shape.line" = "கோடு" +"shape.polygon" = "பலகோணம்" +"shape.rectangle" = "செவ்வகம்" +"shape.star" = "நட்சத்திரம்" +"shapeBuilder.merge" = "பகுதிகளை இணை" +"shapeBuilder.mode" = "வடிவ பில்டர் மோட்" +"shapeBuilder.regions" = "வடிவ பில்டர் பகுதிகள்" +"shapeBuilder.remove" = "பகுதிகளை அகற்று" +"stroke.add" = "ஸ்ட்ரோக் சேர்" +"stroke.brush" = "தூரிகை" +"stroke.copy" = "ஸ்ட்ரோக்கை நகலெடு" +"stroke.move" = "ஸ்ட்ரோக்கை நகர்த்து" +"stroke.paste" = "ஸ்ட்ரோக்கை ஒட்டு" +"stroke.remove" = "ஸ்ட்ரோக்கை அகற்று" +"stroke.set" = "ஸ்ட்ரோக்கை அமை" +"stroke.widthProfile" = "அகல சுயவிவரம்" +"style.apply" = "ஸ்டைலைப் பயன்படுத்து" +"style.bind" = "ஸ்டைலில் வேரியபிளை இணை" +"style.create" = "ஸ்டைலை உருவாக்கு" +"style.delete" = "ஸ்டைலை நீக்கு" +"style.detach" = "ஸ்டைலைப் பிரி" +"style.duplicate" = "ஸ்டைலை நகல்செய்" +"style.list" = "ஸ்டைல்களைப் பட்டியலிடு" +"style.move" = "ஸ்டைல்களை நகர்த்து" +"style.renameFolder" = "ஸ்டைல் கோப்புறையை மறுபெயரிடு" +"style.update" = "ஸ்டைலைத் திருத்து" +"template.list" = "டெம்ப்ளேட்களைப் பட்டியலிடு" +"text.alignCenter" = "நடுவில் சீரமை" +"text.alignJustify" = "இருபுறமும் சீரமை" +"text.alignLeft" = "இடப்புறம் சீரமை" +"text.alignRight" = "வலப்புறம் சீரமை" +"text.bold" = "தடிமன்" +"text.bulletList" = "புள்ளிப் பட்டியல்" +"text.case" = "எழுத்து வடிவம்" +"text.caseLower" = "சிற்றெழுத்து" +"text.caseOriginal" = "அசல் வடிவம்" +"text.caseSmallCaps" = "சிறிய பேரெழுத்து" +"text.caseTitle" = "தலைப்பு வடிவம்" +"text.caseUpper" = "பேரெழுத்து" +"text.create" = "உரை" +"text.decoration" = "அலங்காரம்" +"text.direction" = "உரைத் திசை" +"text.directionAuto" = "உரைத் திசை: தானியங்கு" +"text.directionLtr" = "உரைத் திசை: இடமிருந்து வலம்" +"text.directionRtl" = "உரைத் திசை: வலமிருந்து இடம்" +"text.edit.begin" = "உரையைத் திருத்து" +"text.edit.caret" = "கர்சரை அமை" +"text.edit.end" = "உரைத் திருத்தத்தை நிறுத்து" +"text.edit.insert" = "உரையைத் தட்டச்சுசெய்" +"text.edit.key" = "உரை விசை" +"text.edit.preedit" = "உரையை உருவாக்கு (IME)" +"text.edit.selectLine" = "வரியைத் தேர்ந்தெடு" +"text.edit.selectWord" = "சொல்லைத் தேர்ந்தெடு" +"text.edit.selection" = "உரைத் தேர்வு" +"text.endPreview" = "உரை முன்னோட்டத்தை முடி" +"text.fit" = "உரையைப் பெட்டிக்குள் பொருத்து" +"text.fonts" = "எழுத்துருக்களைப் பட்டியலிடு" +"text.italic" = "சாய்வு" +"text.lineHeightDown" = "வரி உயரத்தைக் குறை" +"text.lineHeightUp" = "வரி உயரத்தைக் கூட்டு" +"text.link" = "இணைப்பை உருவாக்கு" +"text.listIndent" = "பட்டியலை உள்தள்ளு" +"text.listOutdent" = "பட்டியலை வெளித்தள்ளு" +"text.listStyle" = "பட்டியல் ஸ்டைல்" +"text.loadFont" = "எழுத்துருக் கோப்பை ஏற்று" +"text.maxLines" = "அதிகபட்ச வரிகள்" +"text.missingFonts" = "விடுபட்ட எழுத்துருக்கள்" +"text.numberList" = "எண் பட்டியல்" +"text.onPath" = "பாதையில் உரை" +"text.paragraphIndent" = "பத்தி உள்தள்ளல்" +"text.paragraphSpacing" = "பத்தி இடைவெளி" +"text.pathOptions" = "உரைப் பாதை விருப்பங்கள்" +"text.preview" = "மாற்றத்தை முன்னோட்டமிடு" +"text.refit" = "எழுத்துருக்களுக்கு ஏற்ப உரையைப் பொருத்து" +"text.removeFromPath" = "பாதையிலிருந்து உரையை அகற்று" +"text.rescanFonts" = "நிறுவிய எழுத்துருக்களை மீண்டும் ஸ்கேன்செய்" +"text.set" = "உரையை அமை" +"text.setFeatures" = "OpenType அம்சங்கள்" +"text.setVariations" = "வேரியபிள் எழுத்துரு அச்சுகள்" +"text.sizeDown" = "எழுத்துரு அளவைக் குறை" +"text.sizeUp" = "எழுத்துரு அளவைக் கூட்டு" +"text.strikethrough" = "அடித்தல்" +"text.style" = "உரைப் பகுதிக்கு ஸ்டைல் அமை" +"text.trackingDown" = "எழுத்து இடைவெளியைக் குறை" +"text.trackingUp" = "எழுத்து இடைவெளியைக் கூட்டு" +"text.underline" = "அடிக்கோடு" +"text.weightDown" = "எழுத்துரு தடிமனைக் குறை" +"text.weightUp" = "எழுத்துரு தடிமனைக் கூட்டு" +"tool.arrow" = "அம்புக்குறி" +"tool.comment" = "கருத்து" +"tool.connector" = "கனெக்டர்" +"tool.crosshair" = "இடக்குறி குறுக்குக்கோட்டை நகர்த்து" +"tool.ellipse" = "நீள்வட்டம்" +"tool.eraser" = "அழிப்பான்" +"tool.frame" = "ஃப்ரேம்" +"tool.hand" = "கை" +"tool.highlighter" = "ஹைலைட்டர்" +"tool.line" = "கோடு" +"tool.marker" = "மார்க்கர்" +"tool.move" = "நகர்த்து" +"tool.pen" = "பேனா" +"tool.pencil" = "பென்சில்" +"tool.pencilBrush" = "பென்சில் தூரிகை" +"tool.place" = "கருவியால் வை" +"tool.polygon" = "பலகோணம்" +"tool.rectangle" = "செவ்வகம்" +"tool.scale" = "அளவிடு" +"tool.scaleAnchor" = "அளவிடும் நங்கூரம்" +"tool.section" = "செக்ஷன்" +"tool.set" = "கருவியைத் தேர்ந்தெடு" +"tool.shape" = "வடிவங்கள்" +"tool.shapeBuilder" = "வடிவ பில்டர்" +"tool.slice" = "ஸ்லைஸ்" +"tool.stamp" = "ஸ்டாம்ப்" +"tool.star" = "நட்சத்திரம்" +"tool.sticky" = "ஸ்டிக்கி நோட்" +"tool.text" = "உரை" +"transform.move" = "நகர்த்து" +"transform.moveTo" = "இதற்கு நகர்த்து" +"transform.nudge" = "சிறிது நகர்த்து" +"transform.nudgeSize" = "சிறிது நகர்த்தி அளவுமாற்று" +"transform.resize" = "அளவுமாற்று" +"transform.rotate" = "சுழற்று" +"transform.rotationOrigin" = "சுழற்சி மையத்தை நகர்த்து" +"transform.scale" = "அளவிடு" +"transform.setRotationOrigin" = "சுழற்சி மையத்தை அமை" +"variable.addMode" = "மோட் சேர்" +"variable.bind" = "வேரியபிளை இணை" +"variable.create" = "வேரியபிளை உருவாக்கு" +"variable.createCollection" = "வேரியபிள் தொகுப்பை உருவாக்கு" +"variable.delete" = "வேரியபிளை நீக்கு" +"variable.deleteCollection" = "தொகுப்பை நீக்கு" +"variable.duplicate" = "வேரியபிளை நகல்செய்" +"variable.export" = "வேரியபிள்களை ஏற்றுமதிசெய்" +"variable.import" = "வேரியபிள்களை இறக்குமதிசெய்" +"variable.list" = "வேரியபிள்களைப் பட்டியலிடு" +"variable.moveMode" = "மோடை நகர்த்து" +"variable.removeMode" = "மோடை நீக்கு" +"variable.renameCollection" = "தொகுப்பை மறுபெயரிடு" +"variable.renameMode" = "மோடை மறுபெயரிடு" +"variable.resetOverride" = "வேரியபிள் ஓவர்ரைடை மீட்டமை" +"variable.set" = "வேரியபிள் மதிப்பை அமை" +"variable.setMode" = "வேரியபிள் மோடை அமை" +"variable.update" = "வேரியபிளைத் திருத்து" +"vector.create" = "வெக்டர்" +"vector.deleteHeal" = "தேர்வை நீக்கிச் சீர்செய்" +"vector.edit.addVertex" = "புள்ளியைச் சேர்" +"vector.edit.begin" = "வெக்டரைத் திருத்து" +"vector.edit.bend" = "பகுதியை வளை" +"vector.edit.bounds" = "தேர்ந்த புள்ளிகளின் எல்லைகள்" +"vector.edit.connect" = "புள்ளிகளை இணை" +"vector.edit.cornerRadius" = "புள்ளியின் மூலை ஆரம்" +"vector.edit.cut" = "பாதையை வெட்டு" +"vector.edit.delete" = "புள்ளிகளை நீக்கு" +"vector.edit.end" = "திருத்தி முடி" +"vector.edit.erase" = "அழி" +"vector.edit.lasso" = "லாஸோ தேர்வு" +"vector.edit.mirroring" = "ஹேண்டில் பிரதிபலிப்பு" +"vector.edit.moveHandles" = "ஹேண்டில்களை நகர்த்து" +"vector.edit.moveVertices" = "புள்ளிகளை நகர்த்து" +"vector.edit.nudge" = "புள்ளிகளைச் சிறிது நகர்த்து" +"vector.edit.paint" = "பெயின்ட் பக்கெட்" +"vector.edit.pen" = "பேனா புள்ளி" +"vector.edit.penEnd" = "பேனா பாதையை முடி" +"vector.edit.position" = "புள்ளியின் நிலை" +"vector.edit.resize" = "புள்ளிகளை அளவுமாற்று" +"vector.edit.rotate" = "புள்ளிகளைச் சுழற்று" +"vector.edit.select" = "புள்ளிகளைத் தேர்ந்தெடு" +"vector.edit.selectAll" = "எல்லாப் புள்ளிகளையும் தேர்ந்தெடு" +"vector.edit.setHandle" = "ஹேண்டிலை அமை" +"vector.edit.smooth" = "புள்ளிகளை மென்மையாக்கு அல்லது கூராக்கு" +"vector.edit.state" = "வெக்டர் திருத்த நிலை" +"vector.edit.strokeCap" = "புள்ளியின் ஸ்ட்ரோக் முனை" +"vector.edit.strokeJoin" = "புள்ளியின் ஸ்ட்ரோக் இணைப்பு" +"vector.edit.tool" = "வெக்டர் திருத்தக் கருவி" +"vector.edit.transform" = "புள்ளிகளை உருமாற்று" +"vector.edit.widthPoint" = "அகலப் புள்ளி" +"vector.fillRule" = "ஃபில் விதியை அமை" +"vector.flatten" = "தட்டையாக்கு" +"vector.join" = "தேர்வை இணை" +"vector.offset" = "பாதையை ஆஃப்செட் செய்" +"vector.outlineStroke" = "ஸ்ட்ரோக்கை அவுட்லைனாக்கு" +"vector.reverse" = "பாதையின் திசையைத் திருப்பு" +"vector.reverseLoop" = "லூப்பைத் திருப்பு" +"vector.simplify" = "வெக்டரை எளிதாக்கு" +"vector.smoothJoin" = "தேர்வை மென்மையாக இணை" +"version.autosave" = "பதிப்பைத் தானாகச் சேமி" +"version.delete" = "பதிப்பை நீக்கு" +"version.duplicate" = "பதிப்பை நகல்செய்" +"version.exitPreview" = "தற்போதைய பதிப்புக்குத் திரும்பு" +"version.list" = "பதிப்புகளைப் பட்டியலிடு" +"version.preview" = "பதிப்பைக் காண்" +"version.rename" = "பதிப்பை மறுபெயரிடு" +"version.restore" = "பதிப்பை மீட்டெடு" +"view.assets" = "அசெட்கள் பேனல்" +"view.comments" = "கருத்துகள்" +"view.contextMenu" = "சூழல் மெனுவைக் காட்டு" +"view.design" = "டிசைன் பேனல்" +"view.designPrototype" = "டிசைன், ப்ரோட்டோடைப் இடையே மாறு" +"view.devMode" = "டெவலப்பர் மோட்" +"view.frameOutlines" = "ஃப்ரேம் அவுட்லைன்கள்" +"view.fullscreen" = "முழுத்திரை" +"view.get" = "காட்சியைப் பெறு" +"view.layers" = "லேயர்கள் பேனல்" +"view.layoutGrids" = "லேஅவுட் கட்டங்கள்" +"view.leftSidebar" = "இடப் பக்கப்பட்டியைக் காட்டு/மறை" +"view.maskOutlines" = "மாஸ்க் அவுட்லைன்கள்" +"view.multiplayerCursors" = "பலர் கர்சர்கள்" +"view.nextFrame" = "அடுத்த ஃப்ரேமுக்கு ஜூம்செய்" +"view.nextPage" = "அடுத்த பக்கம்" +"view.nextRegion" = "அடுத்த பகுதியில் கவனம் செலுத்து" +"view.outlines" = "அவுட்லைன்கள்" +"view.outlinesHiddenLayers" = "அவுட்லைன்களில் மறைந்த லேயர்களைச் சேர்" +"view.outlinesObjectBounds" = "அவுட்லைன்களில் பொருள் எல்லைகளைச் சேர்" +"view.outlinesSelection" = "தேர்வுக்கான அவுட்லைன்கள்" +"view.pan" = "காட்சியை நகர்த்து" +"view.panelWidths" = "பேனல் அகலங்களை மீட்டமை" +"view.pixelGrid" = "பிக்சல் கட்டம்" +"view.pixelPreview" = "பிக்சல் முன்னோட்டம்" +"view.prevFrame" = "முந்தைய ஃப்ரேமுக்கு ஜூம்செய்" +"view.prevPage" = "முந்தைய பக்கம்" +"view.previousRegion" = "முந்தைய பகுதியில் கவனம் செலுத்து" +"view.proofSrgb" = "sRGB சாஃப்ட்-ப்ரூஃப்" +"view.prototype" = "ப்ரோட்டோடைப் பேனல்" +"view.rulers" = "அளவுகோல்கள்" +"view.set" = "காட்சியை அமை" +"view.slices" = "ஸ்லைஸ்கள்" +"view.snapGeometry" = "வடிவியலுடன் ஒட்டு" +"view.snapObjects" = "பொருள்களுடன் ஒட்டு" +"view.snapPixel" = "பிக்சல் கட்டத்துடன் ஒட்டு" +"view.themeDark" = "இருண்ட தீம்" +"view.themeLight" = "வெளிர் தீம்" +"view.themeSystem" = "சிஸ்டம் தீமைப் பின்பற்று" +"view.toggleUi" = "UI-ஐக் காட்டு/மறை" +"view.zoom100" = "100%க்கு ஜூம்செய்" +"view.zoom200" = "200%க்கு ஜூம்செய்" +"view.zoom50" = "50%க்கு ஜூம்செய்" +"view.zoomAt" = "ஜூம் கருவி" +"view.zoomFit" = "பொருந்தும்படி ஜூம்செய்" +"view.zoomIn" = "பெரிதாக்கு" +"view.zoomOut" = "சிறிதாக்கு" +"view.zoomSelection" = "தேர்வுக்கு ஜூம்செய்" +"widget.click" = "விட்ஜெட்டைக் கிளிக்செய்" +"widget.insert" = "விட்ஜெட்டைச் செருகு" +"widget.list" = "விட்ஜெட்களைப் பட்டியலிடு" +"widget.menu" = "விட்ஜெட் மெனு" +"widget.setText" = "விட்ஜெட் புலத்தைத் திருத்து" +"window.focus" = "சாளரத்தை முன்னே கொண்டுவா" +"window.new" = "புதிய சாளரம்" + +[menu] +"bool.exclude" = "விலக்கு" +"bool.flatten" = "தட்டையாக்கு" +"bool.intersect" = "குறுக்கிடு" +"bool.subtract" = "கழி" +"bool.union" = "ஒன்றிணை" +"file.duplicate" = "நகல்செய்" +"file.import" = "கோப்பிலிருந்து இறக்குமதிசெய்…" +"file.rename" = "மறுபெயரிடு" +"libraries.open" = "லைப்ரரிகளைத் திற" +"select.sameEffect" = "எஃபெக்ட்" +"select.sameFill" = "ஃபில்" +"select.sameFont" = "எழுத்துரு" +"select.sameInstance" = "இன்ஸ்டன்ஸ்" +"select.sameProperties" = "பண்புகள்" +"select.sameStroke" = "ஸ்ட்ரோக்" +"select.sameText" = "உரைப் பண்புகள்" +"text.alignCenter" = "உரையை நடுவில் சீரமை" +"text.alignJustify" = "உரையை இருபுறமும் சீரமை" +"text.alignLeft" = "உரையை இடப்புறம் சீரமை" +"text.alignRight" = "உரையை வலப்புறம் சீரமை" +"view.assets" = "அசெட்கள்" +"view.design" = "டிசைன்" +"view.layers" = "லேயர்கள்" +"view.outlines" = "அவுட்லைன்களைக் காட்டு" +"view.outlinesHiddenLayers" = "மறைந்த லேயர்களைச் சேர்" +"view.outlinesObjectBounds" = "பொருள் எல்லைகளைச் சேர்" +"view.outlinesSelection" = "தேர்வுக்கு அவுட்லைன்களைக் காட்டு" +"view.prototype" = "ப்ரோட்டோடைப்" +"view.themeDark" = "இருண்ட" +"view.themeLight" = "ஒளிர்வான" +"view.themeSystem" = "சிஸ்டத்தைப் பின்பற்று" diff --git a/crates/ui-egui/src/cjk.rs b/crates/ui-egui/src/cjk.rs index 18616671a..361873aee 100644 --- a/crates/ui-egui/src/cjk.rs +++ b/crates/ui-egui/src/cjk.rs @@ -131,6 +131,11 @@ fn shows(code: &str, web: bool) -> bool { // Arabic; keep the catalog out until an embedded Arabic fallback is supplied. return figcraft_text::face_with_char('ع', &["Noto Sans Arabic"]).is_some(); } + if code.split('-').next() == Some("ta") { + // Desktop draws Tamil with a system face (#2018); the web has none until craft-fonts + // carries Noto Sans Tamil. + return figcraft_text::face_with_char('த', &["Noto Sans Tamil"]).is_some(); + } let need = language(code); need == 0 || samples(need, 0, traditional(code)).iter().all(|(c, families)| figcraft_text::face_with_char(*c, families).is_some()) } @@ -228,6 +233,14 @@ mod tests { assert_eq!(shows("ar-SA", true), face); } + #[test] + fn the_web_offers_tamil_only_with_its_face() { + assert!(shows("ta", false), "desktop always lists Tamil"); + let face = figcraft_text::face_with_char('த', &["Noto Sans Tamil"]).is_some(); + assert_eq!(shows("ta", true), face); + assert_eq!(shows("ta-IN", true), face); + } + /// The UI language's script leads the fallback order; the others follow. #[test] fn the_ui_language_script_comes_first() { diff --git a/docs/translating.md b/docs/translating.md index 5f647816b..8bad40f0f 100644 --- a/docs/translating.md +++ b/docs/translating.md @@ -24,6 +24,8 @@ assistance and reviewed by a native speaker, and stays a draft until a maintaine Russian (`ru`, Русский) was reviewed and approved by VanTan; its catalog keeps Frame and Smart animate as familiar tool names and uses « » quotes. Turkish (`tr`) was machine-drafted and reviewed by a native speaker, and Swedish (`sv`) translates every UI string, command label and menu wording. +Tamil (`ta`, தமிழ்) was machine-drafted and reviewed by a native speaker, and stays a draft until a +maintainer changes its status. ## The catalogs @@ -76,7 +78,11 @@ written in Latin script with ijekavian forms and Bosnian words (historija, hilja sedmica), uses bare imperatives for buttons and menu items (Sačuvaj, Izbriši) and the formal Vi for instructions (Odaberite, Kliknite), „ “ quotes, and consistent design terms (okvir, sloj, komponenta, instanca, varijanta, automatski raspored, ograničenja, ispuna, obrub, efekat, varijabla, -stil, način for a variable mode, dodatak for a plugin). +stil, način for a variable mode, dodatak for a plugin). Tamil uses modern written Tamil, bare +imperatives for buttons and menu items (சேமி, நீக்கு), the polite -கவும் for instructions +(தேர்ந்தெடுக்கவும்), Western digits, and design terms in Tamil script as Tamil designers say them +(ஃப்ரேம், லேயர், காம்போனென்ட், இன்ஸ்டன்ஸ், ஆட்டோ லேஅவுட்) while everyday words are translated +(கோப்பு, பக்கம், நிறம், ஏற்றுமதி). A case ending follows a placeholder after a space (`{name} கோப்பை`). CJK and Thai text need their own fonts, which egui and Inter lack: the desktop app adds an installed one when something on screen needs it, so layer and page names in those scripts show whatever the @@ -117,6 +123,17 @@ that face out, so Arabic is not offered on the web yet. No font is added to this repository. The interface's panels are not mirrored; this catalog does not claim a complete right-to-left interface. Native review and representative in-app checks remain required. +## Tamil draft + +`ta.toml` adds தமிழ் as a draft: 2,012 UI entries, 630 command labels and 31 menu wordings +(2,673 entries, measured 2026-11-09), covering every English key. Drafted with AI assistance against a +fixed style guide and glossary, then reviewed by a native speaker (#2159). + +The desktop UI draws Tamil in an installed face (Tamil Sangam MN, Nirmala UI or Noto Sans Tamil, +#2018); no font is added to this repository. The web picker leaves Tamil out until craft-fonts has +Noto Sans Tamil. Tamil runs longer than English: the left rail's Variables label and the frame type +dropdown cut it off. + ## Traditional Chinese (Taiwan) draft `zh-Hant.toml` adds 繁體中文(台灣) as a draft: 1,975 UI entries, 641 command labels and 31 menu From 5c50025270fac9ec187db56416f965eaa8fdc5ea Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Mon, 9 Nov 2026 08:37:11 -0500 Subject: [PATCH 043/101] M7: a connection dropped on a sibling variant creates Change to (#2158) A connection dragged from a variant (or a layer in it) onto a sibling variant of its set now creates Change to that variant (On click, Instant) and outlines the sibling while dragging, as measured in Figma. The set background and the variant itself add nothing; a frame outside the set still gets Navigate to. Co-Authored-By: Claude Sonnet 5.5 Model-Effort: Opus 5.5 drove and briefed; Sonnet 5.5 measured in Figma and wrote at medium --- crates/ui-egui/src/canvas/proto_canvas.rs | 56 +++++++- crates/ui-egui/src/lib.rs | 2 + .../src/proto_variant_connect_tests.rs | 126 ++++++++++++++++++ docs/prototyping-parity.md | 4 +- 4 files changed, 180 insertions(+), 8 deletions(-) create mode 100644 crates/ui-egui/src/proto_variant_connect_tests.rs diff --git a/crates/ui-egui/src/canvas/proto_canvas.rs b/crates/ui-egui/src/canvas/proto_canvas.rs index 1178ed6b2..b6955e956 100644 --- a/crates/ui-egui/src/canvas/proto_canvas.rs +++ b/crates/ui-egui/src/canvas/proto_canvas.rs @@ -119,7 +119,7 @@ fn segment_distance(a: Pos2, b: Pos2, q: Pos2) -> f32 { } /// Handle centres of the selected layers (right edge, vertically centred). -fn handles(app: &FigApp, doc: &Document, sel: &[NodeId]) -> Vec<(NodeId, Pos2)> { +pub(crate) fn handles(app: &FigApp, doc: &Document, sel: &[NodeId]) -> Vec<(NodeId, Pos2)> { sel.iter() .take(32) .filter(|i| doc.node(**i).is_some_and(|n| !n.is_page())) @@ -135,6 +135,46 @@ fn frame_at(app: &FigApp, doc: &Document, page: NodeId, p: Pos2) -> Option NodeId { + match self { + Target::Navigate(n) | Target::ChangeTo(n) => n, + } + } +} + +/// The variant (a child of a component set) the layer is, or sits inside. +fn variant_of(doc: &Document, source: NodeId) -> Option { + let is_set = |i: NodeId| doc.node(i).is_some_and(|n| matches!(n.kind, figcraft_doc::NodeKind::ComponentSet { .. })); + std::iter::once(source).chain(doc.ancestors(source)).find(|v| doc.node(*v).and_then(|n| n.parent).is_some_and(is_set)) +} + +/// What a connection dragged from `source` and released at screen point `p` targets: a sibling +/// variant of the source's own variant (Change to), else a frame other than the source's own +/// (Navigate to). +fn target_at(app: &FigApp, doc: &Document, page: NodeId, source: NodeId, p: Pos2) -> Option { + if let Some(v) = variant_of(doc, source) + && let Some(set) = doc.node(v).and_then(|n| n.parent) + && doc.node(set).is_some_and(|n| matches!(n.kind, figcraft_doc::NodeKind::ComponentSet { .. })) + { + let pt = app.to_page(p); + let siblings = doc.node(set).map(|n| n.children.clone()).unwrap_or_default(); + if let Some(w) = siblings.into_iter().rev().find(|w| doc.world_bounds(*w).is_some_and(|b| b.contains(pt))) { + return (w != v).then_some(Target::ChangeTo(w)); + } + } + frame_at(app, doc, page, p).filter(|f| doc.top_level_frame(source) != Some(*f)).map(Target::Navigate) +} + fn arrow(painter: &egui::Painter, pts: &[Pos2; 4], col: Color32) { let tip = pts[3]; let dir = (pts[3] - bezier(pts, 0.9)).normalized(); @@ -200,9 +240,8 @@ pub fn draw(app: &FigApp, painter: &egui::Painter) { } match dragging { Some(d) => { - if let Some(f) = frame_at(app, doc, page, d.pos) - && doc.top_level_frame(d.source) != Some(f) - && let Some(r) = screen_rect(app, doc, f) + if let Some(t) = target_at(app, doc, page, d.source, d.pos) + && let Some(r) = screen_rect(app, doc, t.node()) { painter.rect_stroke(r, CornerRadius::ZERO, Stroke::new(2.0, crate::theme::canvas_accent(painter.ctx())), StrokeKind::Outside); } @@ -259,9 +298,12 @@ pub fn input(app: &mut FigApp, ui: &egui::Ui, resp: &egui::Response) -> bool { ctx.request_repaint(); if released || !down { ctx.data_mut(|m| m.remove::(drag_id())); - if let Some(dest) = frame_at(app, &doc, page, d.pos) - && doc.top_level_frame(d.source) != Some(dest) - && let Some(r) = app.run("proto.interaction.add", json!({"ids": [d.source], "dest": dest})) + let params = target_at(app, &doc, page, d.source, d.pos).map(|t| match t { + Target::Navigate(dest) => json!({"ids": [d.source], "dest": dest}), + Target::ChangeTo(dest) => json!({"ids": [d.source], "action": {"type": "changeTo", "dest": dest}}), + }); + if let Some(params) = params + && let Some(r) = app.run("proto.interaction.add", params) { let k = r.get("index").and_then(Value::as_u64).unwrap_or(0) as usize; crate::proto_panel::open_editor(&ctx, Some((d.source, k))); diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 60c68f526..a9e620a7f 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -233,6 +233,8 @@ mod proto_reorder_tests; #[cfg(test)] mod proto_responsive_tests; #[cfg(test)] +mod proto_variant_connect_tests; +#[cfg(test)] mod region_fill_rows_tests; #[cfg(test)] mod resources_tests; diff --git a/crates/ui-egui/src/proto_variant_connect_tests.rs b/crates/ui-egui/src/proto_variant_connect_tests.rs new file mode 100644 index 000000000..b9f6ba812 --- /dev/null +++ b/crates/ui-egui/src/proto_variant_connect_tests.rs @@ -0,0 +1,126 @@ +//! A connection dragged out of a variant (or a layer in it) onto a sibling variant makes a Change +//! to it (On click, Instant), as in Figma (#2158); onto the set's background or its own variant it +//! makes nothing, and onto a frame outside the set it still navigates. + +use egui::{Pos2, pos2}; +use figcraft_doc::NodeId; +use figcraft_doc::proto::{Action, Transition, Trigger}; +use figcraft_engine::Session; +use serde_json::json; + +use crate::FigApp; +use crate::RightTab; +use crate::canvas::proto_canvas::handles; +use crate::present_tests::{Ui, id}; + +fn screen_centre(app: &FigApp, n: NodeId) -> Pos2 { + let b = app.session.doc().unwrap().world_bounds(n).unwrap(); + app.to_screen((b.x0 + b.x1) / 2.0, (b.y0 + b.y1) / 2.0) +} + +struct Setup { + u: Ui, + set: NodeId, + default: NodeId, + hover: NodeId, + layer: NodeId, + outside: NodeId, +} + +fn setup() -> Setup { + let mut s = Session::new(); + let mut variant = |name: &str, x: f64| { + let f = id(&s.execute("frame.create", &json!({"x": x, "y": 0, "width": 100, "height": 80, "name": name})).unwrap()); + id(&s.execute("component.create", &json!({"ids": [f]})).unwrap()) + }; + let default = variant("Property 1=Default", 0.0); + let hover = variant("Property 1=Hover", 300.0); + let layer = id(&s.execute("shape.rectangle", &json!({"x": 10, "y": 10, "width": 30, "height": 20, "parent": default})).unwrap()); + let outside = id(&s.execute("frame.create", &json!({"x": 0, "y": 500, "width": 200, "height": 150, "name": "Outside"})).unwrap()); + let set = id(&s.execute("component.combineVariants", &json!({"ids": [default, hover]})).unwrap()); + let mut u = Ui::new(s); + u.app.ui.right_tab = RightTab::Prototype; + Setup { u, set, default, hover, layer, outside } +} + +/// Select `source`, then drag its connection handle to the centre of `to` (or `at`) and release. +fn drag(t: &mut Setup, source: NodeId, to: Pos2) { + t.u.run("select.set", json!({"ids": [source]})); + t.u.run("view.zoomSelection", json!({})); + t.u.run("view.zoomFit", json!({})); + t.u.frames(2, Vec::new); + let doc = t.u.app.session.doc().unwrap().clone(); + let (_, at) = *handles(&t.u.app, &doc, &[source]).first().unwrap(); + t.u.button(at, true); + t.u.button(pos2((at.x + to.x) / 2.0, (at.y + to.y) / 2.0), true); + t.u.button(to, true); + t.u.button(to, false); + t.u.frames(2, Vec::new); +} + +fn interactions(t: &Setup, n: NodeId) -> Vec { + t.u.app.session.doc().unwrap().node(n).unwrap().interactions.clone() +} + +fn assert_change_to(t: &Setup, source: NodeId, dest: NodeId) { + let its = interactions(t, source); + assert_eq!(its.len(), 1, "{its:?}"); + assert_eq!(its[0].trigger, Trigger::OnClick); + assert_eq!(its[0].transition, Transition::Instant); + assert!(matches!(its[0].actions.as_slice(), [Action::ChangeTo { dest: d }] if *d == dest), "{:?}", its[0].actions); + assert_eq!(crate::proto_panel::editor(&t.u.ctx), Some((source, 0))); +} + +#[test] +fn a_variants_connection_dropped_on_a_sibling_variant_changes_to_it() { + let mut t = setup(); + let to = screen_centre(&t.u.app, t.hover); + let src = t.default; + drag(&mut t, src, to); + assert_change_to(&t, t.default, t.hover); +} + +#[test] +fn the_reverse_connection_changes_back() { + let mut t = setup(); + let to = screen_centre(&t.u.app, t.default); + let src = t.hover; + drag(&mut t, src, to); + assert_change_to(&t, t.hover, t.default); +} + +#[test] +fn a_layer_inside_a_variant_changes_its_set_to_the_sibling() { + let mut t = setup(); + let to = screen_centre(&t.u.app, t.hover); + let src = t.layer; + drag(&mut t, src, to); + assert_change_to(&t, t.layer, t.hover); +} + +#[test] +fn dropped_on_the_sets_background_or_its_own_variant_it_adds_nothing() { + let mut t = setup(); + // Between the two variants (x 100..300) and inside the set's padding. + let (a, b) = (screen_centre(&t.u.app, t.default), screen_centre(&t.u.app, t.hover)); + let gap = pos2((a.x + b.x) / 2.0, a.y); + let src = t.default; + drag(&mut t, src, gap); + assert!(interactions(&t, t.default).is_empty()); + let own = screen_centre(&t.u.app, t.default); + let src = t.default; + drag(&mut t, src, own); + assert!(interactions(&t, t.default).is_empty()); + let _ = t.set; +} + +#[test] +fn a_variant_dropped_on_a_frame_outside_the_set_still_navigates() { + let mut t = setup(); + let to = screen_centre(&t.u.app, t.outside); + let src = t.default; + drag(&mut t, src, to); + let its = interactions(&t, t.default); + assert_eq!(its.len(), 1, "{its:?}"); + assert!(matches!(its[0].actions.as_slice(), [Action::Navigate { dest, .. }] if *dest == t.outside), "{:?}", its[0].actions); +} diff --git a/docs/prototyping-parity.md b/docs/prototyping-parity.md index 7c216bcae..07e3c691d 100644 --- a/docs/prototyping-parity.md +++ b/docs/prototyping-parity.md @@ -1,6 +1,6 @@ # Prototyping parity -> **Last reviewed:** 2026-10-11 · **Last updated:** 2026-11-06 · **Change:** patch (`proto.settings` refuses an unknown device with the list of devices instead of saving it, takes a known one in any case, and answers the page's settings, so `proto.settings {}` reads them (#2027); Hide UI in the presenter's Options menu, and Cmd/Ctrl+\ as in the editor: the bar above the prototype and the navigation bar under it go away, a toast names the key that brings them back, `proto.presentOptions {hideUi}` (#1820); the Controller menu names each button as PlayStation and Switch controllers do; "Open in new tab" on Open link: off, the web build's own tab goes to the link; a manual overlay's position can be dragged on the canvas (#405); Open link notices now cover mail links, and skipping them covers only links the viewer fired (#1096); overlay positions relative to the layer that opens them; the Triggers row no longer lists delays on mouse triggers as missing; top-level frames bigger than the device's screen scroll in the player; Change to, set variable and set variable mode lay out what they change in the player, as the canvas does; presentation tabs, one per page of a file; a Present tab with device and scale controls (#537); core editor leftovers: delays on mouse triggers and manual overlay offsets; controller buttons on key/gamepad triggers, widgets that react in prototypes, `proto.evaluate` and the mode lookup rules pinned) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-11 · **Last updated:** 2026-11-09 · **Change:** patch (a connection dragged from a variant, or a layer in it, onto a sibling variant makes Change to, On click, Instant, with the sibling outlined (#2158); `proto.settings` refuses an unknown device with the list of devices instead of saving it, takes a known one in any case, and answers the page's settings, so `proto.settings {}` reads them (#2027); Hide UI in the presenter's Options menu, and Cmd/Ctrl+\ as in the editor: the bar above the prototype and the navigation bar under it go away, a toast names the key that brings them back, `proto.presentOptions {hideUi}` (#1820); the Controller menu names each button as PlayStation and Switch controllers do; "Open in new tab" on Open link: off, the web build's own tab goes to the link; a manual overlay's position can be dragged on the canvas (#405); Open link notices now cover mail links, and skipping them covers only links the viewer fired (#1096); overlay positions relative to the layer that opens them; the Triggers row no longer lists delays on mouse triggers as missing; top-level frames bigger than the device's screen scroll in the player; Change to, set variable and set variable mode lay out what they change in the player, as the canvas does; presentation tabs, one per page of a file; a Present tab with device and scale controls (#537); core editor leftovers: delays on mouse triggers and manual overlay offsets; controller buttons on key/gamepad triggers, widgets that react in prototypes, `proto.evaluate` and the mode lookup rules pinned) · **Target:** Figma Design (desktop app 126.10.7) **Breadth ~92%, ready ~74% (estimated).** Every Figma trigger except media, every action except media control, every transition and easing exist; key/gamepad triggers take controller buttons, @@ -57,6 +57,7 @@ tool; opt-in), **silent** (the documentation doesn't say; the case pins the curr | Open link | pass | a new tab or browser window by default; with "Open in new tab" off, the web build's own tab goes to the link (the desktop app has no tab of its own to replace, so it opens the browser either way) | | Change to: another variant of the instance, in place, with the interaction's animation | pass | `interactive_components_change_in_place` | | Interactive components: every instance plays the interactions of the variant it shows; an interaction on the instance with the same trigger wins | **fixed** | instances played only interactions copied onto them when they were placed: an instance placed before its main got interactions did nothing, and one placed after kept the first variant's interactions after changing (a toggle went on but never off). New instances no longer copy them, and copies in older files give way to the variant shown; `instances_play_their_variants_interactions` | +| Drag a variant's (or a layer in it) connection onto a sibling variant: Change to, On click, Instant; the sibling is outlined | **fixed** | the drop only found top-level frames, and a variant's top-level frame is its set, so nothing happened. Dropped on the set's background or on its own variant it still adds nothing; on a frame outside the set it still navigates. Measured in Figma's web app, 2026-11-09; `a_variants_connection_dropped_on_a_sibling_variant_changes_to_it`, `the_reverse_connection_changes_back`, `a_layer_inside_a_variant_changes_its_set_to_the_sibling`, `dropped_on_the_sets_background_or_its_own_variant_it_adds_nothing`, `a_variant_dropped_on_a_frame_outside_the_set_still_navigates` | | Presentation tabs: one per page of a file, named "file - page" (renames follow). Play on a page that has a tab shows it as it was (from another start frame it starts again). Tabs keep their own copy of the prototype and play on after their file closes; a saved file opened again gets its tabs back. A tab never changes a file that isn't in front. Its X or Escape ends it and goes back to its file, or Home | **fixed** | one "Present" tab: a second presentation replaced the first, Play restarted it, and closing the file ended it; `present_tab_tests` | | Change to on a layer inside a nested instance changes the instance whose variant set holds the destination | **fixed** | the innermost instance (an icon inside a button) was changed instead | | Set variable, set variable mode, conditional | pass | `proto_run_tests`, `proto_conditional_tests`, `present_variables_tests` | @@ -107,6 +108,7 @@ tool; opt-in), **silent** (the documentation doesn't say; the case pins the curr | Date | Change | Summary | |---|---|---| +| 2026-11-09 | patch | M7, #2158: a connection dragged from a variant (or a layer in it) onto a sibling variant of its set did nothing, because the drop looked only for top-level frames and a variant's top-level frame is its set. It now creates Change to the sibling (On click, Instant, as measured in Figma's web app) and outlines the sibling while dragging; the set's background and the variant itself still add nothing, and a frame outside the set still gets Navigate to | | 2026-11-06 | patch | M5, #2027: `proto.settings` took any string as the device (`"Pixel Nonexistent"`, `"iphone 16"`) and saved it in the file; the presenter then drew no device while its picker showed the name as if it were one, and the settings couldn't be read back over MCP (`proto.settings {}` answered `{ok: true}`). An unknown name (or a non-string) is now refused with every name the picker offers (`None`, `Custom size` and the devices), as an unknown colour is refused with the device's colours, and nothing changes; a known name is taken in any case and stored as the picker spells it. Every call answers the page's settings after it: device, background, rotation, the colour shown, the screen as presented, the custom size and responsive. Test: `proto_present_tests::unknown_devices_are_refused_and_settings_read_back` | | 2026-10-31 | minor | Gap 15: the Controller menu names buttons as PlayStation and Switch controllers do; that item leaves the missing list. Estimate unchanged. Test: `present::tail_tests`. | | 2026-10-30 | minor | Opening a link in place: Open link has "Open in new tab", on by default; off, the web build's own tab goes to the link after the notice (or at once with it skipped); the desktop app has no tab of its own and opens the browser either way. Saved in files only when off (`openInNewTab`) and read from REST files. | From 1ee3087bc97fc1476a4026ab53fef32c851cbc05 Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Mon, 9 Nov 2026 08:46:12 -0500 Subject: [PATCH 044/101] M12: a sticky's text keeps its size and the note grows taller (#2157) FigJam's sticky text is 18 (Small) and never changes as the note fills; the note keeps its width and grows taller (measured in the web app, 2026-11-09). A new sticky's text is STICKY_TEXT_SIZE (18) and the normalize pass no longer resets a sticky's text size by its length, so saved stickies keep the size they have. No size menu yet. Co-Authored-By: Claude Sonnet 5.5 Model-Effort: Opus 5.5 drove and briefed; Sonnet 5.5 measured in Figma and wrote at medium --- crates/doc/src/board.rs | 4 +- crates/engine/src/board_tests.rs | 71 ++++++++++++++++++++--- crates/engine/src/boards/board.rs | 2 +- crates/engine/src/boards/board/derived.rs | 19 +----- crates/engine/src/boards/board/items.rs | 17 ++---- docs/boards-parity.md | 5 +- 6 files changed, 76 insertions(+), 42 deletions(-) diff --git a/crates/doc/src/board.rs b/crates/doc/src/board.rs index 89413b2e9..c0fcd7c68 100644 --- a/crates/doc/src/board.rs +++ b/crates/doc/src/board.rs @@ -37,8 +37,8 @@ impl FileKind { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(tag = "type", rename_all = "camelCase")] pub enum BoardItem { - /// A sticky note: a frame whose first text layer is the note (its size shrinks as the note - /// grows) and, below it, who wrote it. + /// A sticky note: a frame whose first text layer is the note (its size stays fixed, the note + /// grows taller) and, below it, who wrote it. Sticky { #[serde(default, skip_serializing_if = "String::is_empty")] author: String, diff --git a/crates/engine/src/board_tests.rs b/crates/engine/src/board_tests.rs index 9e99bd1c9..1b0ac120c 100644 --- a/crates/engine/src/board_tests.rs +++ b/crates/engine/src/board_tests.rs @@ -7,7 +7,7 @@ use figcraft_doc::{ use figcraft_geom::Point; use serde_json::{Value, json}; -use crate::board::{route, sticky_font_size}; +use crate::board::{STICKY_TEXT_SIZE, route}; use crate::collab_live_tests::Room; use crate::tools::{PointerEvent, PointerKind, ToolId}; use crate::{EngineError, Session}; @@ -77,7 +77,7 @@ fn board_commands_refuse_on_design_files_and_prototyping_refuses_on_boards() { } #[test] -fn a_sticky_is_a_square_frame_whose_note_shrinks_as_it_grows() { +fn a_sticky_is_a_square_frame_whose_note_grows_taller_as_it_fills() { let mut s = board(); s.prefs.user_name = "Ada".into(); let r = s.execute("board.sticky", &json!({"x": 10, "y": 20, "text": "Hi", "color": "blue"})).unwrap(); @@ -88,19 +88,74 @@ fn a_sticky_is_a_square_frame_whose_note_shrinks_as_it_grows() { assert_eq!(n.fills[0].solid_color(), board_color("blue")); assert!(n.layout.is_some() && !n.effects.is_empty()); assert_eq!(n.children.len(), 2, "the note and its author"); - assert_eq!(node(&s, note).kind.text().unwrap().style.font_size, 24.0); + assert_eq!(node(&s, note).kind.text().unwrap().style.font_size, 18.0); // A click on the note picks the sticky whole. let doc = s.doc().unwrap(); assert_eq!(figcraft_doc::geometry::select_target(doc, note, &[], false), st); - // A long note takes a smaller size; a very long one grows the sticky past its square. + // A long note keeps the size; a very long one grows the sticky past its square. let long = "word ".repeat(120); s.execute("node.set", &json!({"id": note, "props": {"characters": long}})).unwrap(); - assert_eq!(node(&s, note).kind.text().unwrap().style.font_size, sticky_font_size(&long)); - assert!(sticky_font_size(&long) < 16.0); + assert_eq!(node(&s, note).kind.text().unwrap().style.font_size, STICKY_TEXT_SIZE); assert!(node(&s, st).width == 200.0 && node(&s, st).height >= 200.0); - // Undo puts the short note and its size back. + // Undo puts the short note back. s.execute("edit.undo", &json!({})).unwrap(); - assert_eq!(node(&s, note).kind.text().unwrap().style.font_size, 24.0); + assert_eq!(node(&s, note).kind.text().unwrap().style.font_size, 18.0); +} + +#[test] +fn a_new_sticky_starts_at_18() { + let mut s = board(); + for (cmd, p) in [("board.sticky", json!({"x": 0, "y": 0, "text": "Hi"})), ("board.sticky", json!({"x": 300, "y": 0}))] { + let note = id(&s.execute(cmd, &p).unwrap(), "text"); + assert_eq!(node(&s, note).kind.text().unwrap().style.font_size, 18.0); + } + let next = id(&s.execute("board.nextSticky", &json!({})).unwrap(), "text"); + assert_eq!(node(&s, next).kind.text().unwrap().style.font_size, 18.0); + assert_eq!(STICKY_TEXT_SIZE, 18.0); +} + +#[test] +fn a_sticky_keeps_its_text_size_as_text_is_added() { + let mut s = board(); + let r = s.execute("board.sticky", &json!({"x": 0, "y": 0, "text": "one"})).unwrap(); + let (st, note) = (id(&r, "id"), id(&r, "text")); + let (height, text_height) = (node(&s, st).height, node(&s, note).height); + // Typing in the note: each step is a real edit that runs the normalize pass. + crate::board::edit_text(&mut s, st).unwrap(); + for _ in 0..9 { + crate::textedit::key(&mut s, "Enter", false, false, false).unwrap(); + crate::textedit::insert(&mut s, "another line").unwrap(); + } + let ten = node(&s, note).kind.text().unwrap().clone(); + assert_eq!(ten.characters.matches('\n').count(), 9, "ten lines"); + assert_eq!(ten.style.font_size, 18.0); + // Growth needs text measured: a build without the craft-fonts input measures nothing (the same + // reason `a_double_click_types_in_the_cell...` fails there), so it is only checked where it is. + let measured = node(&s, note).height > text_height; + assert!(!measured || node(&s, st).height > height, "ten lines make the note taller"); + assert_eq!(node(&s, st).child_layout.sizing_v, figcraft_doc::Sizing::Hug, "the note hugs its text"); + let (w, h10) = (node(&s, st).width, node(&s, st).height); + crate::textedit::insert(&mut s, &"a long paragraph ".repeat(15)).unwrap(); + crate::textedit::end(&mut s).unwrap(); + let t = node(&s, note).kind.text().unwrap().clone(); + assert!(t.characters.chars().count() >= 250); + assert_eq!(t.style.font_size, 18.0); + assert!(t.runs.iter().all(|r| r.style.font_size == 18.0)); + assert_eq!(node(&s, st).width, w, "the note keeps its width"); + assert!(!measured || node(&s, st).height > h10, "and grows taller"); +} + +#[test] +fn a_sticky_saved_with_another_text_size_keeps_it() { + let mut s = board(); + let r = s.execute("board.sticky", &json!({"x": 0, "y": 0, "text": "old"})).unwrap(); + let (st, note) = (id(&r, "id"), id(&r, "text")); + s.execute("node.set", &json!({"id": note, "props": {"fontSize": 11}})).unwrap(); + assert_eq!(node(&s, note).kind.text().unwrap().style.font_size, 11.0); + s.execute("node.set", &json!({"id": note, "props": {"characters": "old and now much longer than it was"}})).unwrap(); + assert_eq!(node(&s, note).kind.text().unwrap().style.font_size, 11.0, "an edit"); + s.execute("node.set", &json!({"id": st, "props": {"x": 40}})).unwrap(); + assert_eq!(node(&s, note).kind.text().unwrap().style.font_size, 11.0, "a move"); } #[test] diff --git a/crates/engine/src/boards/board.rs b/crates/engine/src/boards/board.rs index 1a66eed22..158e679d4 100644 --- a/crates/engine/src/boards/board.rs +++ b/crates/engine/src/boards/board.rs @@ -68,8 +68,8 @@ pub(crate) use edit::{copied_items, copy_map, rejoin}; use edit::{label_cmd, set_color, set_style}; pub(crate) use items::add_text; pub use items::{CONNECTED_GAP, connected_place}; +pub use items::{STICKY_TEXT_SIZE, edit_text, owner_of_text, text_of}; use items::{add_connected, ink_cmd, next_sticky, shape_cmd, stamp_cmd, sticky_cmd}; -pub use items::{edit_text, owner_of_text, sticky_font_size, text_of}; pub(crate) use reshape::path_handle_at; pub use reshape::selected_connector_handles; diff --git a/crates/engine/src/boards/board/derived.rs b/crates/engine/src/boards/board/derived.rs index 9fae17206..37a2f9ba9 100644 --- a/crates/engine/src/boards/board/derived.rs +++ b/crates/engine/src/boards/board/derived.rs @@ -1,7 +1,6 @@ use figcraft_doc::RouteEnd; -use super::edit::set_font_size; -use super::items::{owner_of_text, shape_padding, sticky_font_size, text_of}; +use super::items::shape_padding; use super::{ Affine, BTreeSet, BezPath, BoardItem, Connector, Document, End, NodeId, NodeKind, PathEl, Point, Rect, Routing, Shape, VectorNetwork, is_board, }; @@ -9,26 +8,14 @@ use super::{ // --------------------------------------------------------------------------------------------- // Derived data (the normalize pass). -/// Before text is measured: a sticky's note takes the size its length calls for, and a resized -/// shape keeps its text inside its outline. +/// Before text is measured: a resized shape keeps its text inside its outline. A sticky's text +/// keeps whatever size it has (FigJam's size is the note's own setting). pub(crate) fn settle_text(doc: &mut Document, before: &Document, touched: &BTreeSet) { if !is_board(doc) { return; } for &id in touched { let Some(n) = doc.node(id) else { continue }; - if let Some(owner) = - owner_of_text(doc, id).or(Some(id)).filter(|o| doc.node(*o).is_some_and(|k| matches!(k.board, Some(BoardItem::Sticky { .. })))) - && let Some(t) = text_of(doc, owner) - && let Some(NodeKind::Text(td)) = doc.node(t).map(|k| &k.kind) - { - let size = sticky_font_size(&td.characters); - let off = td.style.font_size != size || td.runs.iter().any(|r| r.style.font_size != size); - if off && let Some(NodeKind::Text(td)) = doc.node_mut(t).map(|k| &mut k.kind) { - set_font_size(td, size); - } - continue; - } if let Some(BoardItem::Shape { shape }) = n.board && before.node(id).is_none_or(|b| (b.width, b.height) != (n.width, n.height)) { diff --git a/crates/engine/src/boards/board/items.rs b/crates/engine/src/boards/board/items.rs index b409eeb90..115ce6d3b 100644 --- a/crates/engine/src/boards/board/items.rs +++ b/crates/engine/src/boards/board/items.rs @@ -57,18 +57,9 @@ pub(crate) fn add_text(doc: &mut Document, parent: NodeId, text: &str, size: f64 Ok(id) } -/// The text size a sticky's note gets: smaller the more it holds (by characters and lines, so -/// every copy of the file picks the same size whatever fonts it has). -pub fn sticky_font_size(text: &str) -> f64 { - let weight = text.chars().count() + 24 * text.matches('\n').count(); - match weight { - 0..=24 => 24.0, - 25..=64 => 20.0, - 65..=140 => 16.0, - 141..=280 => 13.0, - _ => 11.0, - } -} +/// The text size of a new sticky's note, FigJam's "Small" default (measured in the web app, +/// 2026-11-09): it never changes as the note fills, the note grows taller instead. +pub const STICKY_TEXT_SIZE: f64 = 18.0; /// A sticky note's layers: the frame, the note and (when known) its author. fn make_sticky(doc: &mut Document, parent: NodeId, at: (f64, f64), text: &str, color: Color, author: &str) -> Result<(NodeId, NodeId)> { @@ -89,7 +80,7 @@ fn make_sticky(doc: &mut Document, parent: NodeId, at: (f64, f64), text: &str, c n.board = Some(BoardItem::Sticky { author: author.to_string() }); })?; let inner = STICKY - 2.0 * STICKY_PAD; - let note = add_text(doc, id, text, sticky_font_size(text), INK, TextAlignH::Left, inner)?; + let note = add_text(doc, id, text, STICKY_TEXT_SIZE, INK, TextAlignH::Left, inner)?; if !author.is_empty() { let a = add_text(doc, id, author, 10.0, AUTHOR_INK, TextAlignH::Left, inner)?; if let Some(n) = doc.node_mut(a) { diff --git a/docs/boards-parity.md b/docs/boards-parity.md index 16456492c..2cc099f08 100644 --- a/docs/boards-parity.md +++ b/docs/boards-parity.md @@ -1,6 +1,6 @@ # Boards parity -> **Last reviewed:** 2026-10-24 · **Last updated:** 2026-11-04 · **Change:** minor (a `.jam` elbowed connector saved with its path keeps it on import instead of being routed again (#1910); a "+" handle dragged carries the preview: the next shape is made where it is let go, or a connector joins the object it is let go on (#1919); a connector attached to a side starts 4 pt outside the border, so its stroke never lies on the fill (#1916); 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 connector end dropped along a side of a shape attaches to that side (#1708); 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; a board keeps earlier votes' results, listed newest first in Results and deleted one at a time; a connector's bar sets its start and end points, dashes, weight and any colour (#1596); cells copied from a spreadsheet paste onto a board as a table; Shift+Cmd/Ctrl+Enter on a selected board shape adds the next shape already joined to it, and goes on typing (#1597); "+" handles beside a selected sticky or shape make the next one, joined by a connector (#1597); a FigJam `.jam` file opens as a board (#1342); board grid settings: dots, lines, graph paper or none, spacing, size and contrast; the connector tool shows the connector it will make while dragging, ends snapping to attach points (#1387); templates and tables; facilitation: a shared timer and voting sessions; the dot grid, dragging a connector's end to re-attach it, curved connectors, elbows that go around what they join) · **Target:** the incumbent's whiteboard product (behaviour from its public help centre) +> **Last reviewed:** 2026-10-24 · **Last updated:** 2026-11-09 · **Change:** minor (a sticky's text stays 18 and the note grows taller instead of the text shrinking, as measured in FigJam's web app (#2157); a `.jam` elbowed connector saved with its path keeps it on import instead of being routed again (#1910); a "+" handle dragged carries the preview: the next shape is made where it is let go, or a connector joins the object it is let go on (#1919); a connector attached to a side starts 4 pt outside the border, so its stroke never lies on the fill (#1916); 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 connector end dropped along a side of a shape attaches to that side (#1708); 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; a board keeps earlier votes' results, listed newest first in Results and deleted one at a time; a connector's bar sets its start and end points, dashes, weight and any colour (#1596); cells copied from a spreadsheet paste onto a board as a table; Shift+Cmd/Ctrl+Enter on a selected board shape adds the next shape already joined to it, and goes on typing (#1597); "+" handles beside a selected sticky or shape make the next one, joined by a connector (#1597); a FigJam `.jam` file opens as a board (#1342); board grid settings: dots, lines, graph paper or none, spacing, size and contrast; the connector tool shows the connector it will make while dragging, ends snapping to attach points (#1387); templates and tables; facilitation: a shared timer and voting sessions; the dot grid, dragging a connector's end to re-attach it, curved connectors, elbows that go around what they join) · **Target:** the incumbent's whiteboard product (behaviour from its public help centre) **Breadth ~47%, ready ~29% (estimated, erring low).** A board is a FigCraft file of its own kind (`file.newBoard`) with a dot grid on the page, sticky notes, shapes with text, connectors that @@ -30,7 +30,7 @@ all end with the same geometry. | Board toolbar at the bottom | done | Move/Hand, Marker/Highlighter/Eraser, Sticky (colour flyout), Shapes (flyout), Connector, Text, Section, Stamp (flyout), Comment, Actions, then the templates and the Design panel's buttons — on the same 32 pt grid as a design file's (no Resources button, as there) | | Design panel hidden by default; a contextual bar above the selection | done | colour, shape, text size (S/M/L/XL); for connectors straight/elbow/curved, the start and end points (none, round, square, line arrow, triangle arrow, reversed triangle, circle, diamond), solid or dashed, the weight, and any colour in the colour picker beside the board colours (#1596); each control says what it is on hover; the Design panel opens with its button or View ▸ Design panel | | Prototyping and Developer Mode refuse on boards | done | `proto.*`, `dev.*`, `view.prototype`, `view.devMode` say why | -| Sticky notes | done | a square frame (200 wide, growing taller through auto layout), 8 soft colours, a soft shadow, the note's text size shrinking as it grows (24 → 11, by characters and lines), the author's name at the bottom; a click places one and starts typing; Enter or a double-click edits; Shift+Cmd/Ctrl+Enter adds the next one beside it | +| Sticky notes | done | a square frame (200 wide, growing taller through auto layout), 8 soft colours, a soft shadow, the note's text 18 by default and fixed (FigJam's "Small"): the note grows taller as it fills and never shrinks its text, measured in FigJam's web app, 2026-11-09; stickies saved with another size keep it, and there is no size menu yet (#2157), the author's name at the bottom; a click places one and starts typing; Enter or a double-click edits; Shift+Cmd/Ctrl+Enter adds the next one beside it | | Sticky options: hide the author, change size presets, sticky stacks | partial | `board.sticky {author: false}`; no size presets or stacks | | Shapes with text | done | rectangle, rounded rectangle, ellipse, diamond, triangle, speech bubble, chevron; text centred and wrapping inside the outline; shape type and text size from the contextual bar | | Shape auto-fit to its text, more shapes (cylinder, cross, star…), shape libraries | missing | | @@ -72,6 +72,7 @@ all end with the same geometry. | Date | Change | Summary | |---|---|---| +| 2026-11-09 | patch | M12, #2157: a sticky's text is 18 and stays 18 (measured in FigJam's web app: ten lines, then a long paragraph, never changed it; the note kept its width and grew taller). The normalize pass no longer resets a sticky's text to a size by its length (24 down to 11 before), so stickies in saved files keep their size. Size presets (Small to Huge) are still missing. Tests: `a_new_sticky_starts_at_18`, `a_sticky_keeps_its_text_size_as_text_is_added`, `a_sticky_saved_with_another_text_size_keeps_it` | | 2026-11-03 | minor | M12, #1919: as the quick create help says ("Click to select and create the next shape in that direction, or drag the preview to any location on your board"; "A new shape is created with a connector and its text field active"), a "+" beside the selected sticky or shape can be dragged: the preview follows the pointer and, let go on empty board, the next one is made there, centred on the pointer, and joined by a connector leaving by the handle's side and arriving by the side facing it (`board.addConnected` gains `at: [x, y]`, a point of the page placed in the parent's coordinates); let go on another sticky or shape, inside a section or frame too (`board::sticky_or_shape_at`), a connector joins the two instead (`board.connector`), that object outlined while the pointer is over it; let go off the canvas or over the toolbar, nothing, and the bar above the selection stays away meanwhile, as for any drag. The click is as before. A shape picker on drop and choosing the connector type are not done (the help doesn't describe them). Tests: `board_connect_tests` (the drag ones), engine `board_connected_tests::the_next_one_goes_where_it_is_dropped`. Numbers unchanged. | | 2026-11-04 | minor | M12, #1916: a connector end attached to a side starts 4 pt outside the border (`board_route::END_GAP`), as FigJam's do (the issue's screenshots: the line starts a few pixels outside, with a round cap), so the stroke never lies on the fill; elbows leaving one side share their first run along its normal, curves leave tangent to it and straight ones fan out from the same point; the `.jam` importer's routes, re-attached ends, path handles and labels follow the route's points; an end placed by hand with Cmd/Ctrl held keeps its exact point. Tests: `board_route_tests` (three). Numbers unchanged. | | 2026-11-04 | patch | M6, #1910: a `.jam` elbowed connector saved with its path (FigJam's `connectorControlPoints`) keeps it on import: the points become the `ConnectorPath::Runs` a connector reshaped by hand has and the line is walked along them, so a connector drawn around a layer stays around it; one whose points don't make a path from its ends' sides is routed as before. Still a vector, not a native board object. Details in [`file-format-parity.md`](file-format-parity.md). | From 36cd59dada3ca260a5e54e588078d3dbd745cff0 Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Mon, 9 Nov 2026 09:38:54 -0500 Subject: [PATCH 045/101] M7: a grouped component set's background takes no connection either (#2161 review) A set in a group has no top-level frame, so a drop on its background fell through to frame_at and made a Navigate to the section around it. target_at now returns nothing for any point inside the source's set that misses a sibling variant, as Figma does; red-first UI test with the set in a group in a section. Co-Authored-By: Claude Opus 5.5 Model-Effort: Opus 5.5 checked the finding and wrote --- crates/ui-egui/src/canvas/proto_canvas.rs | 5 ++++ .../src/proto_variant_connect_tests.rs | 26 +++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/crates/ui-egui/src/canvas/proto_canvas.rs b/crates/ui-egui/src/canvas/proto_canvas.rs index b6955e956..3d7727f2c 100644 --- a/crates/ui-egui/src/canvas/proto_canvas.rs +++ b/crates/ui-egui/src/canvas/proto_canvas.rs @@ -171,6 +171,11 @@ fn target_at(app: &FigApp, doc: &Document, page: NodeId, source: NodeId, p: Pos2 if let Some(w) = siblings.into_iter().rev().find(|w| doc.world_bounds(*w).is_some_and(|b| b.contains(pt))) { return (w != v).then_some(Target::ChangeTo(w)); } + // The set's own background: nothing, as in Figma, whatever holds the set. (A set in a + // group has no top-level frame, so the fallback below would offer a section around it.) + if doc.world_bounds(set).is_some_and(|b| b.contains(pt)) { + return None; + } } frame_at(app, doc, page, p).filter(|f| doc.top_level_frame(source) != Some(*f)).map(Target::Navigate) } diff --git a/crates/ui-egui/src/proto_variant_connect_tests.rs b/crates/ui-egui/src/proto_variant_connect_tests.rs index b9f6ba812..db5f55a9d 100644 --- a/crates/ui-egui/src/proto_variant_connect_tests.rs +++ b/crates/ui-egui/src/proto_variant_connect_tests.rs @@ -28,6 +28,11 @@ struct Setup { } fn setup() -> Setup { + setup_in(false) +} + +/// `grouped`: the set is put in a group, inside a section around everything. +fn setup_in(grouped: bool) -> Setup { let mut s = Session::new(); let mut variant = |name: &str, x: f64| { let f = id(&s.execute("frame.create", &json!({"x": x, "y": 0, "width": 100, "height": 80, "name": name})).unwrap()); @@ -38,6 +43,12 @@ fn setup() -> Setup { let layer = id(&s.execute("shape.rectangle", &json!({"x": 10, "y": 10, "width": 30, "height": 20, "parent": default})).unwrap()); let outside = id(&s.execute("frame.create", &json!({"x": 0, "y": 500, "width": 200, "height": 150, "name": "Outside"})).unwrap()); let set = id(&s.execute("component.combineVariants", &json!({"ids": [default, hover]})).unwrap()); + if grouped { + let group = id(&s.execute("object.group", &json!({"ids": [set]})).unwrap()); + let section = id(&s.execute("node.create", &json!({"type": "section", "x": -200, "y": -200, "width": 1000, "height": 1000})).unwrap()); + s.execute("node.reparent", &json!({"ids": [group], "parent": section})).unwrap(); + assert_eq!(s.doc().unwrap().top_level_frame(default), None, "a set in a group has no top-level frame"); + } let mut u = Ui::new(s); u.app.ui.right_tab = RightTab::Prototype; Setup { u, set, default, hover, layer, outside } @@ -114,6 +125,21 @@ fn dropped_on_the_sets_background_or_its_own_variant_it_adds_nothing() { let _ = t.set; } +/// A set in a group in a section (CodeRabbit, #2161): its background still gives nothing, not a +/// Navigate to the section, and a sibling still gives Change to. +#[test] +fn in_a_grouped_set_the_background_adds_nothing_and_a_sibling_changes_to() { + let mut t = setup_in(true); + let (a, b) = (screen_centre(&t.u.app, t.default), screen_centre(&t.u.app, t.hover)); + let gap = pos2((a.x + b.x) / 2.0, a.y); + let src = t.default; + drag(&mut t, src, gap); + assert!(interactions(&t, t.default).is_empty(), "{:?}", interactions(&t, t.default)); + let to = screen_centre(&t.u.app, t.hover); + drag(&mut t, src, to); + assert_change_to(&t, t.default, t.hover); +} + #[test] fn a_variant_dropped_on_a_frame_outside_the_set_still_navigates() { let mut t = setup(); From ff3e4e6010b905bf7dc09c507a2078426efa9d37 Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Mon, 9 Nov 2026 09:38:56 -0500 Subject: [PATCH 046/101] M12: sticky growth checked with a measured font; the normalize note drops sticky size (#2164 review) The growth test scans the system fonts, as the other text-measuring engine tests do (#333), and asserts the note grows taller unconditionally instead of only when text happened to measure. docs/boards-parity.md no longer lists a sticky's text size among what the normalize pass derives. Co-Authored-By: Claude Opus 5.5 Model-Effort: Opus 5.5 checked the findings and wrote --- crates/engine/src/board_tests.rs | 11 ++++++----- docs/boards-parity.md | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/crates/engine/src/board_tests.rs b/crates/engine/src/board_tests.rs index 1b0ac120c..eb00647ac 100644 --- a/crates/engine/src/board_tests.rs +++ b/crates/engine/src/board_tests.rs @@ -116,6 +116,9 @@ fn a_new_sticky_starts_at_18() { #[test] fn a_sticky_keeps_its_text_size_as_text_is_added() { + // The note's growth needs text measured: without craft-fonts that is with a system font, + // scanned here rather than by whichever test happens to run first (#333). + figcraft_text::scan_system_fonts(); let mut s = board(); let r = s.execute("board.sticky", &json!({"x": 0, "y": 0, "text": "one"})).unwrap(); let (st, note) = (id(&r, "id"), id(&r, "text")); @@ -129,10 +132,8 @@ fn a_sticky_keeps_its_text_size_as_text_is_added() { let ten = node(&s, note).kind.text().unwrap().clone(); assert_eq!(ten.characters.matches('\n').count(), 9, "ten lines"); assert_eq!(ten.style.font_size, 18.0); - // Growth needs text measured: a build without the craft-fonts input measures nothing (the same - // reason `a_double_click_types_in_the_cell...` fails there), so it is only checked where it is. - let measured = node(&s, note).height > text_height; - assert!(!measured || node(&s, st).height > height, "ten lines make the note taller"); + assert!(node(&s, note).height > text_height, "ten lines make the text taller"); + assert!(node(&s, st).height > height, "and the note"); assert_eq!(node(&s, st).child_layout.sizing_v, figcraft_doc::Sizing::Hug, "the note hugs its text"); let (w, h10) = (node(&s, st).width, node(&s, st).height); crate::textedit::insert(&mut s, &"a long paragraph ".repeat(15)).unwrap(); @@ -142,7 +143,7 @@ fn a_sticky_keeps_its_text_size_as_text_is_added() { assert_eq!(t.style.font_size, 18.0); assert!(t.runs.iter().all(|r| r.style.font_size == 18.0)); assert_eq!(node(&s, st).width, w, "the note keeps its width"); - assert!(!measured || node(&s, st).height > h10, "and grows taller"); + assert!(node(&s, st).height > h10, "and grows taller"); } #[test] diff --git a/docs/boards-parity.md b/docs/boards-parity.md index 2cc099f08..f874daad5 100644 --- a/docs/boards-parity.md +++ b/docs/boards-parity.md @@ -17,8 +17,8 @@ design product). The work item is gap 24 in [`gaps.md`](gaps.md). Board objects are ordinary layers with a small `board` field on the node (`figcraft_doc::BoardItem`), so rendering, hit testing, undo, saving, SVG/PNG/PDF export, copy and paste and live sessions work on them unchanged. The file kind (`Document.kind`) is saved in `.figcraft` and reaches people who -join a live session in their snapshot. What follows from the metadata (a sticky's text size, a -shape's text room, connector routes and their labels) is recomputed in the engine's normalize pass, +join a live session in their snapshot. What follows from the metadata (a shape's text +room, connector routes and their labels) is recomputed in the engine's normalize pass, deterministically from the document, so local edits, undo and edits from others in a live session all end with the same geometry. From 6108efd4d2559b0cea9213dd3d6b2ff6bc9742d0 Mon Sep 17 00:00:00 2001 From: Ragulsundaram <41433645+Ragulsundaram@users.noreply.github.com> Date: Tue, 10 Nov 2026 00:11:02 +0530 Subject: [PATCH 047/101] i18n(ta): shorten Min W to match the other size labels --- crates/ui-egui/locales/ta.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ui-egui/locales/ta.toml b/crates/ui-egui/locales/ta.toml index 15b12d854..6ae9473ec 100644 --- a/crates/ui-egui/locales/ta.toml +++ b/crates/ui-egui/locales/ta.toml @@ -881,7 +881,7 @@ status = "draft — needs native review" "Merged" = "இணைக்கப்பட்டது" "Merged PRs" = "இணைக்கப்பட்ட PRகள்" "Min H" = "குறை. உ" -"Min W" = "குறைந்தபட்ச அகலம்" +"Min W" = "குறை. அ" "Minimize" = "சிறிதாக்கு" "Minutes" = "நிமிடங்கள்" "Mirror angle" = "கோணத்தைப் பிரதிபலி" From a54eafc0fc6b9a6d48f4e8751b3f46cd2a12763f Mon Sep 17 00:00:00 2001 From: ljkx <177671075+ljkx@users.noreply.github.com> Date: Mon, 9 Nov 2026 20:08:39 +0100 Subject: [PATCH 048/101] M1: test that picker Crop only sets the mode where Crop image doesn't apply (#2150) Choosing Crop in the colour picker starts crop mode only for one layer's own image fill. The new test chooses Crop for a stroke, for two layers' fills at once, and for a region's fill in vector edit mode (the layer's own fill an image too). In each case it checks that the paint takes the Crop mode, crop mode does not start, and the picker stays open. It also checks that crop_on_canvas gives nothing for a solid fill, an index with no fill, the page background and a style. --- crates/ui-egui/src/crop_image_tests.rs | 79 +++++++++++++++++++++++ crates/ui-egui/src/widgets/colorpicker.rs | 2 +- 2 files changed, 80 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/crop_image_tests.rs b/crates/ui-egui/src/crop_image_tests.rs index 9f802aee2..68ed04a81 100644 --- a/crates/ui-egui/src/crop_image_tests.rs +++ b/crates/ui-egui/src/crop_image_tests.rs @@ -193,3 +193,82 @@ fn crop_chosen_in_the_colour_picker_enters_crop_mode() { // The picture grew from 200 x 100 to 240 x 120: the layer shows 5/6 of what it showed. assert!((scaled[0] - after[0] * 5.0 / 6.0).abs() < 1e-6 && (scaled[3] - after[3] * 5.0 / 6.0).abs() < 1e-6, "{after:?} -> {scaled:?}"); } + +/// The first paint, an image, of `id`'s fills (`fills`) or strokes, or of region `region` of a vector. +fn image_at(u: &Ui, id: NodeId, fills: bool, region: Option) -> figcraft_color::ImagePaint { + let n = u.app.session.doc().unwrap().node(id).unwrap(); + let list = match region { + Some(r) => match &n.kind { + figcraft_doc::NodeKind::Vector { network } => network.regions[r].fills.clone().unwrap(), + _ => panic!("not a vector"), + }, + None if fills => n.fills.clone(), + None => n.strokes.clone(), + }; + match &list[0].kind { + PaintKind::Image(img) => img.clone(), + k => panic!("not an image: {k:?}"), + } +} + +/// Crop chosen in the picker for a paint that has no crop mode on the canvas (#2150) — a stroke, +/// several layers' fills at once, or a region's fill in vector edit mode — only sets the paint's +/// mode: crop mode doesn't start and the picker stays open. Targets that aren't one layer's image +/// fill have nothing for Crop image to crop either. +#[test] +fn crop_in_the_colour_picker_only_sets_the_mode_where_crop_image_does_not_apply() { + use crate::colorpicker::{PickerTarget, crop_on_canvas}; + let picture = |u: &Ui, id: NodeId| u.app.session.doc().unwrap().node(id).unwrap().fills[0].clone(); + // Opens the picker on `target`, chooses Crop and checks crop mode stays off. + let crop_only_sets_the_mode = |u: &mut Ui, target: PickerTarget, what: &str| { + u.app.ui.picker = Some(target.clone()); + for _ in 0..4 { + u.frame(vec![]); + } + choose_mode(u, "Fill", "Crop"); + assert_eq!(u.app.ui.crop, None, "{what}: no crop mode"); + assert_eq!(u.app.ui.picker, Some(target), "{what}: the picker stays open"); + }; + + // The layer's image as its stroke: the stroke's mode is set, the fill is left alone. + let (mut u, layer, _) = setup(); + let paint = picture(&u, layer); + u.app.run("stroke.add", json!({"ids": [layer], "paint": paint})); + crop_only_sets_the_mode(&mut u, PickerTarget::Paint { fills: false, index: 0, ids: vec![layer] }, "a stroke"); + assert_eq!(image_at(&u, layer, false, None).scale_mode, ImageScaleMode::Crop); + assert_eq!(mode(&u, layer), (ImageScaleMode::Fill, None), "the fill is untouched"); + + // Two image layers at once: both take the mode. + let (mut u, layer, rect) = setup(); + let paint = picture(&u, layer); + u.app.run("fill.set", json!({"ids": [rect], "index": 0, "paint": paint})); + u.app.run("select.set", json!({"ids": [layer, rect]})); + crop_only_sets_the_mode(&mut u, PickerTarget::Paint { fills: true, index: 0, ids: vec![layer, rect] }, "two layers"); + assert_eq!(mode(&u, layer).0, ImageScaleMode::Crop); + assert_eq!(mode(&u, rect).0, ImageScaleMode::Crop); + + // A region's own image fill in vector edit mode: the region's mode is set, the layer's image + // fill is untouched. + let (u0, layer, _) = setup(); + let paint = picture(&u0, layer); + let mut s = Session::new(); + let vector = crate::region_fill_rows_tests::two_region_vector(&mut s); + // The layer's own fill is an image too, so cropping it instead would be possible, and wrong. + s.execute("fill.set", &json!({"ids": [vector.0], "index": 0, "paint": paint})).unwrap(); + s.execute("vector.edit.begin", &json!({"id": vector.0})).unwrap(); + s.execute("vector.edit.select", &json!({"regions": [1]})).unwrap(); + s.execute("fill.set", &json!({"ids": [vector.0], "index": 0, "paint": paint})).unwrap(); + let layer_fills = s.doc().unwrap().node(vector).unwrap().fills.clone(); + let mut u = Ui::new(s); + crop_only_sets_the_mode(&mut u, PickerTarget::Paint { fills: true, index: 0, ids: vec![vector] }, "a region"); + assert_eq!(image_at(&u, vector, true, Some(1)).scale_mode, ImageScaleMode::Crop); + assert_eq!(u.app.session.doc().unwrap().node(vector).unwrap().fills, layer_fills, "the layer's fills are untouched"); + + // A fill that isn't an image, and targets that aren't a layer's paint, have no crop on the canvas. + let (u, layer, rect) = setup(); + assert_eq!(crop_on_canvas(&u.app, &PickerTarget::Paint { fills: true, index: 0, ids: vec![layer] }), Some((layer, 0))); + assert_eq!(crop_on_canvas(&u.app, &PickerTarget::Paint { fills: true, index: 0, ids: vec![rect] }), None, "a solid fill"); + assert_eq!(crop_on_canvas(&u.app, &PickerTarget::Paint { fills: true, index: 1, ids: vec![layer] }), None, "no fill there"); + assert_eq!(crop_on_canvas(&u.app, &PickerTarget::PageBackground), None); + assert_eq!(crop_on_canvas(&u.app, &PickerTarget::Style { id: "S:1".into(), index: 0 }), None); +} diff --git a/crates/ui-egui/src/widgets/colorpicker.rs b/crates/ui-egui/src/widgets/colorpicker.rs index 848a0c8d3..6aa0c4915 100644 --- a/crates/ui-egui/src/widgets/colorpicker.rs +++ b/crates/ui-egui/src/widgets/colorpicker.rs @@ -764,7 +764,7 @@ fn blend_row(ui: &mut Ui, app: &mut FigApp, target: &PickerTarget, paint: &mut P /// one layer's image fill as the Fill section shows it (a text's characters' shared fills /// included). Strokes, several layers at once and the regions selected in vector edit mode have /// no crop mode, so for them Crop only sets the paint's mode. -fn crop_on_canvas(app: &FigApp, target: &PickerTarget) -> Option<(NodeId, usize)> { +pub(crate) fn crop_on_canvas(app: &FigApp, target: &PickerTarget) -> Option<(NodeId, usize)> { let PickerTarget::Paint { fills: true, index, ids } = target else { return None }; let [id] = ids[..] else { return None }; if figcraft_engine::vectoredit::selected_region_fills(&app.session, id).is_some() { From 499717d6a0ff284d86c02aa48151b466a158ae2f Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Mon, 9 Nov 2026 14:32:49 -0500 Subject: [PATCH 049/101] M7: the variant connection docs name the grouped-set case and target_at's None cases (#2161 review) Co-Authored-By: Claude Opus 5.5 Model-Effort: Opus 5.5 checked and wrote --- crates/ui-egui/src/canvas/proto_canvas.rs | 3 ++- crates/ui-egui/src/proto_variant_connect_tests.rs | 2 +- docs/prototyping-parity.md | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/ui-egui/src/canvas/proto_canvas.rs b/crates/ui-egui/src/canvas/proto_canvas.rs index 3d7727f2c..b30fc604b 100644 --- a/crates/ui-egui/src/canvas/proto_canvas.rs +++ b/crates/ui-egui/src/canvas/proto_canvas.rs @@ -160,7 +160,8 @@ fn variant_of(doc: &Document, source: NodeId) -> Option { /// What a connection dragged from `source` and released at screen point `p` targets: a sibling /// variant of the source's own variant (Change to), else a frame other than the source's own -/// (Navigate to). +/// (Navigate to). `None` over the source's own variant, over the rest of its set (its background), +/// and where no frame or section is under the pointer. fn target_at(app: &FigApp, doc: &Document, page: NodeId, source: NodeId, p: Pos2) -> Option { if let Some(v) = variant_of(doc, source) && let Some(set) = doc.node(v).and_then(|n| n.parent) diff --git a/crates/ui-egui/src/proto_variant_connect_tests.rs b/crates/ui-egui/src/proto_variant_connect_tests.rs index db5f55a9d..0ab64ac81 100644 --- a/crates/ui-egui/src/proto_variant_connect_tests.rs +++ b/crates/ui-egui/src/proto_variant_connect_tests.rs @@ -54,7 +54,7 @@ fn setup_in(grouped: bool) -> Setup { Setup { u, set, default, hover, layer, outside } } -/// Select `source`, then drag its connection handle to the centre of `to` (or `at`) and release. +/// Select `source`, then drag its connection handle (found inside) to the screen point `to` and release. fn drag(t: &mut Setup, source: NodeId, to: Pos2) { t.u.run("select.set", json!({"ids": [source]})); t.u.run("view.zoomSelection", json!({})); diff --git a/docs/prototyping-parity.md b/docs/prototyping-parity.md index 07e3c691d..6ca217eec 100644 --- a/docs/prototyping-parity.md +++ b/docs/prototyping-parity.md @@ -57,7 +57,7 @@ tool; opt-in), **silent** (the documentation doesn't say; the case pins the curr | Open link | pass | a new tab or browser window by default; with "Open in new tab" off, the web build's own tab goes to the link (the desktop app has no tab of its own to replace, so it opens the browser either way) | | Change to: another variant of the instance, in place, with the interaction's animation | pass | `interactive_components_change_in_place` | | Interactive components: every instance plays the interactions of the variant it shows; an interaction on the instance with the same trigger wins | **fixed** | instances played only interactions copied onto them when they were placed: an instance placed before its main got interactions did nothing, and one placed after kept the first variant's interactions after changing (a toggle went on but never off). New instances no longer copy them, and copies in older files give way to the variant shown; `instances_play_their_variants_interactions` | -| Drag a variant's (or a layer in it) connection onto a sibling variant: Change to, On click, Instant; the sibling is outlined | **fixed** | the drop only found top-level frames, and a variant's top-level frame is its set, so nothing happened. Dropped on the set's background or on its own variant it still adds nothing; on a frame outside the set it still navigates. Measured in Figma's web app, 2026-11-09; `a_variants_connection_dropped_on_a_sibling_variant_changes_to_it`, `the_reverse_connection_changes_back`, `a_layer_inside_a_variant_changes_its_set_to_the_sibling`, `dropped_on_the_sets_background_or_its_own_variant_it_adds_nothing`, `a_variant_dropped_on_a_frame_outside_the_set_still_navigates` | +| Drag a variant's (or a layer in it) connection onto a sibling variant: Change to, On click, Instant; the sibling is outlined | **fixed** | the drop only found top-level frames, and a variant's top-level frame is its set, so nothing happened. Dropped on the set's background or on its own variant it still adds nothing, also when the set sits in a group inside a section (the background used to give a Navigate to that section); on a frame outside the set it still navigates. Measured in Figma's web app, 2026-11-09; `a_variants_connection_dropped_on_a_sibling_variant_changes_to_it`, `the_reverse_connection_changes_back`, `a_layer_inside_a_variant_changes_its_set_to_the_sibling`, `dropped_on_the_sets_background_or_its_own_variant_it_adds_nothing`, `a_variant_dropped_on_a_frame_outside_the_set_still_navigates`, `in_a_grouped_set_the_background_adds_nothing_and_a_sibling_changes_to` | | Presentation tabs: one per page of a file, named "file - page" (renames follow). Play on a page that has a tab shows it as it was (from another start frame it starts again). Tabs keep their own copy of the prototype and play on after their file closes; a saved file opened again gets its tabs back. A tab never changes a file that isn't in front. Its X or Escape ends it and goes back to its file, or Home | **fixed** | one "Present" tab: a second presentation replaced the first, Play restarted it, and closing the file ended it; `present_tab_tests` | | Change to on a layer inside a nested instance changes the instance whose variant set holds the destination | **fixed** | the innermost instance (an icon inside a button) was changed instead | | Set variable, set variable mode, conditional | pass | `proto_run_tests`, `proto_conditional_tests`, `present_variables_tests` | From 7a8d422dec9dc6a88fb7cc0d91867953aa01bf36 Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Mon, 9 Nov 2026 14:47:06 -0500 Subject: [PATCH 050/101] M8: the Scale field only takes the keyboard when the tool is chosen or the panel returns, and Ctrl/Alt+Enter keep the tool (#2148 review) A stale "field had the keyboard" flag no longer ends the tool on the first frame back from another tab. A selection appearing after K with nothing selected no longer moves the keyboard from the canvas to the Scale field. Ctrl+Enter and Alt+Enter are not the tool's exit. Tests pin the full text selection, the 2x and 1.5 factors, the field letting go after Enter and Escape, idle frames after Tab, and a leftover edit dropped on return. Co-Authored-By: Claude Sonnet 5.5 Model-Effort: Opus 5.5 triaged and briefed; Sonnet 5.5 verified and wrote at medium --- crates/ui-egui/src/field_tests.rs | 94 +++++++++++++++++++++++- crates/ui-egui/src/panels/right.rs | 3 + crates/ui-egui/src/panels/scale_panel.rs | 29 +++++++- 3 files changed, 121 insertions(+), 5 deletions(-) diff --git a/crates/ui-egui/src/field_tests.rs b/crates/ui-egui/src/field_tests.rs index 06b78823c..718d681f6 100644 --- a/crates/ui-egui/src/field_tests.rs +++ b/crates/ui-egui/src/field_tests.rs @@ -763,7 +763,55 @@ fn pressing_k_focuses_the_scale_field_with_its_text_selected() { assert!(scale_field_focused(&u), "the scale field has the keyboard"); let state = egui::TextEdit::load_state(&u.ctx, Id::unique("scale_k").with("te")).expect("the editor exists"); let range = state.cursor.char_range().expect("a selection"); - assert_ne!(range.primary.index, range.secondary.index, "its text is selected"); + let shown = u.ctx.data(|d| d.get_temp::(Id::unique("scale_k").with("editing"))).expect("the field is being edited"); + let (lo, hi) = (range.primary.index.min(range.secondary.index), range.primary.index.max(range.secondary.index)); + assert_eq!((lo, hi), (egui::text::CCursor::new(0).index, egui::text::CCursor::new(shown.chars().count()).index), "all of its text is selected"); +} + +/// K with nothing selected, then a selection: the field doesn't take the keyboard from the canvas. +#[test] +fn a_selection_after_k_does_not_move_the_keyboard_to_the_scale_field() { + let (mut u, r) = scale_setup(); + u.app.run("select.set", json!({"ids": []})); + u.frame(vec![]); + key(&mut u, Key::K, Modifiers::NONE); + for _ in 0..3 { + u.frame(vec![]); + } + u.app.run("select.set", json!({"ids": [r]})); + for _ in 0..3 { + u.frame(vec![]); + } + assert_eq!(u.app.session.tool.tool, figcraft_engine::ToolId::Scale); + assert!(!scale_field_focused(&u), "the canvas keeps the keyboard"); +} + +/// Ctrl+Enter in the factor field is not the tool's exit. +#[test] +fn ctrl_enter_in_the_scale_field_keeps_the_scale_tool() { + let (mut u, _) = scale_setup(); + key(&mut u, Key::K, Modifiers::NONE); + u.frame(vec![]); + key(&mut u, Key::Enter, Modifiers::CTRL); + u.frame(vec![]); + assert_eq!(u.app.session.tool.tool, figcraft_engine::ToolId::Scale); +} + +/// An Enter on the first frame the panel is back from another tab (the field not yet focused again) +/// doesn't end the tool on a stale "had the keyboard" flag. +#[test] +fn enter_on_the_first_frame_back_from_another_tab_keeps_the_scale_tool() { + let (mut u, _) = scale_setup(); + key(&mut u, Key::K, Modifiers::NONE); + u.frame(vec![]); + assert!(scale_field_focused(&u)); + u.app.ui.right_tab = crate::state::RightTab::Prototype; + u.frame(vec![]); + u.frame(vec![]); + u.app.ui.right_tab = crate::state::RightTab::Design; + key(&mut u, Key::Enter, Modifiers::NONE); + u.frame(vec![]); + assert_eq!(u.app.session.tool.tool, figcraft_engine::ToolId::Scale); } /// The Scale tool chosen again while the Design tab was away (Prototype tab, Move, then K): the @@ -786,6 +834,30 @@ fn the_scale_field_takes_the_keyboard_again_after_another_tab() { assert!(scale_field_focused(&u), "the field has the keyboard again"); } +/// A value typed and left unsettled when the panel went away is dropped: back again, the field +/// shows the fresh value with all of its text selected, so typing replaces it. +#[test] +fn the_scale_field_comes_back_fresh_with_its_text_selected() { + let (mut u, r) = scale_setup(); + key(&mut u, Key::K, Modifiers::NONE); + u.frame(vec![]); + u.frame(vec![Event::Text("7".to_string())]); + u.app.ui.right_tab = crate::state::RightTab::Prototype; + u.frame(vec![]); + u.frame(vec![]); + u.app.ui.right_tab = crate::state::RightTab::Design; + u.frame(vec![]); + u.frame(vec![]); + assert!(scale_field_focused(&u)); + let shown = u.ctx.data(|d| d.get_temp::(Id::unique("scale_k").with("editing"))).expect("the field is being edited"); + assert_ne!(shown, "7", "the leftover edit is gone"); + let state = egui::TextEdit::load_state(&u.ctx, Id::unique("scale_k").with("te")).expect("the editor exists"); + let range = state.cursor.char_range().expect("a selection"); + let (lo, hi) = (range.primary.index.min(range.secondary.index), range.primary.index.max(range.secondary.index)); + assert_eq!((lo, hi), (egui::text::CCursor::new(0).index, egui::text::CCursor::new(shown.chars().count()).index)); + assert_eq!(geom(&u, r), (0.0, 0.0, 100.0, 100.0)); +} + /// Tab moves the keyboard from the factor field to the next one; an Enter there leaves the /// Scale tool on. #[test] @@ -798,6 +870,10 @@ fn enter_in_another_field_after_tab_keeps_the_scale_tool() { let ev = |key, pressed| Event::Key { key, physical_key: None, pressed, repeat: false, modifiers: Modifiers::NONE }; u.frame(vec![ev(Key::Tab, true), ev(Key::Tab, false)]); assert!(!scale_field_focused(&u), "Tab moved the keyboard on"); + for _ in 0..4 { + u.frame(vec![]); + assert!(!scale_field_focused(&u), "the field doesn't take the keyboard back"); + } u.frame(vec![ev(Key::Enter, true), ev(Key::Enter, false)]); u.frame(vec![]); assert_eq!(u.app.session.tool.tool, figcraft_engine::ToolId::Scale); @@ -815,6 +891,7 @@ fn k_two_enter_scales_the_selection_by_two() { u.frame(vec![]); // About the panel's origin, FigCraft's top-left default (Figma's grid starts at the centre). assert_eq!(geom(&u, r), (0.0, 0.0, 200.0, 200.0)); + assert!(!scale_field_focused(&u), "the field let go of the keyboard"); assert_eq!(u.app.session.tool.tool, figcraft_engine::ToolId::Move); assert_eq!(u.app.session.ds().unwrap().selection, vec![r]); assert_eq!(undo_steps(&u), steps + 1); @@ -822,6 +899,20 @@ fn k_two_enter_scales_the_selection_by_two() { assert_eq!(geom(&u, r), (0.0, 0.0, 100.0, 100.0)); } +/// "2x" and "1.5" are factors too. +#[test] +fn the_scale_field_takes_2x_and_1_5() { + for (text, size) in [("2x", 200.0), ("1.5", 150.0)] { + let (mut u, r) = scale_setup(); + key(&mut u, Key::K, Modifiers::NONE); + u.frame(vec![]); + u.frame(vec![Event::Text(text.to_string())]); + key(&mut u, Key::Enter, Modifiers::NONE); + u.frame(vec![]); + assert_eq!(geom(&u, r), (0.0, 0.0, size, size), "{text}"); + } +} + /// Escape in the scale field closes it and changes nothing. #[test] fn escape_in_the_scale_field_closes_it_and_changes_nothing() { @@ -833,6 +924,7 @@ fn escape_in_the_scale_field_closes_it_and_changes_nothing() { key(&mut u, Key::Escape, Modifiers::NONE); u.frame(vec![]); assert_eq!(geom(&u, r), (0.0, 0.0, 100.0, 100.0)); + assert!(!scale_field_focused(&u), "the field let go of the keyboard"); assert_eq!(u.app.session.tool.tool, figcraft_engine::ToolId::Move); assert_eq!(u.app.session.ds().unwrap().selection, vec![r]); assert_eq!(undo_steps(&u), steps); diff --git a/crates/ui-egui/src/panels/right.rs b/crates/ui-egui/src/panels/right.rs index bba57c778..84572016f 100644 --- a/crates/ui-egui/src/panels/right.rs +++ b/crates/ui-egui/src/panels/right.rs @@ -264,6 +264,9 @@ fn design(app: &mut FigApp, ui: &mut Ui) { let sel = ds.selection.clone(); let vector_edit = ds.vector_edit.clone(); if sel.is_empty() { + if app.session.tool.tool == figcraft_engine::ToolId::Scale { + crate::scale_panel::note_no_selection(ui); + } page_section(app, ui, &doc); return; } diff --git a/crates/ui-egui/src/panels/scale_panel.rs b/crates/ui-egui/src/panels/scale_panel.rs index 9b6dd98a1..dea30ae05 100644 --- a/crates/ui-egui/src/panels/scale_panel.rs +++ b/crates/ui-egui/src/panels/scale_panel.rs @@ -15,7 +15,10 @@ use crate::widgets::{self, FieldEdit, Lead}; /// The Scale section, shown in place of Position while the Scale tool is active. pub fn section(app: &mut FigApp, ui: &mut Ui, doc: &Document, sel: &[NodeId]) { - let Some(b) = doc.bounds_of(sel) else { return }; + let Some(b) = doc.bounds_of(sel) else { + note_no_selection(ui); + return; + }; widgets::section_header(ui, tr("Scale"), &[], false); // The factor field takes the keyboard, with its text selected, whenever the section shows // after a frame without it: the tool was chosen, or the panel came back from another tab or a @@ -25,7 +28,8 @@ pub fn section(app: &mut FigApp, ui: &mut Ui, doc: &Document, sel: &[NodeId]) { let frame = ui.ctx().cumulative_frame_nr(); let last = ui.data(|d| d.get_temp::(shown_id)); ui.data_mut(|d| d.insert_temp(shown_id, frame)); - if last.is_none_or(|l| l.saturating_add(1) < frame) { + let reappeared = last.is_none_or(|l| l.saturating_add(1) < frame); + if reappeared { widgets::request_edit(ui, k_id); } // Enter or Escape in the factor field ends the tool (back to Move, the selection kept). Whether @@ -33,8 +37,14 @@ pub fn section(app: &mut FigApp, ui: &mut Ui, doc: &Document, sel: &[NodeId]) { // shortcut layer may let go of it before this frame's panel runs, and a click or Tab that moved // it to another field during the last frame counts. let in_k_id = Id::unique("scale_in_k"); - let in_k = ui.data(|d| d.get_temp::(in_k_id)).unwrap_or(false); - let (enter, esc) = ui.input(|i| (i.key_pressed(egui::Key::Enter), i.key_pressed(egui::Key::Escape))); + // A flag left from before a gap (another tab, a hidden panel) is stale: the field didn't have + // the keyboard on the frame before this one. + let in_k = !reappeared && ui.data(|d| d.get_temp::(in_k_id)).unwrap_or(false); + // Plain Enter or Escape only: Ctrl+Enter and Alt+Enter are not the tool's exit. + let (enter, esc) = ui.input(|i| { + let plain = !(i.modifiers.ctrl || i.modifiers.alt || i.modifiers.command); + (plain && i.key_pressed(egui::Key::Enter), plain && i.key_pressed(egui::Key::Escape)) + }); let col = widgets::col_width(ui.available_width()); // Anchor: column and row (0 start, 1 middle, 2 end) of the point that stays put. let anchor = app.session.tool.scale_anchor; @@ -93,6 +103,17 @@ pub fn section(app: &mut FigApp, ui: &mut Ui, doc: &Document, sel: &[NodeId]) { } } +/// The Scale tool is on but nothing is selected, so the section isn't shown: the frame still +/// counts as shown (a selection that appears later is not the tool being chosen, and the field must +/// not take the keyboard from the canvas), and the field is not the one with the keyboard. +pub fn note_no_selection(ui: &Ui) { + let frame = ui.ctx().cumulative_frame_nr(); + ui.data_mut(|d| { + d.insert_temp(Id::unique("scale_shown_frame"), frame); + d.insert_temp(Id::unique("scale_in_k"), false); + }); +} + /// The factor (clamped to 0.01–100) and pivot for scaling `b` by `k` around `anchor`; None when /// nothing would change or `k` isn't a usable number. fn scale_about(b: figcraft_geom::Rect, anchor: (u8, u8), k: f64) -> Option<(f64, f64, f64)> { From e415a3a0fb46eb32eafd9d807a11a0ae31fd8de2 Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Mon, 9 Nov 2026 15:16:36 -0500 Subject: [PATCH 051/101] M2: pin the leading-edge drag reorder at its boundaries, zero delta and several layers (#2142 review) Tests for the -129 leftward boundary, the vertical boundaries both ways, a drag with no move along the flow, and several moving layers using their combined box. Doc comments say whose edge is "leading" and what the caller passes; the parity row names the unchanged cases and the web-app measurement source. Co-Authored-By: Claude Sonnet 5.5 Model-Effort: Opus 5.5 triaged and briefed; Sonnet 5.5 verified and wrote at medium --- crates/engine/src/al_drag_tests.rs | 44 ++++++++++++++++++++++++++++++ crates/engine/src/canvas/drop.rs | 12 ++++---- docs/auto-layout-parity.md | 2 +- 3 files changed, 52 insertions(+), 6 deletions(-) diff --git a/crates/engine/src/al_drag_tests.rs b/crates/engine/src/al_drag_tests.rs index 23f416481..0c5119fc5 100644 --- a/crates/engine/src/al_drag_tests.rs +++ b/crates/engine/src/al_drag_tests.rs @@ -122,3 +122,47 @@ fn a_column_reorders_by_the_bottom_edge() { assert_eq!(dragged_order("vertical", 0, 30.0, 50.0), vec![1, 0, 2]); assert_eq!(dragged_order("vertical", 0, 30.0, 130.0), vec![1, 2, 0]); } + +#[test] +fn a_child_dragged_left_passes_the_second_sibling_one_pixel_later() { + assert_eq!(dragged_order("horizontal", 2, 30.0, -129.0), vec![0, 2, 1]); +} + +#[test] +fn a_column_reorders_at_the_boundaries_both_ways() { + assert_eq!(dragged_order("vertical", 0, 30.0, 49.0), vec![0, 1, 2]); + assert_eq!(dragged_order("vertical", 0, 30.0, 129.0), vec![1, 0, 2]); + assert_eq!(dragged_order("vertical", 2, 30.0, -49.0), vec![0, 1, 2]); + assert_eq!(dragged_order("vertical", 2, 30.0, -50.0), vec![0, 2, 1]); + assert_eq!(dragged_order("vertical", 2, 30.0, -129.0), vec![0, 2, 1]); + assert_eq!(dragged_order("vertical", 2, 30.0, -130.0), vec![2, 0, 1]); +} + +#[test] +fn a_drag_with_no_move_along_the_flow_keeps_the_slot() { + // Back at the start, and a drag across the flow only, with snapping on (the default). + assert_eq!(dragged_order("horizontal", 1, 30.0, 0.0), vec![0, 1, 2]); + assert_eq!(dragged_order("vertical", 1, 30.0, 0.0), vec![0, 1, 2]); + let mut s = Session::new(); + let (f, kids) = three(&mut s, "horizontal"); + let b = s.doc().unwrap().world_bounds(kids[1]).unwrap(); + let from = (b.center().x, b.center().y); + drag(&mut s, from, (from.0, from.1 + 40.0)); + let order = s.doc().unwrap().node(f).unwrap().children.clone(); + assert_eq!(order, kids.to_vec()); +} + +#[test] +fn several_dragged_children_use_their_combined_box() { + // Kids 0 and 1 together span 0..140; moved right by 49 the leading edge is at 189, just short of the middle of kid 2 (190). + for (by, expected) in [(49.0, vec![0, 1, 2]), (50.0, vec![2, 0, 1])] { + let mut s = Session::new(); + let (f, kids) = three(&mut s, "horizontal"); + s.execute("select.set", &json!({"ids": [kids[0], kids[1]]})).unwrap(); + let b = s.doc().unwrap().world_bounds(kids[0]).unwrap(); + let from = (b.center().x, b.center().y); + drag(&mut s, from, (from.0 + by, from.1)); + let order: Vec = s.doc().unwrap().node(f).unwrap().children.iter().map(|c| kids.iter().position(|k| k == c).unwrap()).collect(); + assert_eq!(order, expected, "by {by}"); + } +} diff --git a/crates/engine/src/canvas/drop.rs b/crates/engine/src/canvas/drop.rs index 7bad66ac3..f8c73de3e 100644 --- a/crates/engine/src/canvas/drop.rs +++ b/crates/engine/src/canvas/drop.rs @@ -24,9 +24,10 @@ pub fn auto_layout_slot(doc: &Document, parent: NodeId, p: Point, exclude: &[Nod } /// [`auto_layout_slot`] for layers dragged within their own frame (measured in Figma's web app, -/// 2026-11-09): the slot follows the leading edge of `moved`, the box the layers would fill under -/// the pointer, in the direction of `delta` (the drag along the page). Wrapping layouts keep the -/// pointer rule. +/// 2026-11-09): the slot follows the leading edge of `moved` in the direction of `delta`. The caller +/// passes `moved` as the layers' combined start bounds plus the raw (unsnapped) drag, and `delta` +/// as that same drag on the page; only its sign along the flow axis matters, and a zero delta uses +/// the low edge. Wrapping layouts keep the pointer rule. pub fn auto_layout_slot_within( doc: &Document, parent: NodeId, @@ -62,8 +63,9 @@ fn slot_in( let mid = |c: &NodeId| doc.world_bounds(*c).map(|b| if vertical { b.center().y } else { b.center().x }); let k = if let Some((r, d)) = dragged { let (lo, hi, dd) = if vertical { (r.y0, r.y1, d.y) } else { (r.x0, r.x1, d.x) }; - // Forward: past every sibling whose middle the trailing edge has reached; backward: past - // every one whose middle lies before the leading (low) edge. + // Forward: past every sibling whose middle the leading (high) edge has reached; backward: past + // every one whose middle lies before the leading (low) edge. A zero delta (no move along the + // flow) takes the backward rule, which leaves the layers where they were. flow_ids.iter().position(|c| mid(c).is_some_and(|m| if dd > 0.0 { m > hi } else { m >= lo })).unwrap_or(flow_ids.len()) } else { let pos = if vertical { p.y } else { p.x }; diff --git a/docs/auto-layout-parity.md b/docs/auto-layout-parity.md index 16776ca5e..03b6fd830 100644 --- a/docs/auto-layout-parity.md +++ b/docs/auto-layout-parity.md @@ -88,7 +88,7 @@ Status: **pass** (a case in the suite holds), **fixed** (the suite found a diver | Absolute position (ignore auto layout) with constraints | done | | | Strokes included in layout (inside strokes), canvas stacking | done | | | On-canvas padding and gap handles, incl. wrap row/column gap and grid gaps | done | an automatic gap's handle shows the distance it has; dragging it fixes the gap from there (silent in the documentation) | -| Drag to reorder (wrap-aware, by row or column), into grid cells, across nested frames | done | `al_drag_tests.rs`. A child dragged within its own row or column takes its slot by the dragged box's leading edge, not the pointer: it passes a sibling when the edge facing the drag reaches the sibling's middle (right or bottom edge going forward, left or top edge going back), wherever it was grabbed. Measured in Figma's web app, 2026-11-09 (three 60 x 60 rectangles, gap 20: after B at 50, after C at 130; the mirror for a leftward drag; the same along y). Layers dragged in from outside and wrapping layouts keep the pointer rule (unmeasured). Tests: `a_child_dragged_right_passes_a_sibling_when_its_leading_edge_reaches_the_siblings_middle`, `where_the_child_is_grabbed_does_not_change_its_slot`, `a_child_dragged_left_passes_a_sibling_by_its_left_edge`, `a_column_reorders_by_the_bottom_edge` | +| Drag to reorder (wrap-aware, by row or column), into grid cells, across nested frames | done | `al_drag_tests.rs`. A child dragged within its own row or column takes its slot by the dragged box's leading edge, not the pointer: it passes a sibling when the edge facing the drag reaches the sibling's middle (right or bottom edge going forward, left or top edge going back), wherever it was grabbed. Measured in Figma's web app, 2026-11-09 (three 60 x 60 rectangles, gap 20: after B at 50, after C at 130; the mirror for a leftward drag; the same along y). Several moving layers use their combined box. Layers dragged in from outside, wrapping layouts, grids and a drag out of the frame keep their earlier rules (unmeasured). The measurement was made in the web app; the desktop target was not re-checked. Tests: `a_child_dragged_right_passes_a_sibling_when_its_leading_edge_reaches_the_siblings_middle`, `where_the_child_is_grabbed_does_not_change_its_slot`, `a_child_dragged_left_passes_a_sibling_by_its_left_edge`, `a_column_reorders_by_the_bottom_edge`, `a_column_reorders_at_the_boundaries_both_ways`, `a_drag_with_no_move_along_the_flow_keeps_the_slot`, `several_dragged_children_use_their_combined_box` | | Arrow keys move children one place (flows, rows, columns, grid cells, into neighbours) | done | `al_keys_tests.rs` | | Constraints: left, right, left and right, centre, scale; top/bottom likewise | done | | | Layout grids: columns, rows, grid; stretch/left/centre/right; variables bound | done | | From 966aa7b263e49ad64d8cd2000d35e0dd3c7c08ae Mon Sep 17 00:00:00 2001 From: ljkx <177671075+ljkx@users.noreply.github.com> Date: Mon, 9 Nov 2026 21:23:20 +0100 Subject: [PATCH 052/101] M8: automation roots refuse a path they can't look at, and review follow-ups (#1094) Review of the fix for #1094: - A path that can't be made absolute is refused instead of going on to be resolved. - A name on the way that can't be looked at for a reason other than nothing being there (no permission, for one) is refused: it may be a link that resolving would follow. Only "not found", "not a directory" and "invalid filename" count as nothing there. - Tests: the link part of the Windows test is its own test, so the spelling and device checks no longer share a test with a part that is skipped where links can't be made; the timing assertion is gone (the messages tell the cases apart); link chains of 39, 40 and 41 links; a root on a share against every network spelling, in both of the root's spellings; devices for read and write; `..` after a link; paths that aren't UTF-8. - Docs brought in line with the code. --- crates/engine/src/automation/file_access.rs | 59 ++++++--- .../src/automation/file_access/tests.rs | 118 +++++++++++++++--- 2 files changed, 137 insertions(+), 40 deletions(-) diff --git a/crates/engine/src/automation/file_access.rs b/crates/engine/src/automation/file_access.rs index 97c6cd2f5..249d3483c 100644 --- a/crates/engine/src/automation/file_access.rs +++ b/crates/engine/src/automation/file_access.rs @@ -14,9 +14,9 @@ //! checked is what is opened. //! //! On Windows, resolving a path opens it, and opening a path on another computer contacts that -//! computer and may send it the signed-in user's credentials. So before anything is resolved, a -//! path on another computer that no root is on, a device path, or one reached through a link that -//! leads to them is refused by how it is spelled (#1094). +//! computer and may send it the signed-in user's credentials. So on Windows, before anything is +//! resolved, a path on another computer whose share no root is on, a device path, or one reached +//! through a link that leads to them is refused by how it is spelled (#1094). #![allow(clippy::disallowed_methods)] use std::cell::RefCell; @@ -95,7 +95,9 @@ impl Roots { } } -/// Why `asked` is refused: it is outside every one of `roots`, the folders that may be `what`. +/// Why `asked` is refused: it is outside every one of `roots`, the folders that may be `what` +/// ("read" or "written"). The message lists those folders, or says that no folder may be `what` +/// when `roots` is empty. fn outside(asked: std::path::Display<'_>, roots: &[PathBuf], what: &str) -> String { if roots.is_empty() { return format!("automation path rejected: no folder may be {what} (no root for it was given): {asked}"); @@ -109,7 +111,8 @@ fn outside(asked: std::path::Display<'_>, roots: &[PathBuf], what: &str) -> Stri enum Unresolved { /// Its spelling leads to another computer ([`Refused::Network`]) or a device ([`Refused::Device`]). Spelled(Refused), - /// A link on the way leads there. + /// A link on the way leads there, or the way there can't be looked at: a link or folder on it + /// can't be read, it has more than [`MAX_LINKS`] links, or the path can't be made absolute. Linked, } @@ -119,13 +122,15 @@ const MAX_LINKS: u8 = 40; /// Why `path` is refused before anything on the way to it is opened, if it is: resolving it would /// open a path on another computer, which on Windows contacts that computer and may send it the /// signed-in user's credentials, or open a device (#1094). That is the case when the path as -/// given or made absolute is (see [`refused_spelling`]), or when a link on the way, or on the way -/// on from where one leads, leads to such a path ([`link_refused`]). A path on the share of one of -/// `roots` goes on to the usual check. +/// given or made absolute is refused by its spelling ([`refused_spelling`]), or when a link on +/// the way, or on the way on from where one leads, leads to such a path ([`link_refused`]). A path +/// on the share of one of `roots` goes on to the usual check. A path that can't be made absolute +/// is refused as well, rather than left to what comes next. fn refused_unresolved(path: &Path, roots: &[PathBuf]) -> Option { // Made absolute without looking at the disk (on Windows `GetFullPathNameW`, which also turns a - // bare device name such as `NUL` into `\\.\NUL`, as opening it would). - let abs = std::path::absolute(path).ok()?; + // bare device name such as `NUL` into `\\.\NUL`, as opening it would). Like opening, it takes + // `..` by name, so `link\..\x` is `x` and never goes through the link. + let Ok(abs) = std::path::absolute(path) else { return Some(Unresolved::Linked) }; if let Some(why) = [path, abs.as_path()].into_iter().find_map(|p| refused_spelling(&p.to_string_lossy(), roots)) { return Some(Unresolved::Spelled(why)); } @@ -135,36 +140,49 @@ fn refused_unresolved(path: &Path, roots: &[PathBuf]) -> Option { /// What is at a path, looked at without following a link there. #[derive(Debug, Clone, PartialEq, Eq)] enum Entry { - /// Nothing, or what can't be looked at: resolving the path meets the same there and goes no - /// further. + /// Nothing ([`nothing_there`]): resolving the path meets the same there and goes no further. Missing, + /// Something that can't be looked at (no permission, for one). It may be a link that resolving + /// the path would still follow, so the path is refused. + Unreadable, /// A file or a folder. Plain, /// A link, with where it leads (`None` when that can't be read). Link(Option), } -/// What is at `p` on disk (see [`Entry`]). +/// What is at `p` on disk (see [`Entry`]), looked at with [`std::fs::symlink_metadata`], which +/// doesn't follow a link there; a link's target is read with [`std::fs::read_link`]. fn on_disk(p: &Path) -> Entry { match std::fs::symlink_metadata(p) { Ok(m) if m.is_symlink() => Entry::Link(std::fs::read_link(p).ok()), Ok(_) => Entry::Plain, - Err(_) => Entry::Missing, + Err(e) if nothing_there(&e) => Entry::Missing, + Err(_) => Entry::Unreadable, } } +/// Whether looking at a path failed with `e` because nothing is there: no such name, a file where +/// a folder was expected, or a name no file can have. Any other failure says nothing about what is +/// there. +fn nothing_there(e: &std::io::Error) -> bool { + use std::io::ErrorKind::{InvalidFilename, NotADirectory, NotFound}; + matches!(e.kind(), NotFound | NotADirectory | InvalidFilename) +} + /// Why path `p` is refused by its spelling alone, if it is (see [`craft_docpath::resolve`], which /// reads both `/` and `\` as separators and compares names ignoring case): /// - on another computer (`\\server\share`, `//server/share`, `\\?\UNC\…`, `\\.\UNC\…`, or a /// server without a share) and on no root's share; /// - a device path (`\\.\pipe\…`, `\\?\GLOBALROOT\…`, `\\.\C:\…`), other than a local volume's -/// `\\?\Volume{…}\`, which a folder can be mounted as; +/// `\\?\Volume{…}\` or `\\.\Volume{…}\`, which a folder can be mounted as; /// - or with a device name (`CON`, `NUL`, `COM1.png`, `lpt1 `…) as any of its names: each folder on /// the way is opened in turn while the path is resolved, and the device behind a name such as /// `LPT1` can be a printer on another computer. fn refused_spelling(p: &str, roots: &[PathBuf]) -> Option { match craft_docpath::resolve(p, None) { - // With a root as the document, a path on its share is allowed. + // With a root passed as the document path (what a link would be relative to), a path on + // that root's share is allowed. Err(Refused::Network) if !roots.iter().any(|r| craft_docpath::resolve(p, Some(r)) != Err(Refused::Network)) => { return Some(Refused::Network); } @@ -186,10 +204,10 @@ fn is_volume(p: &str) -> bool { /// Whether a link on the way to `abs` (an absolute path) leads to a path [`refused_spelling`] /// refuses, following at most `links` links: one that leads to another, or on through further -/// links, is followed too, as resolving the path would. A link that can't be read, or more links -/// than that, are refused as well. Each name on the way is looked at with `look` ([`on_disk`]), -/// which doesn't follow a link: where a link leads is looked at only once its spelling is known -/// not to be refused. +/// links, is followed too, as resolving the path would. A link that can't be read, a name on the +/// way that can't be looked at ([`Entry::Unreadable`]), or more links than that, are refused as +/// well. Each name on the way is looked at with `look` ([`on_disk`]), which doesn't follow a +/// link: where a link leads is looked at only once its spelling is known not to be refused. fn link_refused(abs: &Path, roots: &[PathBuf], links: u8, look: &dyn Fn(&Path) -> Entry) -> bool { let mut at = PathBuf::new(); let mut rest = abs.components(); @@ -202,6 +220,7 @@ fn link_refused(abs: &Path, roots: &[PathBuf], links: u8, look: &dyn Fn(&Path) - Entry::Plain => continue, // Nothing is below what isn't there, so no link either. Entry::Missing => return false, + Entry::Unreadable => return true, Entry::Link(target) => target, }; let (Some(links), Some(target)) = (links.checked_sub(1), target) else { return true }; diff --git a/crates/engine/src/automation/file_access/tests.rs b/crates/engine/src/automation/file_access/tests.rs index 5f9c1ad5d..ebb01cebf 100644 --- a/crates/engine/src/automation/file_access/tests.rs +++ b/crates/engine/src/automation/file_access/tests.rs @@ -198,7 +198,8 @@ fn spellings_of_other_computers_and_devices_are_refused() { use super::refused_spelling; use craft_docpath::Refused::{Device, Network}; let local = [PathBuf::from(r"C:\work")]; - let network = [ + // On `\\192.0.2.1\share`. + let on_the_share = [ r"\\192.0.2.1\share\x.png", "//192.0.2.1/share/x.png", r"\/192.0.2.1/share\x.png", @@ -206,11 +207,14 @@ fn spellings_of_other_computers_and_devices_are_refused() { r"\\?\unc\192.0.2.1\share\x.png", "//?/UNC/192.0.2.1/share/x.png", r"\\.\UNC\192.0.2.1\share\x.png", + ]; + let elsewhere = [ // A server without a share is contacted too. r"\\192.0.2.1", r"\\192.0.2.1\", r"\\SERVER.\share \x.png", ]; + let network = [&on_the_share[..], &elsewhere[..]].concat(); let device = [ r"\\.\pipe\figcraft", r"\\?\GLOBALROOT\Device\Mup\192.0.2.1\share\x.png", @@ -236,6 +240,7 @@ fn spellings_of_other_computers_and_devices_are_refused() { r"C:\work\lpt.png", r"C:\work\nul-ish.txt", r"\\?\Volume{0b3b1c63-0000-0000-0000-100000000000}\x.png", + r"\\.\Volume{0b3b1c63-0000-0000-0000-100000000000}\x.png", "/home/u/work/x.png", "x.png", r"..\x.png", @@ -246,7 +251,18 @@ fn spellings_of_other_computers_and_devices_are_refused() { assert_eq!(refused_spelling(p, &local), want, "{p} with a local root"); } } - // A root on a share lets the paths on that share through, in any case and spelling, and only them. + // A root on a share lets the paths on that share through, in any case and spelling, and only them: + // every spelling above of a path on `\\192.0.2.1\share`, but not the server without a share + // or another server. + for root in [r"\\?\UNC\192.0.2.1\share", r"\\192.0.2.1\share\work"] { + let on_share = [PathBuf::from(root)]; + for p in on_the_share { + assert_eq!(refused_spelling(p, &on_share), None, "{p} with root {root}"); + } + for p in elsewhere { + assert_eq!(refused_spelling(p, &on_share), Some(Network), "{p} with root {root}"); + } + } let shared = [PathBuf::from(r"\\?\UNC\Server\Share\work")]; for p in [r"\\server\SHARE\work\x.png", r"\\?\UNC\SERVER\share\elsewhere\x.png", "//Server/Share/work/x.png"] { assert_eq!(refused_spelling(p, &shared), None, "{p}"); @@ -282,23 +298,37 @@ fn links_on_the_way_are_followed_by_their_spelling_first() { links.insert(at("root/remote"), Some(PathBuf::from(r"\\192.0.2.1\share"))); links.insert(at("root/far"), Some(at("root/remote/work"))); } + // Chains of `n` links, `root/-1` to `root/-2` and so on, the last one to `root/sub`. + for n in [MAX_LINKS - 1, MAX_LINKS, MAX_LINKS + 1] { + for i in 1..=n { + let next = if i == n { at("root/sub") } else { at(&format!("root/{n}-{}", i + 1)) }; + links.insert(at(&format!("root/{n}-{i}")), Some(next)); + } + } let plain = [at("root"), at("root/sub"), at("outside")]; + // What can't be looked at (no permission, say) may be a link, so it isn't taken for nothing. + let unreadable = at("root/locked"); let looked = RefCell::new(Vec::new()); let look = |p: &Path| { looked.borrow_mut().push(p.to_path_buf()); match links.get(p) { Some(target) => Entry::Link(target.clone()), None if base.starts_with(p) || plain.iter().any(|q| q == p) => Entry::Plain, + None if p == unreadable => Entry::Unreadable, None => Entry::Missing, } }; let refused = |rel: &str, roots: &[PathBuf]| link_refused(&at(rel), roots, MAX_LINKS, &look); - for rel in ["root/dev/x.png", "root/hop/x.png", "root/loop/x.png", "root/unreadable/x.png"] { + for rel in ["root/dev/x.png", "root/hop/x.png", "root/loop/x.png", "root/unreadable/x.png", "root/locked/x.png", "root/locked"] { assert!(refused(rel, &[]), "{rel}"); } for rel in ["root/alias/x.png", "root/sub/x.png", "root/x.png", "missing/dev/x.png"] { assert!(!refused(rel, &[]), "{rel}"); } + // As many links as are followed lead on; one more is refused. + assert!(!refused(&format!("root/{}-1/x.png", MAX_LINKS - 1), &[])); + assert!(!refused(&format!("root/{MAX_LINKS}-1/x.png"), &[])); + assert!(refused(&format!("root/{}-1/x.png", MAX_LINKS + 1), &[])); // A refused target isn't looked at, nor is anything below what isn't there. let looked = looked.take(); assert!(!looked.contains(&at("outside/nul")) && !looked.contains(&at("missing/dev")), "{looked:?}"); @@ -311,23 +341,57 @@ fn links_on_the_way_are_followed_by_their_spelling_first() { } } -/// A path on another computer, a device path, and a link to them are refused before anything is -/// opened: resolving them made Windows contact the server, which may send it the signed-in user's -/// credentials (#1094). Nothing answers on 192.0.2.1 (an address for documentation), so a path -/// there that is opened takes Windows seconds to give up on; one refused first, none. +/// A path that can't be looked at is refused rather than taken for one with nothing there (#1094): +/// only a failure that says nothing is there lets the walk stop, and a path that can't even be +/// made absolute isn't left to the checks after it. +#[test] +fn what_cannot_be_looked_at_is_refused() { + use super::{Unresolved, nothing_there, refused_unresolved}; + use std::io::{Error, ErrorKind}; + for kind in [ErrorKind::NotFound, ErrorKind::NotADirectory, ErrorKind::InvalidFilename] { + assert!(nothing_there(&Error::from(kind)), "{kind:?}"); + } + for kind in [ErrorKind::PermissionDenied, ErrorKind::ResourceBusy, ErrorKind::Interrupted, ErrorKind::Other] { + assert!(!nothing_there(&Error::from(kind)), "{kind:?}"); + } + assert_eq!(refused_unresolved(Path::new(""), &[]), Some(Unresolved::Linked)); +} + +/// On Windows a path is classified as Windows opens it (#1094): with `..` taken by name before +/// anything is opened (so a link followed by `..` is never gone through), and with names that +/// aren't Unicode (a lone surrogate) still read for the parts that are spelled in ASCII. +#[cfg(windows)] +#[test] +fn paths_are_classified_as_windows_opens_them() { + use super::{Unresolved, refused_unresolved}; + use craft_docpath::Refused::{Device, Network}; + use std::ffi::OsString; + use std::os::windows::ffi::OsStringExt; + assert_eq!(std::path::absolute(r"C:\work\remote\..\x.png").unwrap(), PathBuf::from(r"C:\work\x.png")); + // `before`, a lone surrogate, then `after`. + let odd = |before: &str, after: &str| { + let wide: Vec = before.encode_utf16().chain([0xD800]).chain(after.encode_utf16()).collect(); + PathBuf::from(OsString::from_wide(&wide)) + }; + assert_eq!(refused_unresolved(&odd(r"\\192.0.2.1\share\", ".png"), &[]), Some(Unresolved::Spelled(Network))); + assert_eq!(refused_unresolved(&odd(r"C:\figcraft-no-such-folder\", r"\nul"), &[]), Some(Unresolved::Spelled(Device))); + assert_eq!(refused_unresolved(&odd(r"C:\figcraft-no-such-folder\", ".png"), &[]), None); + // A NUL can't be passed to Windows at all, so the path can't be made absolute. + assert_eq!(refused_unresolved(Path::new("C:\\work\\a\0b.png"), &[]), Some(Unresolved::Linked)); +} + +/// A path on another computer and a device path are refused before anything is opened: resolving +/// them made Windows contact the server, which may send it the signed-in user's credentials +/// (#1094). Each is refused with a message that only the check before resolving gives: had the +/// path been resolved, 192.0.2.1 (an address for documentation, where nothing answers) would have +/// been contacted and the message would be the one for a path that can't be resolved. #[cfg(windows)] #[test] fn other_computers_and_devices_are_refused_before_anything_is_opened() { - use std::time::{Duration, Instant}; let f = Fixture::new("network"); let r = f.rw(); let read_only = Roots::new(&[f.p("root")], &[]).unwrap(); - let refused = |roots: &Roots, p: &str, access: Access| { - let t = Instant::now(); - let e = roots.check(Path::new(p), access).expect_err(p); - assert!(t.elapsed() < Duration::from_secs(3), "{p}: took {:?}, so it was opened", t.elapsed()); - e - }; + let refused = |roots: &Roots, p: &str, access: Access| roots.check(Path::new(p), access).expect_err(p); for p in [r"\\192.0.2.1\share\x.png", "//192.0.2.1/share/x.png", r"\\?\UNC\192.0.2.1\share\x.png", r"\\.\UNC\192.0.2.1\share\x.png", r"\\192.0.2.1"] { @@ -339,18 +403,30 @@ fn other_computers_and_devices_are_refused_before_anything_is_opened() { assert!(e.ends_with("is on another computer, and no folder that may be written is on its share"), "{p}: {e}"); } for p in [r"\\.\pipe\figcraft-roots", r"\\?\GLOBALROOT\Device\Mup\192.0.2.1\share\x.png", &f.p(r"root\COM1\x.png"), "nul"] { - let e = refused(&r, p, Access::Read); - assert!(e.ends_with("names a device, not a file"), "{p}: {e}"); + for access in [Access::Read, Access::Write] { + let e = refused(&r, p, access); + assert!(e.ends_with("names a device, not a file"), "{p}: {e}"); + } } // Local paths, in either spelling, are checked as before. let inside = std::fs::canonicalize(f.p("root")).unwrap().join("in.txt"); assert!(r.check(&inside, Access::Read).is_ok()); assert!(r.check(Path::new(&f.p(r"root\in.txt")), Access::Read).is_ok()); +} - // A link in a root to another computer is refused before it is followed, also through another - // link, and with the message any path outside gets: it doesn't tell where the link leads. +/// A link in a root to another computer is refused before it is followed (#1094), also through +/// another link, and with the message any path outside gets: it doesn't tell where the link +/// leads. Had the link been followed, the message would be the one for a path that can't be +/// resolved. This needs real links, which Windows lets only some accounts make: elsewhere it +/// says so and checks nothing (`links_on_the_way_are_followed_by_their_spelling_first` covers the +/// same walk with made-up links on every system). +#[cfg(windows)] +#[test] +fn links_to_other_computers_are_refused_before_they_are_followed() { + let f = Fixture::new("network-links"); + let r = f.rw(); if !symlink_dir(Path::new(r"\\192.0.2.1\share"), &f.0.join("root/remote")) || !symlink_dir(&f.0.join("root/remote/work"), &f.0.join("root/hop")) { - eprintln!("skipped links: this system doesn't let tests make symbolic links"); + eprintln!("skipped: this system doesn't let tests make symbolic links"); return; } // Relative to the link's folder. @@ -359,10 +435,12 @@ fn other_computers_and_devices_are_refused_before_anything_is_opened() { let standard = |p: &str| format!("automation path rejected: {p} is outside the folders that may be"); for p in [f.p("root/remote/x.png"), f.p("root/hop/x.png"), f.p("root/sub/up/x.png"), f.p("root/pipe")] { for access in [Access::Read, Access::Write] { - let e = refused(&r, &p, access); + let e = r.check(Path::new(&p), access).expect_err(&p); assert!(e.starts_with(&standard(&p)), "{p}: {e}"); } } + // `..` after the link is taken by name, so the link isn't gone through. + assert!(r.check(Path::new(&f.p(r"root\remote\..\in.txt")), Access::Read).is_ok()); // A link to a folder in the root still leads there. assert!(symlink_dir(&f.0.join("root/sub"), &f.0.join("root/alias"))); assert!(r.check(Path::new(&f.p("root/alias/x.png")), Access::Write).is_ok()); From 938f8b2ad983c17cab75713be42cc9067538c53d Mon Sep 17 00:00:00 2001 From: ljkx <177671075+ljkx@users.noreply.github.com> Date: Mon, 9 Nov 2026 21:29:18 +0100 Subject: [PATCH 053/101] M8: test that `..` after a link is taken by name on Windows (#1094) A junction, which any account can make, leads out of the root; the path through it and back with `..` is the file in the root, to the check and to Windows when it opens it. --- .../src/automation/file_access/tests.rs | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/crates/engine/src/automation/file_access/tests.rs b/crates/engine/src/automation/file_access/tests.rs index ebb01cebf..d642befb1 100644 --- a/crates/engine/src/automation/file_access/tests.rs +++ b/crates/engine/src/automation/file_access/tests.rs @@ -380,6 +380,28 @@ fn paths_are_classified_as_windows_opens_them() { assert_eq!(refused_unresolved(Path::new("C:\\work\\a\0b.png"), &[]), Some(Unresolved::Linked)); } +/// `..` after a link is taken by name, by the check and by Windows when it opens the path, so +/// `root\j\..\in.txt` is `root\in.txt` and the link `j` is never gone through (#1094). Shown with +/// a junction, a link any account can make: `j` leads out of the root to `outside`, and beside +/// `outside` is another `in.txt`, which is what `..` would reach through the link. +#[cfg(windows)] +#[test] +fn a_parent_after_a_link_is_taken_by_name() { + use super::{Entry, on_disk}; + let f = Fixture::new("parent"); + let r = f.rw(); + std::fs::write(f.0.join("in.txt"), b"beside").unwrap(); + let made = std::process::Command::new("cmd").args(["/C", "mklink", "/J"]).arg(f.0.join(r"root\j")).arg(f.0.join("outside")).output(); + assert!(made.is_ok_and(|o| o.status.success()), "a junction can be made"); + // The junction is a link to the check, and what is through it is outside. + assert!(matches!(on_disk(&f.0.join(r"root\j")), Entry::Link(Some(_)))); + assert!(r.check(Path::new(&f.p(r"root\j\secret.txt")), Access::Read).is_err()); + let through = f.p(r"root\j\..\in.txt"); + assert_eq!(r.check(Path::new(&through), Access::Read), r.check(Path::new(&f.p(r"root\in.txt")), Access::Read)); + assert!(r.check(Path::new(&through), Access::Read).is_ok()); + assert_eq!(std::fs::read(&through).unwrap(), b"in", "Windows opens the file in the root"); +} + /// A path on another computer and a device path are refused before anything is opened: resolving /// them made Windows contact the server, which may send it the signed-in user's credentials /// (#1094). Each is refused with a message that only the check before resolving gives: had the From 61389cdd5fc03fe76bea0c80f8bed3d0606c8da1 Mon Sep 17 00:00:00 2001 From: ljkx <177671075+ljkx@users.noreply.github.com> Date: Mon, 9 Nov 2026 21:51:37 +0100 Subject: [PATCH 054/101] M4: test the simplified stroke by how far it strays, at more accuracies and inputs (#1741) Review follow-ups, tests only. - The Pencil test and the `vector.simplify` test measure how far the result strays from the samples (at most 1.5), not only its box. - The Pencil test also draws with the Marker and the Highlighter, each stroke in a fresh session, and takes the layer that stroke made. - The `vector.simplify` test runs on an open stroke, a filled shape, a region with its own fill, and a stroke beside a filled shape. - The geom tests run at accuracies 0.1, 0.75 and 8.0, on quadratic and cubic inputs as well as lines, and check both ways round how far the result and the input are apart. - A path that turns straight back is checked to be kurbo's fit of each side on its own, with a point at the turn. - Empty paths, lone moves and segments after a close are covered. --- crates/engine/src/brush_tests.rs | 72 +++++--- crates/engine/src/vector_behaviour_tests.rs | 63 +++++-- crates/geom/src/tests.rs | 191 ++++++++++++++++++-- 3 files changed, 267 insertions(+), 59 deletions(-) diff --git a/crates/engine/src/brush_tests.rs b/crates/engine/src/brush_tests.rs index 50317496d..065e5eec9 100644 --- a/crates/engine/src/brush_tests.rs +++ b/crates/engine/src/brush_tests.rs @@ -8,6 +8,7 @@ use crate::params::id_of; use crate::tools::{PointerEvent, PointerKind, pressure_profile}; use figcraft_doc::{NodeId, NodeKind}; use figcraft_geom::Point; +use figcraft_geom::kurbo::PathEl; fn id(v: Value) -> NodeId { id_of(&v["id"]).unwrap() @@ -155,10 +156,12 @@ fn the_pencil_draws_white_on_a_dark_background() { /// where samples ran on nearly straight. Pointer pixels become fractional page points, so going /// back to a pixel lands on exactly the same point. Both sample runs are ones kurbo's fit took /// hundreds of units off. +/// +/// Each stroke is drawn in a fresh session, with the Pencil and with the Marker and Highlighter +/// of a board, whose ink comes from the same fit. Every point along the stroke drawn must lie +/// within 1.5 (twice the fit's accuracy) of the polyline through the samples. #[test] fn the_pencil_keeps_its_stroke_where_it_was_drawn() { - let mut s = Session::new(); - s.execute("tool.set", &json!({"tool": "pencil"})).unwrap(); let (p, q) = ((86.043_565_719_086_97, -173.744_402_349_100_94), (87.851_850_739_335_35, -179.202_846_445_954_52)); let back = [(80.0, -160.0), p, q, p, (95.0, -185.0)]; let straight = [ @@ -168,30 +171,47 @@ fn the_pencil_keeps_its_stroke_where_it_was_drawn() { (214.246_506_828_720_84, -211.228_827_590_623_24), (218.0, -214.0), ]; - for (what, samples) in [("out and back", &back[..]), ("nearly straight", &straight[..])] { - let (first, last) = (samples[0], samples[samples.len() - 1]); - s.pointer(&PointerEvent::at(PointerKind::Down, first.0, first.1, 1.0)).unwrap(); - for (x, y) in &samples[1..] { - s.pointer(&PointerEvent::at(PointerKind::Move, *x, *y, 1.0)).unwrap(); + for tool in ["pencil", "marker", "highlighter"] { + for (what, samples) in [("out and back", &back[..]), ("nearly straight", &straight[..])] { + let what = format!("{tool}, {what}"); + let mut s = if tool == "pencil" { Session::new() } else { crate::board_tests::board() }; + s.execute("tool.set", &json!({"tool": tool})).unwrap(); + let before: Vec = s.doc().unwrap().nodes().map(|n| n.id).collect(); + let (first, last) = (samples[0], samples[samples.len() - 1]); + s.pointer(&PointerEvent::at(PointerKind::Down, first.0, first.1, 1.0)).unwrap(); + for (x, y) in &samples[1..] { + s.pointer(&PointerEvent::at(PointerKind::Move, *x, *y, 1.0)).unwrap(); + } + s.pointer(&PointerEvent::at(PointerKind::Up, last.0, last.1, 1.0)).unwrap(); + // The layer the stroke made, and only it. + let doc = s.doc().unwrap(); + let made: Vec<&figcraft_doc::Node> = + doc.nodes().filter(|n| !before.contains(&n.id) && matches!(n.kind, NodeKind::Vector { .. })).collect(); + let [n] = made[..] else { panic!("{what}: {} vectors made", made.len()) }; + let NodeKind::Vector { network } = &n.kind else { panic!("{what}: not a vector") }; + let drawn = doc.world_transform(n.id) * network.stroke_path(); + let polyline = figcraft_geom::BezPath::from_vec( + samples + .iter() + .enumerate() + .map(|(k, (x, y))| if k == 0 { PathEl::MoveTo(Point::new(*x, *y)) } else { PathEl::LineTo(Point::new(*x, *y)) }) + .collect(), + ); + let d = crate::vector_behaviour_tests::strays(&drawn, &polyline); + assert!(d <= 1.5, "{what}: the stroke strays {d} from the samples: {}", drawn.to_svg()); + let samples_box = figcraft_geom::points_bounds(samples.iter().map(|(x, y)| Point::new(*x, *y))).unwrap(); + let node_box = doc.world_bounds(n.id).unwrap(); + if tool == "pencil" { + assert!(samples_box.inflate(1.5, 1.5).contains_rect(node_box), "{what}: the layer {node_box:?}, the samples {samples_box:?}"); + } + // The turn is a point of the stroke, where it was drawn. + if samples == back { + let xf = doc.world_transform(n.id); + assert!( + network.vertices.iter().any(|v| (xf * Point::new(v.x, v.y) - Point::new(q.0, q.1)).hypot() < 1e-6), + "{what}: no point at the turn" + ); + } } - s.pointer(&PointerEvent::at(PointerKind::Up, last.0, last.1, 1.0)).unwrap(); - let doc = s.doc().unwrap(); - let n = doc.nodes().filter(|n| matches!(n.kind, NodeKind::Vector { .. })).max_by_key(|n| n.id).unwrap(); - let NodeKind::Vector { network } = &n.kind else { panic!("{what}: not a vector") }; - let drawn = doc.world_transform(n.id) * network.stroke_path(); - let samples_box = figcraft_geom::points_bounds(samples.iter().map(|(x, y)| Point::new(*x, *y))).unwrap(); - let (path_box, node_box) = (figcraft_geom::Shape::bounding_box(&drawn), doc.world_bounds(n.id).unwrap()); - assert!( - samples_box.inflate(1.5, 1.5).contains_rect(path_box), - "{what}: the stroke {path_box:?} goes past the samples {samples_box:?}: {}", - drawn.to_svg() - ); - assert!(samples_box.inflate(1.5, 1.5).contains_rect(node_box), "{what}: the layer {node_box:?}, the samples {samples_box:?}"); } - // The turn is a point of the stroke, where it was drawn. - let doc = s.doc().unwrap(); - let turned = doc.nodes().find(|n| n.name == "Vector" && doc.world_bounds(n.id).is_some_and(|b| b.y1 < -150.0 && b.x1 < 100.0)).unwrap(); - let NodeKind::Vector { network } = &turned.kind else { panic!("not a vector") }; - let xf = doc.world_transform(turned.id); - assert!(network.vertices.iter().any(|v| (xf * Point::new(v.x, v.y) - Point::new(q.0, q.1)).hypot() < 1e-6), "no point at the turn"); } diff --git a/crates/engine/src/vector_behaviour_tests.rs b/crates/engine/src/vector_behaviour_tests.rs index 4666c3028..d1d6907ee 100644 --- a/crates/engine/src/vector_behaviour_tests.rs +++ b/crates/engine/src/vector_behaviour_tests.rs @@ -326,25 +326,56 @@ fn ex_to_vector(doc: &mut figcraft_doc::Document, id: NodeId) { doc.get_mut(id).unwrap().kind = NodeKind::Vector { network }; } -/// Simplify path keeps nearly collinear points near where they were: kurbo's fit, which Simplify -/// path and the Pencil share, ran a handle hundreds of units on along the line (#1741). +/// How far `path` strays from `from`: the largest distance from a point sampled along `path` to +/// the nearest segment of `from`. +pub(crate) fn strays(path: &BezPath, from: &BezPath) -> f64 { + use figcraft_geom::kurbo::ParamCurveNearest; + let segs: Vec<_> = from.segments().collect(); + path.segments() + .flat_map(|seg| (0..=32).map(move |i| seg.eval(f64::from(i) / 32.0))) + .map(|p| segs.iter().map(|s| s.nearest(p, 1e-6).distance_sq).fold(f64::INFINITY, f64::min).sqrt()) + .fold(0.0, f64::max) +} + +/// Simplify path keeps nearly collinear points, and a stroke that goes out and back, near where +/// they were: kurbo's fit, which Simplify path and the Pencil share, ran a handle hundreds of units +/// on along the line (#1741). That holds for each way the command simplifies a layer: an open +/// stroke, a filled shape, a region with its own fill, and a stroke beside a filled shape. #[test] fn simplify_keeps_nearly_collinear_points_near_them() { - let mut s = Session::new(); - let id = id_of(&ex(&mut s, "vector.create", json!({"path": "M0 0 L10 10"}))["id"]).unwrap(); - // The points exactly as sampled, at the page origin (`vector.create` would move them). - let d = "M209.5986907940155 -204.90932811973988 L211.27791426387097 -207.1909740207534 L214.24650682872084 -211.22882759062324"; - let before = BezPath::from_svg(d).unwrap(); - { - let n = s.doc_mut().unwrap().get_mut(id).unwrap(); - n.transform = figcraft_geom::Affine::IDENTITY; - n.kind = NodeKind::Vector { network: VectorNetwork::from_path(&before) }; + // The points exactly as sampled. + let straight = "M209.5986907940155 -204.90932811973988 L211.27791426387097 -207.1909740207534 L214.24650682872084 -211.22882759062324"; + let back = + "M80 -160 L86.04356571908697 -173.74440234910094 L87.85185073933535 -179.20284644595452 L86.04356571908697 -173.74440234910094 L95 -185"; + let shape = format!("{straight} L260 -150 Z"); + let cases = [ + ("an open stroke", straight.to_string(), false), + ("a filled shape", shape.clone(), false), + ("a region with its own fill", shape.clone(), true), + ("a stroke beside a filled shape", format!("{shape} {back}"), false), + ]; + for (what, d, own_fill) in cases { + let mut s = Session::new(); + let id = id_of(&ex(&mut s, "vector.create", json!({"path": "M0 0 L10 10"}))["id"]).unwrap(); + // At the page origin, as given (`vector.create` would move the points). + let mut network = VectorNetwork::from_path(&BezPath::from_svg(&d).unwrap()); + if own_fill { + network.regions[0].fills = Some(vec![figcraft_color::Paint::solid(figcraft_color::Color::from_hex("#FF0000").unwrap())]); + } + { + let n = s.doc_mut().unwrap().get_mut(id).unwrap(); + n.transform = figcraft_geom::Affine::IDENTITY; + n.kind = NodeKind::Vector { network }; + } + let before = net(&s, id); + ex(&mut s, "vector.simplify", json!({"ids": [id], "tolerance": 0.75})); + let after = s.doc().unwrap().world_transform(id) * net(&s, id).stroke_path(); + let gone = strays(&after, &before.stroke_path()); + assert!(gone <= 1.5, "{what}: strays {gone}: {}", after.to_svg()); + let (b0, b1) = (before.stroke_path().bounding_box(), after.bounding_box()); + assert!(b0.inflate(1.5, 1.5).contains_rect(b1), "{what}: {b1:?} past {b0:?}: {}", after.to_svg()); + assert_eq!(net(&s, id).regions.len(), before.regions.len(), "{what}: the fill is kept"); } - assert_eq!(net(&s, id).stroke_path().elements(), before.elements(), "the samples as they were"); - ex(&mut s, "vector.simplify", json!({"ids": [id], "tolerance": 0.75})); - let after = s.doc().unwrap().world_transform(id) * net(&s, id).stroke_path(); - let (b0, b1) = (before.bounding_box(), after.bounding_box()); - assert!(b0.inflate(1.5, 1.5).contains_rect(b1), "{b1:?} past {b0:?}: {}", after.to_svg()); } fn ex(s: &mut Session, cmd: &str, p: Value) -> Value { diff --git a/crates/geom/src/tests.rs b/crates/geom/src/tests.rs index 10e09318c..786bf1935 100644 --- a/crates/geom/src/tests.rs +++ b/crates/geom/src/tests.rs @@ -393,7 +393,6 @@ fn deviation(out: &BezPath, input: &BezPath) -> f64 { /// about 390 and 160 units off; at whole-pixel coordinates the same shapes happened to fit well. #[test] fn simplifying_keeps_to_strokes_kurbo_shot_past() { - use kurbo::ParamCurve; let cases: [(&str, &[(f64, f64)]); 5] = [ ( "out and back to the same point", @@ -422,23 +421,127 @@ fn simplifying_keeps_to_strokes_kurbo_shot_past() { ), ]; for (what, pts) in cases { - let input = polyline(pts); - let out = simplify_path(&input, 0.75); - let d = deviation(&out, &input); - assert!(d <= 1.5, "{what}: strays {d} from the samples: {}", out.to_svg()); + keeps_to_one_stroke(what, &polyline(pts)); + } +} + +/// Accuracies the simplification is checked at: fine, the Pencil's, and coarse. +const ACCURACIES: [f64; 3] = [0.1, 0.75, 8.0]; + +/// Check that `input` (one open subpath), simplified at each of [`ACCURACIES`], strays no more +/// than twice the accuracy from it and leaves no part of it further off than that, stays in its +/// box grown by as much, and is still one subpath from its start to its end. +fn keeps_to_one_stroke(what: &str, input: &BezPath) { + for accuracy in ACCURACIES { + let out = simplify_path(input, accuracy); + let (svg, limit) = (out.to_svg(), 2.0 * accuracy); + let d = deviation(&out, input); + assert!(d <= limit, "{what} at {accuracy}: strays {d} from the input: {svg}"); + let left = deviation(input, &out); + assert!(left <= limit, "{what} at {accuracy}: leaves the input {left} off: {svg}"); let (inb, outb) = (input.bounding_box(), out.bounding_box()); - assert!(inb.inflate(1.5, 1.5).contains_rect(outb), "{what}: {outb:?} past {inb:?}"); - // One subpath, starting and ending where the stroke does. + assert!(inb.inflate(limit, limit).contains_rect(outb), "{what} at {accuracy}: {outb:?} past {inb:?}"); let moves = out.elements().iter().filter(|e| matches!(e, kurbo::PathEl::MoveTo(_))).count(); - assert_eq!(moves, 1, "{what}: {}", out.to_svg()); - let (first, last) = (pts[0], pts[pts.len() - 1]); - assert_eq!(out.segments().next().map(|s| s.start()), Some(Point::new(first.0, first.1)), "{what}"); - assert_eq!(out.segments().last().map(|s| s.end()), Some(Point::new(last.0, last.1)), "{what}"); + assert_eq!(moves, 1, "{what} at {accuracy}: {svg}"); + // From its start to its end: kurbo evaluates a fitted end on the input, so it is off by + // rounding at most. + let ends = |p: &BezPath| p.segments().next().map(|s| s.start()).zip(p.segments().last().map(|s| s.end())); + let ((start, end), (start_in, end_in)) = (ends(&out).unwrap(), ends(input).unwrap()); + assert!((start - start_in).hypot() < 1e-9 && (end - end_in).hypot() < 1e-9, "{what} at {accuracy}: {svg}"); + } +} + +/// Strokes made of curves keep to them as polylines do (#1741): a quadratic or a cubic that goes +/// out and comes straight back, one whose control points sit on its ends (so its direction is +/// read from the control point after them), and nearly collinear curves. +#[test] +fn simplifying_keeps_to_curves_that_turn_back_or_run_straight() { + let (p, q, r) = ( + (209.598_690_794_015_5, -204.909_328_119_739_88), + (211.277_914_263_870_97, -207.190_974_020_753_4), + (214.246_506_828_720_84, -211.228_827_590_623_24), + ); + // The nearly collinear samples, each line as a cubic with its handles a third of the way along. + let third = |a: (f64, f64), b: (f64, f64), t: f64| (a.0 + (b.0 - a.0) * t, a.1 + (b.1 - a.1) * t); + let mut straight_cubics = BezPath::new(); + straight_cubics.move_to(p); + for (a, b) in [(p, q), (q, r)] { + straight_cubics.curve_to(third(a, b, 1.0 / 3.0), third(a, b, 2.0 / 3.0), b); + } + let mut straight_quads = BezPath::new(); + straight_quads.move_to(p); + straight_quads.quad_to(third(p, q, 0.5), q); + straight_quads.quad_to(third(q, r, 0.5), r); + let cases = [ + ("a quadratic out and back", BezPath::from_svg("M0 0 Q15 10 30 0 Q15 10 0 0 Q-15 10 -30 0").unwrap()), + ("a cubic out and back", BezPath::from_svg("M0 0 C10 8 20 8 30 0 C20 8 10 8 0 0 C-10 8 -20 8 -30 0").unwrap()), + ("handles on the ends", BezPath::from_svg("M0 0 C0 0 30 4 30 4 C30 4 0 0 0 0 L-30 -4").unwrap()), + ("a cubic dip down and back up", BezPath::from_svg("M0 0 L10 0 C15 0 20 5 20 12 C20 5 25 0 30 0 L40 0").unwrap()), + ("nearly collinear cubics", straight_cubics), + ("nearly collinear quadratics", straight_quads), + ]; + for (what, input) in cases { + keeps_to_one_stroke(what, &input); + } +} + +/// `sides` simplified by kurbo one at a time and joined into one subpath. +fn fitted_apart(sides: &[&BezPath], accuracy: f64) -> BezPath { + let mut out = BezPath::new(); + for side in sides { + let fit = kurbo::simplify::simplify_bezpath(side.iter(), accuracy, &Default::default()); + let skip = usize::from(!out.elements().is_empty()); + out.extend(fit.elements().iter().copied().skip(skip)); + } + out +} + +/// `curve` cut into `n` cubics, drawn on from where `path` is: forwards, or back from its end. +fn in_pieces(path: &mut BezPath, curve: kurbo::CubicBez, n: u32, back: bool) { + use kurbo::ParamCurve; + for i in 0..n { + let i = if back { n - 1 - i } else { i }; + let c = curve.subsegment(f64::from(i) / f64::from(n)..f64::from(i + 1) / f64::from(n)); + if back { path.curve_to(c.p2, c.p1, c.p0) } else { path.curve_to(c.p1, c.p2, c.p3) } + } +} + +/// Where a path turns straight back it is cut, so the result is kurbo's fit of each side on its +/// own, with a point of the path at the turn. Fitted as one, kurbo rounds the turn off: its curve +/// passes the stray check, but falls short of the turn or takes more segments. A cubic whose +/// control points sit on its ends turns back as a line does. +#[test] +fn simplifying_fits_each_side_of_a_turn_back_on_its_own() { + use kurbo::ParamCurve; + let svg = |d: &str| BezPath::from_svg(d).unwrap(); + let s = kurbo::CubicBez::new((0.0, 0.0), (40.0, -60.0), (80.0, 60.0), (120.0, 0.0)); + let (mut s_out, mut s_back) = (BezPath::new(), BezPath::new()); + s_out.move_to(s.p0); + in_pieces(&mut s_out, s, 8, false); + s_back.move_to(s.p3); + in_pieces(&mut s_back, s, 8, true); + let cases = [ + ("lines", svg("M0 0 L10 0 L20 0 L30 0"), svg("M30 0 L20 0 L10 0")), + ("handles on the ends", svg("M0 0 L10 0 L20 0 C20 0 30 0 30 0"), svg("M30 0 C30 0 20 0 20 0 L10 0")), + ("a curve in pieces", s_out, s_back), + ]; + for (what, out_side, back_side) in cases { + let turn = out_side.segments().last().map(|seg| seg.end()).unwrap(); + let mut input = out_side.clone(); + input.extend(back_side.elements().iter().copied().skip(1)); + for accuracy in ACCURACIES { + let ours = simplify_path(&input, accuracy); + let apart = fitted_apart(&[&out_side, &back_side], accuracy); + assert_eq!(ours.elements(), apart.elements(), "{what} at {accuracy}"); + assert!(ours.segments().any(|seg| (seg.end() - turn).hypot() < 1e-9), "{what} at {accuracy}: {}", ours.to_svg()); + } } } /// Where a path never turns back and kurbo's fit holds, the result is kurbo's own, element for /// element: smooth runs, corners sharper than a right angle, closed subpaths and several subpaths. +/// A fit counts as holding up to twice the accuracy asked for, whatever that is: the large wave's +/// is further off at the coarse accuracy than the Pencil's limit of 1.5. #[test] fn simplifying_is_kurbos_where_its_fit_holds() { let wave: Vec<(f64, f64)> = (0..=60).map(|i| (f64::from(i) * 4.0, (f64::from(i) / 6.0).sin() * 30.0)).collect(); @@ -452,12 +555,30 @@ fn simplifying_is_kurbos_where_its_fit_holds() { e => e, })); let curves = BezPath::from_svg("M0 0 C10 -20 30 -20 40 0 C50 20 70 20 80 0 Q100 -30 120 0 L140 10 Z M200 0 L240 0").unwrap(); - for (what, input) in - [("a wave", polyline(&wave)), ("a zigzag", polyline(&zigzag)), ("closed", closed), ("two subpaths", several), ("curves", curves)] - { - let ours = simplify_path(&input, 0.75); - let theirs = kurbo::simplify::simplify_bezpath(input.iter(), 0.75, &Default::default()); - assert_eq!(ours.elements(), theirs.elements(), "{what}"); + // A sine 300 high in 40 smooth cubics. + let sine = |x: f64| ((x / 120.0).sin() * 300.0, (x / 120.0).cos() * 2.5); + let mut large = BezPath::new(); + large.move_to((0.0, 0.0)); + for i in 0..40 { + let (x0, x1) = (f64::from(i) * 40.0, f64::from(i + 1) * 40.0); + let ((y0, d0), (y1, d1)) = (sine(x0), sine(x1)); + large.curve_to((x0 + 40.0 / 3.0, y0 + d0 * 40.0 / 3.0), (x1 - 40.0 / 3.0, y1 - d1 * 40.0 / 3.0), (x1, y1)); + } + let coarse = simplify_path(&large, 8.0); + assert!(coarse.elements().len() < 10 && (1.5..=8.0).contains(&deviation(&coarse, &large)), "{}", deviation(&coarse, &large)); + for (what, input) in [ + ("a wave", polyline(&wave)), + ("a zigzag", polyline(&zigzag)), + ("closed", closed), + ("two subpaths", several), + ("curves", curves), + ("a large wave", large), + ] { + for accuracy in ACCURACIES { + let ours = simplify_path(&input, accuracy); + let theirs = kurbo::simplify::simplify_bezpath(input.iter(), accuracy, &Default::default()); + assert_eq!(ours.elements(), theirs.elements(), "{what} at {accuracy}"); + } } } @@ -482,4 +603,40 @@ fn simplifying_keeps_closes_and_subpaths_across_a_reversal() { empty.line_to((5.0, 5.0)); empty.close_path(); assert!(simplify_path(&empty, 0.75).elements().is_empty()); + for d in ["", "M5 5", "M5 5 M6 6", "M5 5 Z"] { + let input = if d.is_empty() { BezPath::new() } else { BezPath::from_svg(d).unwrap() }; + assert!(simplify_path(&input, 0.75).elements().is_empty(), "{d:?}"); + } +} + +/// The subpaths simplified keep their starts: a move with nothing drawn from it between two +/// subpaths leaves no trace, and a segment drawn on from a close starts a subpath where the closed +/// one started, as it does in the path given. +#[test] +fn simplifying_keeps_where_each_subpath_starts() { + let starts = + |p: &BezPath| -> Vec { p.elements().iter().filter_map(|e| if let kurbo::PathEl::MoveTo(p) = e { Some(*p) } else { None }).collect() }; + let between = BezPath::from_svg("M0 0 L10 0 L20 5 M50 50 M100 0 L110 0 L120 5").unwrap(); + let out = simplify_path(&between, 0.75); + assert_eq!(starts(&out), [Point::new(0.0, 0.0), Point::new(100.0, 0.0)], "{}", out.to_svg()); + assert!(deviation(&out, &between) <= 1.5, "{}", out.to_svg()); + // After the close, the pen is back at (0, 0): the next segments start there, also across a + // reversal. + use kurbo::PathEl::{ClosePath, LineTo, MoveTo}; + let on = BezPath::from_vec(vec![ + MoveTo(Point::new(0.0, 0.0)), + LineTo(Point::new(10.0, 0.0)), + LineTo(Point::new(10.0, 10.0)), + ClosePath, + LineTo(Point::new(20.0, 20.0)), + LineTo(Point::new(30.0, 20.0)), + LineTo(Point::new(20.0, 20.0)), + ]); + let out = simplify_path(&on, 0.75); + let els = out.elements(); + let close = els.iter().position(|e| matches!(e, kurbo::PathEl::ClosePath)).unwrap(); + assert_eq!(els.get(close + 1), Some(&kurbo::PathEl::MoveTo(Point::new(0.0, 0.0))), "{}", out.to_svg()); + assert_eq!(starts(&out), [Point::new(0.0, 0.0), Point::new(0.0, 0.0)], "{}", out.to_svg()); + assert_eq!(out.segments().last().map(|s| kurbo::ParamCurve::end(&s)), Some(Point::new(20.0, 20.0))); + assert!(deviation(&out, &on) <= 1.5, "{}", out.to_svg()); } From a66946d13e6d22eb8fcfcc9ea0100f2f59db349a Mon Sep 17 00:00:00 2001 From: impulsado <72570835+impulsado@users.noreply.github.com> Date: Tue, 10 Nov 2026 09:34:17 +0100 Subject: [PATCH 055/101] M3: strengthen inherited slot property regression coverage Cover inherited Boolean bindings and independent same-component slot content. Strengthen text, HTML and stored-property assertions, split default and own-content cases, and document ownership-based binding resolution. --- crates/engine/src/assets/components/sync.rs | 6 +- crates/engine/src/slot_tests.rs | 196 +++++++++++++++++--- 2 files changed, 172 insertions(+), 30 deletions(-) diff --git a/crates/engine/src/assets/components/sync.rs b/crates/engine/src/assets/components/sync.rs index 17836b111..513f4f7c8 100644 --- a/crates/engine/src/assets/components/sync.rs +++ b/crates/engine/src/assets/components/sync.rs @@ -165,8 +165,8 @@ fn copy_layers( // No longer a slot in the main: it mirrors the main again. n.overrides.remove(SLOT); } - // Component properties: the main layer's bindings use this instance's values; layers of - // nested instances use the nested instance's values (one level per source hop). + // Bindings use the enclosing instance of their defining component, even when slot + // content has fewer source hops than enclosing instances. let enc = enclosing.get(&parent).cloned().unwrap_or_default(); apply_enclosing_props(doc, &mut n, orig, &enc, &inst_props); if let NodeKind::Instance { component: c, props } = &n.kind { @@ -254,6 +254,8 @@ fn rebuild_nested(doc: &mut Document, nested: Vec, old: &BTreeMap (NodeId, NodeId, NodeId, } fn assert_slot_text(s: &mut Session, instance: NodeId, expected: &str) { - let label = kids(s, instance)[0]; - let characters = node(s, label).kind.text().unwrap().characters.clone(); + let children = kids(s, instance); + assert_eq!(children.len(), 1, "Content {instance} must have exactly one Label"); + let label = children[0]; + assert_eq!(node(s, label).name, "Label"); + let characters = node(s, label).kind.text().expect("Content's only child must be text").characters.clone(); let html = ex(s, "inspect.code", json!({"id": instance, "language": "html"}))["code"].as_str().unwrap().to_string(); assert_eq!(characters, expected, "slot Label characters; HTML: {html}"); + assert_eq!(html.matches("

").count(), 1, "slot Label HTML must contain exactly one paragraph: {html}"); assert!(html.contains(&format!(">{expected}

")), "slot Label HTML: {html}"); } fn assert_local_slot_text(s: &mut Session, instance: NodeId, expected: &str) { - assert!(matches!(&node(s, instance).kind, NodeKind::Instance { props, .. } if props.get("Text") == Some(&json!(expected)))); + assert!( + matches!(&node(s, instance).kind, NodeKind::Instance { props, .. } if props.get("Text") == Some(&json!(expected))), + "instance {instance} must store its own Text value {expected:?}: {:?}", + node(s, instance).kind + ); let properties = props_of(s, instance); - assert_eq!(properties.iter().find(|p| p["name"] == "Text").unwrap()["value"], expected); + let text = properties.iter().find(|p| p["name"] == "Text").unwrap_or_else(|| panic!("instance {instance} has no Text property: {properties:?}")); + assert_eq!(text["value"], expected, "instance {instance} Text property"); +} + +/// Exercise the same ownership contract for default slot content and content supplied by the +/// Composition main; separate tests identify which route regresses. +fn check_slot_text_properties_stay_local(own: bool) { + let mut s = Session::new(); + let (content, label, _base, composition, main_content) = slot_text_composition(&mut s, own); + let a = idv(&ex(&mut s, "instance.create", json!({"component": composition, "x": 400}))); + let b = idv(&ex(&mut s, "instance.create", json!({"component": composition, "x": 800}))); + let ac = copy_of(&s, a, main_content); + let bc = copy_of(&s, b, main_content); + ex(&mut s, "instance.setProperties", json!({"ids": [ac], "properties": {"Text": "Custom"}})); + assert_local_slot_text(&mut s, ac, "Custom"); + assert_slot_text(&mut s, ac, "Custom"); + assert_local_slot_text(&mut s, bc, "Default"); + assert_slot_text(&mut s, bc, "Default"); + assert_local_slot_text(&mut s, main_content, "Default"); + assert_slot_text(&mut s, main_content, "Default"); + assert_eq!(node(&s, label).kind.text().unwrap().characters, "Default"); + // Main property edits propagate without replacing another instance's local value. + ex(&mut s, "instance.setProperties", json!({"ids": [main_content], "properties": {"Text": "Main value"}})); + assert_slot_text(&mut s, ac, "Custom"); + assert_slot_text(&mut s, bc, "Main value"); + assert_slot_text(&mut s, main_content, "Main value"); + ex(&mut s, "component.editProperty", json!({"id": content, "name": "Text", "default": "New default"})); + assert_slot_text(&mut s, ac, "Custom"); + assert_slot_text(&mut s, bc, "Main value"); + assert_local_slot_text(&mut s, main_content, "Main value"); + assert_slot_text(&mut s, main_content, "Main value"); + healthy(&s); } #[test] -fn slot_text_properties_stay_local_in_default_and_own_content() { - for own in [false, true] { - let mut s = Session::new(); - let (content, label, _base, composition, main_content) = slot_text_composition(&mut s, own); - let a = idv(&ex(&mut s, "instance.create", json!({"component": composition, "x": 400}))); - let b = idv(&ex(&mut s, "instance.create", json!({"component": composition, "x": 800}))); - let ac = copy_of(&s, a, main_content); - let bc = copy_of(&s, b, main_content); - ex(&mut s, "instance.setProperties", json!({"ids": [ac], "properties": {"Text": "Custom"}})); - assert_local_slot_text(&mut s, ac, "Custom"); - assert_slot_text(&mut s, ac, "Custom"); - assert_slot_text(&mut s, bc, "Default"); - assert_slot_text(&mut s, main_content, "Default"); - assert_eq!(node(&s, label).kind.text().unwrap().characters, "Default"); - // Main property edits propagate without replacing another instance's local value. - ex(&mut s, "instance.setProperties", json!({"ids": [main_content], "properties": {"Text": "Main value"}})); - assert_slot_text(&mut s, ac, "Custom"); - assert_slot_text(&mut s, bc, "Main value"); - assert_slot_text(&mut s, main_content, "Main value"); - ex(&mut s, "component.editProperty", json!({"id": content, "name": "Text", "default": "New default"})); - assert_slot_text(&mut s, ac, "Custom"); - assert_slot_text(&mut s, bc, "Main value"); - healthy(&s); - } +fn slot_text_properties_stay_local_in_default_content() { + check_slot_text_properties_stay_local(false); +} + +#[test] +fn slot_text_properties_stay_local_in_own_content() { + check_slot_text_properties_stay_local(true); } #[test] @@ -451,11 +474,15 @@ fn slot_text_properties_do_not_read_an_unbound_base_property() { let (_content, _label, base, composition, main_content) = slot_text_composition(&mut s, true); ex(&mut s, "component.addProperty", json!({"id": base, "name": "Text", "type": "text", "default": "Wrong owner"})); let i = idv(&ex(&mut s, "instance.create", json!({"component": composition, "x": 400}))); + let nested_base = kids(&s, i)[0]; + assert_local_slot_text(&mut s, nested_base, "Wrong owner"); let nested = copy_of(&s, i, main_content); + assert_local_slot_text(&mut s, nested, "Default"); assert_slot_text(&mut s, nested, "Default"); ex(&mut s, "instance.setProperties", json!({"ids": [nested], "properties": {"Text": "Custom"}})); assert_local_slot_text(&mut s, nested, "Custom"); assert_slot_text(&mut s, nested, "Custom"); + assert_local_slot_text(&mut s, nested_base, "Wrong owner"); assert_slot_text(&mut s, main_content, "Default"); healthy(&s); } @@ -472,6 +499,9 @@ fn slot_text_properties_survive_inherited_own_content_and_persistence() { let bc = copy_of(&s, b, inherited_content); ex(&mut s, "instance.setProperties", json!({"ids": [ac], "properties": {"Text": "Custom"}})); assert_local_slot_text(&mut s, ac, "Custom"); + assert_local_slot_text(&mut s, bc, "Default"); + assert_local_slot_text(&mut s, inherited_content, "Default"); + assert_local_slot_text(&mut s, main_content, "Default"); let bytes = figcraft_format::save_bytes(s.doc().unwrap(), None).unwrap(); let (back, _) = figcraft_format::load_bytes(&bytes).unwrap(); let mut s = Session::with_document(back); @@ -495,6 +525,116 @@ fn slot_text_properties_survive_inherited_own_content_and_persistence() { healthy(&s); } +/// Check both the stored property and the Label it drives, not just one representation. +fn assert_slot_visibility(s: &mut Session, instance: NodeId, expected: bool) { + assert!( + matches!(&node(s, instance).kind, NodeKind::Instance { props, .. } if props.get("Visible") == Some(&json!(expected))), + "instance {instance} must store Visible={expected}: {:?}", + node(s, instance).kind + ); + let properties = props_of(s, instance); + let visible = + properties.iter().find(|p| p["name"] == "Visible").unwrap_or_else(|| panic!("instance {instance} has no Visible property: {properties:?}")); + assert_eq!(visible["value"], expected, "instance {instance} Visible property"); + let children = kids(s, instance); + assert_eq!(children.len(), 1, "Content {instance} must have exactly one Label"); + assert_eq!(node(s, children[0]).name, "Label"); + assert_eq!(node(s, children[0]).visible, expected, "instance {instance} Label visibility"); +} + +#[test] +fn slot_boolean_properties_stay_local_in_inherited_own_content() { + let mut s = Session::new(); + let (content, label, base, composition, main_content) = slot_text_composition(&mut s, true); + ex(&mut s, "component.addProperty", json!({"id": content, "name": "Visible", "type": "boolean", "default": true, "layer": label})); + ex(&mut s, "component.addProperty", json!({"id": base, "name": "Visible", "type": "boolean", "default": false})); + let (outer, inherited) = slot_text_wrapper(&mut s, composition, "Outer composition"); + let inherited_base = kids(&s, inherited)[0]; + let inherited_content = copy_of(&s, inherited, main_content); + let a = idv(&ex(&mut s, "instance.create", json!({"component": outer, "x": 400}))); + let b = idv(&ex(&mut s, "instance.create", json!({"component": outer, "x": 800}))); + let ac = copy_of(&s, a, inherited_content); + let bc = copy_of(&s, b, inherited_content); + let abase = copy_of(&s, a, inherited_base); + assert!(matches!(&node(&s, abase).kind, NodeKind::Instance { props, .. } if props.get("Visible") == Some(&json!(false)))); + assert_slot_visibility(&mut s, ac, true); + assert_slot_visibility(&mut s, bc, true); + ex(&mut s, "instance.setProperties", json!({"ids": [ac], "properties": {"Visible": false}})); + assert_slot_visibility(&mut s, ac, false); + assert_slot_visibility(&mut s, bc, true); + assert_slot_visibility(&mut s, inherited_content, true); + assert_slot_visibility(&mut s, main_content, true); + // A main update must not replace either instance's local value with the Base's homonym. + ex(&mut s, "instance.setProperties", json!({"ids": [main_content], "properties": {"Visible": false}})); + assert_slot_visibility(&mut s, ac, false); + assert_slot_visibility(&mut s, bc, false); + ex(&mut s, "instance.setProperties", json!({"ids": [bc], "properties": {"Visible": true}})); + ex(&mut s, "node.set", json!({"id": content, "props": {"fill": "#abcdef"}})); + assert_slot_visibility(&mut s, ac, false); + assert_slot_visibility(&mut s, bc, true); + assert_slot_visibility(&mut s, main_content, false); + healthy(&s); + let bytes = figcraft_format::save_bytes(s.doc().unwrap(), None).unwrap(); + let (back, _) = figcraft_format::load_bytes(&bytes).unwrap(); + let mut s = Session::with_document(back); + assert_slot_visibility(&mut s, ac, false); + assert_slot_visibility(&mut s, bc, true); + assert_slot_visibility(&mut s, inherited_content, false); + assert_slot_visibility(&mut s, main_content, false); + ex(&mut s, "instance.setProperties", json!({"ids": [main_content], "properties": {"Visible": true}})); + assert_slot_visibility(&mut s, ac, false); + assert_slot_visibility(&mut s, bc, true); + assert_slot_visibility(&mut s, main_content, true); + healthy(&s); +} + +#[test] +fn same_component_in_own_slot_keeps_independent_text_properties() { + let mut s = Session::new(); + let frame = idv(&ex(&mut s, "frame.create", json!({"width": 200, "height": 100, "name": "Card"}))); + let label = idv(&ex(&mut s, "text.create", json!({"text": "Default", "parent": frame, "props": {"name": "Label"}}))); + let body = idv(&ex(&mut s, "frame.create", json!({"width": 180, "height": 60, "y": 40, "name": "Body", "parent": frame}))); + let card = idv(&ex(&mut s, "component.create", json!({"ids": [frame]}))); + ex(&mut s, "component.addProperty", json!({"id": card, "name": "Text", "type": "text", "default": "Default", "layer": label})); + ex(&mut s, "component.makeSlot", json!({"id": body})); + // Only page instance content holds another Card: the main never contains itself. + let outer = idv(&ex(&mut s, "instance.create", json!({"component": card, "x": 400}))); + let inner = idv(&ex(&mut s, "instance.slotInsert", json!({"id": outer, "slot": "Body", "component": card}))); + let check = |s: &mut Session, outer_text: &str, inner_text: &str| { + assert_local_slot_text(s, outer, outer_text); + assert_local_slot_text(s, inner, inner_text); + assert_eq!(node(s, copy_of(s, outer, label)).kind.text().unwrap().characters, outer_text); + assert_eq!(node(s, copy_of(s, inner, label)).kind.text().unwrap().characters, inner_text); + let outer_body = copy_of(s, outer, body); + assert!(slot_edited(s.doc().unwrap(), outer_body)); + assert_eq!(kids(s, outer_body), vec![inner]); + assert!(kids(s, copy_of(s, inner, body)).is_empty()); + assert!(kids(s, body).is_empty(), "the main's slot must remain empty"); + healthy(s); + }; + ex(&mut s, "instance.setProperties", json!({"ids": [outer], "properties": {"Text": "Outer"}})); + check(&mut s, "Outer", "Default"); + ex(&mut s, "instance.setProperties", json!({"ids": [inner], "properties": {"Text": "Inner"}})); + check(&mut s, "Outer", "Inner"); + ex(&mut s, "text.set", json!({"id": label, "characters": "New default"})); + ex(&mut s, "node.set", json!({"id": card, "props": {"fill": "#abcdef"}})); + check(&mut s, "Outer", "Inner"); + assert_eq!(fill(&s, outer), "ABCDEF"); + assert_eq!(fill(&s, inner), "ABCDEF"); + ex(&mut s, "instance.setProperties", json!({"ids": [outer], "properties": {"Text": "Outer updated"}})); + check(&mut s, "Outer updated", "Inner"); + ex(&mut s, "instance.setProperties", json!({"ids": [inner], "properties": {"Text": "Inner updated"}})); + check(&mut s, "Outer updated", "Inner updated"); + let bytes = figcraft_format::save_bytes(s.doc().unwrap(), None).unwrap(); + let (back, _) = figcraft_format::load_bytes(&bytes).unwrap(); + let mut s = Session::with_document(back); + check(&mut s, "Outer updated", "Inner updated"); + ex(&mut s, "node.set", json!({"id": card, "props": {"fill": "#123456"}})); + check(&mut s, "Outer updated", "Inner updated"); + assert_eq!(fill(&s, outer), "123456"); + assert_eq!(fill(&s, inner), "123456"); +} + /// Random slot edits, main edits and resets keep every instance mirroring its main. #[test] fn random_slot_edits_keep_instances_consistent() { From 73e3720083caef9f1e59827845311ef3ebcd7f6f Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Tue, 10 Nov 2026 11:22:16 +0100 Subject: [PATCH 056/101] sonar: SHA-1 image names in .fig export are the format's, not a choice --- sonar-project.properties | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sonar-project.properties b/sonar-project.properties index 92562d54c..5f58f42ae 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,2 +1,8 @@ sonar.projectKey=storytold_figcraft sonar.organization=storytold + +# S4790 (weak hash): a .fig file names each image by the SHA-1 of its bytes (20 bytes, the only +# length readers accept). It is an identifier the format fixes, not a security choice. +sonar.issue.ignore.multicriteria=fig_image_sha1 +sonar.issue.ignore.multicriteria.fig_image_sha1.ruleKey=rust:S4790 +sonar.issue.ignore.multicriteria.fig_image_sha1.resourceKey=crates/format/src/fig/export.rs From 2af535c132e7a40208c0c0ac440f459012e449e5 Mon Sep 17 00:00:00 2001 From: amorSoftLabs Date: Tue, 10 Nov 2026 22:28:20 +0530 Subject: [PATCH 057/101] fix(ui): access preferences from home screen via shortcut and sidebar (#956) (#962) * fix(ui): access preferences from home screen via shortcut and sidebar (#956) * fix(ui): handle preferences shortcut before popup guard * docs: add docstrings for modified functions to satisfy coverage check --------- Co-authored-by: bflatastic --- crates/ui-egui/src/app.rs | 4 ++++ crates/ui-egui/src/home.rs | 24 ++++++++++++++++++++++-- crates/ui-egui/src/home_tests.rs | 31 +++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/app.rs b/crates/ui-egui/src/app.rs index f0513520b..0267dd769 100644 --- a/crates/ui-egui/src/app.rs +++ b/crates/ui-egui/src/app.rs @@ -272,6 +272,10 @@ impl FigApp { // The shortcuts panel belongs to the canvas; it doesn't hang over the home screen // (cleared after the home widgets, which may have just asked for it). self.ui.shortcuts_panel = false; + // The keymap runs with the canvas; here the one shortcut that still applies is read directly. + if ctx.input_mut(|i| i.consume_key(egui::Modifiers::COMMAND, egui::Key::Comma)) { + self.run("app.preferences", serde_json::json!({})); + } dialogs::keys(self, &ctx); dialogs::show(self, &ctx); updates_ui::show(self, &ctx); diff --git a/crates/ui-egui/src/home.rs b/crates/ui-egui/src/home.rs index 9587c6623..d5babe72a 100644 --- a/crates/ui-egui/src/home.rs +++ b/crates/ui-egui/src/home.rs @@ -190,8 +190,8 @@ fn dropped(app: &mut FigApp, ctx: &egui::Context) { } } -/// Draw the Home sidebar: app icon and wordmark, file/template search (Escape clears it) -/// and section tabs; choosing a section clears the file query. +/// Draw the Home sidebar: app icon and wordmark, file/template search (Escape clears it), section +/// tabs (choosing one clears the file query) and Preferences at the bottom. fn sidebar(app: &mut FigApp, ui: &mut Ui, t: &Tokens, left: Rect) { let mut y = left.min.y + 20.0; crate::theme::paint_app_icon(ui, Rect::from_min_size(pos2(left.min.x + 12.0, y - 4.0), vec2(32.0, 32.0))); @@ -229,6 +229,26 @@ fn sidebar(app: &mut FigApp, ui: &mut Ui, t: &Tokens, left: Rect) { } y += 34.0; } + let pref_y = (left.max.y - 44.0).max(y + 12.0); + if pref_y > y + 12.0 { + ui.painter().line_segment([pos2(left.min.x + 12.0, pref_y - 6.0), pos2(left.max.x - 12.0, pref_y - 6.0)], Stroke::new(1.0, t.border)); + } + let r = Rect::from_min_size(pos2(left.min.x + 8.0, pref_y), vec2(SIDEBAR - 16.0, 32.0)); + let mut resp = ui.interact(r, ui.scope_id().with("home_preferences"), Sense::click()); + let current = app.ui.preferences; + a11y::button(&resp, tr("Preferences")); + if current || resp.hovered() { + ui.painter().rect_filled(r, CornerRadius::same(5), if current { t.selected_row } else { t.hover }); + } + focus_ring(ui, t, r, &resp, 5); + icons::paint(ui.painter(), Rect::from_min_size(pos2(r.min.x + 10.0, r.center().y - 8.0), vec2(16.0, 16.0)), Icon::Adjust, t.icon); + ui.painter().text(pos2(r.min.x + 36.0, r.center().y), Align2::LEFT_CENTER, tr("Preferences"), regular(12.0), t.text); + let key_label = figcraft_engine::keymap::display("Cmd+,", crate::shortcuts::platform()); + ui.painter().text(pos2(r.max.x - 8.0, r.center().y), Align2::RIGHT_CENTER, &key_label, regular(11.0), t.text_secondary); + resp = resp.on_hover_text(format!("{} ({})", tr("Preferences"), key_label)); + if resp.clicked() { + app.ui.preferences = !app.ui.preferences; + } } fn file_matches(name: &str, location: &str, query: &str) -> bool { diff --git a/crates/ui-egui/src/home_tests.rs b/crates/ui-egui/src/home_tests.rs index dcbbb3b6f..dfe3a0a7e 100644 --- a/crates/ui-egui/src/home_tests.rs +++ b/crates/ui-egui/src/home_tests.rs @@ -917,3 +917,34 @@ fn a_jam_file_is_a_document_open_and_drops_take() { assert!(crate::open::opens(path) && crate::open::is_document(path), "{name}"); } } + +/// The Preferences dialog can be opened and toggled from the home screen via +/// the `Cmd/Ctrl + ,` shortcut as well as by clicking Preferences in the sidebar. +#[test] +fn home_screen_preferences_shortcut_and_sidebar_access() { + let mut u = first_run(); + u.app.ui.home = true; + u.frame(vec![]); + assert!(!u.app.ui.preferences); + + // Ctrl/Cmd + Comma opens Preferences on the Home screen. + u.frame(vec![ + Event::Key { key: Key::Comma, physical_key: None, pressed: true, repeat: false, modifiers: Modifiers::COMMAND }, + Event::Key { key: Key::Comma, physical_key: None, pressed: false, repeat: false, modifiers: Modifiers::COMMAND }, + ]); + assert!(u.app.ui.preferences, "Ctrl/Cmd+, should open Preferences from the Home screen"); + + // Escape closes Preferences. + press(&mut u, Key::Escape); + assert!(!u.app.ui.preferences, "Escape should close Preferences"); + + // Clicking Preferences in the sidebar opens Preferences. + let s = shapes(&mut u); + click(&mut u, text_center(&s, "Preferences")); + assert!(u.app.ui.preferences, "Clicking Preferences in sidebar should open Preferences"); + + // Clicking it again toggles it closed. + let s = shapes(&mut u); + click(&mut u, text_center(&s, "Preferences")); + assert!(!u.app.ui.preferences, "Clicking Preferences in sidebar again should close it"); +} From 97ceeca35e1cfdb4f4183485e435a503c4d500a7 Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Tue, 10 Nov 2026 20:55:23 -0500 Subject: [PATCH 058/101] M10: Windows: the window no longer draws below a hidden caption (#1343) FigCraft draws its own title bar on Windows and opens undecorated windows, but winit 0.30 still gives them WS_CAPTION | WS_BORDER. On some systems the desktop compositor reserves that caption, so the content is drawn about 30 px low (a black band above it) while clicks keep the client coordinates and land above what is drawn. Fixes #1343; the same report as #1422 and #2233. A per-frame step (apps/figcraft/src/window_frame.rs, run from raw_input_hook) clears WS_CAPTION and WS_BORDER from every winit window of the process (the main window and the other windows alike), keeps WS_THICKFRAME and the window buttons so edge resizing and snap work, and calls SetWindowPos(SWP_FRAMECHANGED) only when a style changed. It uses safe winsafe calls (no unsafe), Windows only; other platforms and the browser are unchanged. The maximize-to-work-area trim of DesignCraft's fix is left for a later change. Ports the fix of DesignCraft #2139 and PhotoCraft #2401. Tests: the style arithmetic (caption and border cleared, thick frame and buttons kept, a clean style unchanged) and the per-frame hook (runs every frame, a no-op when unset). Co-Authored-By: Claude Sonnet 5.5 Model-Effort: Opus 5.5 drove; Opus 5.5 briefed; Sonnet 5.5 wrote at medium --- Cargo.lock | 1 + apps/figcraft/Cargo.toml | 3 + apps/figcraft/src/main.rs | 10 ++ apps/figcraft/src/window_frame.rs | 177 ++++++++++++++++++++++++++++++ docs/hardware-parity.md | 3 +- 5 files changed, 193 insertions(+), 1 deletion(-) create mode 100644 apps/figcraft/src/window_frame.rs diff --git a/Cargo.lock b/Cargo.lock index 8ca91ac04..6bab85d73 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1810,6 +1810,7 @@ dependencies = [ "windows", "winit", "winresource", + "winsafe", "zbus", ] diff --git a/apps/figcraft/Cargo.toml b/apps/figcraft/Cargo.toml index f2ea73ba8..12fe93b5a 100644 --- a/apps/figcraft/Cargo.toml +++ b/apps/figcraft/Cargo.toml @@ -37,6 +37,9 @@ env_logger = { version = "0.11", default-features = false, features = ["auto-col [target.'cfg(windows)'.dependencies] craft-update = { workspace = true } windows = { version = "0.62", default-features = false, features = ["UI_ViewManagement", "System_UserProfile", "Foundation_Collections", "Gaming_Input"] } +# The custom title bar's window styles (src/window_frame.rs): safe Win32 wrappers (MIT); the `user` +# feature is User32.dll only. Same version as DesignCraft and PhotoCraft. +winsafe = { version = "0.0.29", default-features = false, features = ["user"] } # The system colour scheme (org.freedesktop.portal.Settings): winit reports no theme on Linux and # the BSDs, so the interface's "system" mode follows the portal's instead. zbus comes in through diff --git a/apps/figcraft/src/main.rs b/apps/figcraft/src/main.rs index 66b5f73ee..1d24e511b 100644 --- a/apps/figcraft/src/main.rs +++ b/apps/figcraft/src/main.rs @@ -29,6 +29,7 @@ mod graphics; mod recovery; mod services; mod startup; +mod window_frame; #[cfg(all(test, target_os = "macos"))] mod apple_events_tests; @@ -63,6 +64,8 @@ struct App { title: String, /// Shared with the services, which write the copies after a panic. recovery: recovery::Shared, + /// Keeps the custom title bar's undecorated windows borderless (Windows, #1343). + window_frame: window_frame::WindowFrame, /// Documents and quit requests from Finder, the Dock and Open With. #[cfg(target_os = "macos")] apple_events: fmv_macos_events::Inbox, @@ -111,6 +114,9 @@ impl eframe::App for App { } fn raw_input_hook(&mut self, _ctx: &egui::Context, raw_input: &mut egui::RawInput) { + // winit gives an undecorated window its caption back when it changes the window's flags + // (maximize, restore, ...): take it off again before the frame is laid out (#1343). + self.window_frame.run(); // Pointer and key events sent over the control channel (`ui.input`), for the window // about to draw. if let Some(events) = with_app(|fig| figcraft_ui_egui::windows::take_input(fig, raw_input.viewport_id)) { @@ -268,6 +274,7 @@ fn main() -> eframe::Result { // the old bespoke xdg-decoration probe that always drew FigCraft's custom title bar on KDE. fig.ui.title_bar = desktop_title_bar(); viewport = window_chrome(viewport, fig.ui.title_bar); + let custom_titlebar = fig.ui.title_bar == figcraft_ui_egui::TitleBar::Custom; if let Some(icon) = icon { viewport = viewport.with_icon(icon); } @@ -304,6 +311,9 @@ fn main() -> eframe::Result { ctx_slot, title: String::new(), recovery, + // The custom title bar's undecorated window must stay borderless, or its caption + // and border offset the content and the pointer on some Windows systems (#1343). + window_frame: window_frame::WindowFrame::new(custom_titlebar), #[cfg(target_os = "macos")] apple_events: apple_events.connect(&cc.egui_ctx), })) diff --git a/apps/figcraft/src/window_frame.rs b/apps/figcraft/src/window_frame.rs new file mode 100644 index 000000000..0033444ec --- /dev/null +++ b/apps/figcraft/src/window_frame.rs @@ -0,0 +1,177 @@ +//! Keeps the custom (undecorated) title bar windows truly borderless on Windows (#1343). +//! +//! winit 0.30 gives an undecorated window the `WS_CAPTION | WS_BORDER` styles and hides the +//! non-client area by spreading the client rect over it (`WM_NCCALCSIZE`). On some systems the +//! desktop compositor still reserves that frame for the window surface: the content is drawn about +//! 30 px low (a black band above it) while the pointer keeps the un-offset client coordinates, so +//! clicks land on something other than what is drawn under them. +//! +//! winit 0.27 omitted those styles for undecorated windows and had no offset. [`WindowFrame`] +//! restores that: it strips `WS_CAPTION` and `WS_BORDER` from every window of this process that +//! draws its own title bar, and has Windows recalculate the frame. winit puts the styles back +//! whenever it changes the window flags (maximize, restore, ...), so the step runs every frame; it +//! reads each style and writes only when it differs, so it costs next to nothing. +//! +//! The same fix is in DesignCraft (#2139) and PhotoCraft (#2401). The long-term fix is in winit +//! (storytold/winit#17); this module goes when the pinned winit has it. +//! +//! The Windows calls go through safe `winsafe` wrappers (the workspace forbids `unsafe`). Which +//! windows are ours is found by enumerating this process's top-level windows of winit's window +//! class, so the main window and every other window opened later are covered alike, and a file +//! dialog or message box of the same process is left alone. + +/// `WS_BORDER`. +#[cfg(any(windows, test))] +const WS_BORDER: u32 = 0x0080_0000; +/// `WS_CAPTION`, which already includes `WS_BORDER`. +#[cfg(any(windows, test))] +const WS_CAPTION: u32 = 0x00C0_0000; + +/// `style` without the OS title bar and frame (`WS_CAPTION`, `WS_BORDER`). The sizing border +/// (`WS_THICKFRAME`) and the window buttons stay, so edge resizing, Aero snap and the system menu +/// keep working, as they did with winit 0.27's undecorated windows. +#[cfg(any(windows, test))] +pub fn borderless_style(style: u32) -> u32 { + style & !(WS_CAPTION | WS_BORDER) +} + +/// The per-frame step that keeps the windows borderless; a no-op where the OS draws the frame +/// (macOS, Linux, the BSDs), where the app uses the system title bar, and in the browser. +pub struct WindowFrame { + step: Option>, +} + +impl WindowFrame { + /// The step for an app whose windows draw their own title bar when `custom_titlebar`. + pub fn new(custom_titlebar: bool) -> Self { + Self { step: platform::step(custom_titlebar) } + } + + /// Run the step; call it once per frame, before the frame is laid out. + pub fn run(&mut self) { + if let Some(step) = self.step.as_mut() { + step(); + } + } + + #[cfg(test)] + fn with_step(step: Box) -> Self { + Self { step: Some(step) } + } +} + +#[cfg(windows)] +mod platform { + use winsafe::{HWND, HwndPlace, POINT, SIZE, co}; + + /// winit's window class (`WindowAttributes`' default `class_name`). + const WINIT_CLASS: &str = "Window Class"; + + /// A step that strips the frame styles from this process's windows each call, or `None` when + /// the app uses the system title bar (the windows are decorated). + pub fn step(custom_titlebar: bool) -> Option> { + if !custom_titlebar { + return None; + } + let pid = std::process::id(); + Some(Box::new(move || { + // The windows are handed over as real `HWND`s; nothing is wrapped from a raw handle. + let _ = winsafe::EnumWindows(|hwnd| { + strip_if_ours(&hwnd, pid); + true + }); + })) + } + + /// Strip `hwnd` when it is one of this process's winit windows. + fn strip_if_ours(hwnd: &HWND, pid: u32) { + if hwnd.GetWindowThreadProcessId().1 != pid || !matches!(hwnd.GetClassName().as_deref(), Ok(WINIT_CLASS)) { + return; + } + strip(hwnd); + } + + /// Removes `WS_CAPTION`/`WS_BORDER` and has Windows recalculate the frame; a no-op once they + /// are gone. + fn strip(hwnd: &HWND) { + let style = hwnd.style(); + // The decision is the tested arithmetic; the write uses the same bits as winsafe's flags. + if super::borderless_style(style.raw()) == style.raw() { + return; + } + hwnd.set_style(style & !(co::WS::CAPTION | co::WS::BORDER)); + let _ = hwnd.SetWindowPos( + HwndPlace::None, + POINT::new(), + SIZE::new(), + co::SWP::FRAMECHANGED | co::SWP::NOMOVE | co::SWP::NOSIZE | co::SWP::NOZORDER | co::SWP::NOACTIVATE, + ); + } +} + +#[cfg(not(windows))] +mod platform { + pub fn step(_custom_titlebar: bool) -> Option> { + None + } +} + +#[cfg(test)] +mod window_frame_tests { + use std::sync::Arc; + use std::sync::atomic::{AtomicUsize, Ordering}; + + use super::{WS_BORDER, WS_CAPTION, WindowFrame, borderless_style}; + + #[cfg(windows)] + #[test] + fn the_style_bits_match_winsafes() { + use winsafe::co; + assert_eq!(co::WS::CAPTION.raw(), WS_CAPTION); + assert_eq!(co::WS::BORDER.raw(), WS_BORDER); + } + + const WS_SYSMENU: u32 = 0x0008_0000; + const WS_THICKFRAME: u32 = 0x0004_0000; + const WS_MINIMIZEBOX: u32 = 0x0002_0000; + const WS_MAXIMIZEBOX: u32 = 0x0001_0000; + const WS_VISIBLE: u32 = 0x1000_0000; + + #[test] + fn the_borderless_style_drops_the_caption_and_border_only() { + let decorated = WS_CAPTION | WS_BORDER | WS_SYSMENU | WS_THICKFRAME | WS_MAXIMIZEBOX | WS_MINIMIZEBOX | WS_VISIBLE; + let bare = borderless_style(decorated); + assert_eq!(bare & WS_CAPTION, 0, "caption gone"); + assert_eq!(bare & WS_BORDER, 0, "border gone"); + assert_eq!(bare & WS_THICKFRAME, WS_THICKFRAME, "edge resizing kept"); + assert_eq!(bare & (WS_MAXIMIZEBOX | WS_MINIMIZEBOX | WS_SYSMENU), WS_MAXIMIZEBOX | WS_MINIMIZEBOX | WS_SYSMENU, "window buttons kept"); + assert_eq!(bare & WS_VISIBLE, WS_VISIBLE, "unrelated bits kept"); + } + + #[test] + fn an_already_borderless_style_is_unchanged_so_no_frame_change_is_made() { + let bare = WS_THICKFRAME | WS_SYSMENU | WS_MAXIMIZEBOX | WS_MINIMIZEBOX | WS_VISIBLE; + assert_eq!(borderless_style(bare), bare); + assert_eq!(borderless_style(borderless_style(bare | WS_CAPTION)), bare); + } + + #[test] + fn the_step_runs_each_time_the_frame_runs_it() { + let calls = Arc::new(AtomicUsize::new(0)); + let n = calls.clone(); + let mut frame = WindowFrame::with_step(Box::new(move || { + n.fetch_add(1, Ordering::SeqCst); + })); + for _ in 0..3 { + frame.run(); + } + assert_eq!(calls.load(Ordering::SeqCst), 3); + } + + #[test] + fn no_step_is_fine() { + // Decorated windows and other platforms have no step; running must do nothing. + let mut frame = WindowFrame::new(false); + frame.run(); + } +} diff --git a/docs/hardware-parity.md b/docs/hardware-parity.md index 1d64bc411..846c8a199 100644 --- a/docs/hardware-parity.md +++ b/docs/hardware-parity.md @@ -1,6 +1,6 @@ # Hardware and platform parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-06 · **Change:** patch (under Wayland a minimised window answers control and MCP requests in about half a second instead of timing out after 60 s (#1906); images copied in other apps paste in the browser (#492); text reads only the fallback fonts it draws with; `doc.list` gives AI agents and plugins the open files' names, not their paths (#1117); a batch keeps one undo snapshot, not one per step (#1099); one depth cap bounds a whole render, pattern sources included, and render threads get 8 MiB stacks (#1082); in the browser an internal error that stops the page keeps its unsaved files, which open again on reload (#1123); 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); large images on the canvas draw from a smaller copy, so two 16k images no longer lag (#1483); macOS: the Quit menu and ⌘Q ask about unsaved changes (#857); egui/eframe 0.37 dependency migration; hidden-window screenshot deadlines; zoom previews; hidden windows answer control requests; macOS file opening, the Windows start-up message, Linux packaging; copy and paste in the browser; Windows QA pass; Display P3: gamut warning and soft-proof (true P3 blocked upstream); several windows; pen pressure for the Pencil and brushes on Windows and from browser styluses; macOS: quitting ends the process once everything is kept, avoiding the Touch Bar teardown crash (#781); Linux and BSD clipboard: images under Wayland, reads time out; minimised windows under Wayland; window controls on Wayland without server decorations; canvas textures on device pixels) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-10 · **Change:** patch (Windows: the custom title bar's windows stay borderless, so the content is no longer drawn about 30 px low with clicks landing above it (#1343); under Wayland a minimised window answers control and MCP requests in about half a second instead of timing out after 60 s (#1906); images copied in other apps paste in the browser (#492); text reads only the fallback fonts it draws with; `doc.list` gives AI agents and plugins the open files' names, not their paths (#1117); a batch keeps one undo snapshot, not one per step (#1099); one depth cap bounds a whole render, pattern sources included, and render threads get 8 MiB stacks (#1082); in the browser an internal error that stops the page keeps its unsaved files, which open again on reload (#1123); 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); large images on the canvas draw from a smaller copy, so two 16k images no longer lag (#1483); macOS: the Quit menu and ⌘Q ask about unsaved changes (#857); egui/eframe 0.37 dependency migration; hidden-window screenshot deadlines; zoom previews; hidden windows answer control requests; macOS file opening, the Windows start-up message, Linux packaging; copy and paste in the browser; Windows QA pass; Display P3: gamut warning and soft-proof (true P3 blocked upstream); several windows; pen pressure for the Pencil and brushes on Windows and from browser styluses; macOS: quitting ends the process once everything is kept, avoiding the Touch Bar teardown crash (#781); Linux and BSD clipboard: images under Wayland, reads time out; minimised windows under Wayland; window controls on Wayland without server decorations; canvas textures on device pixels) · **Target:** Figma Design (desktop app 126.10.7) How FigCraft uses hardware and which platforms it runs on, against Figma. Figma's desktop app is Electron with a GPU helper process; its canvas renders on the GPU (WebGL, with WebGPU rolling out @@ -50,6 +50,7 @@ Nothing has been timed against Figma on the same document (needs `.fig` import). | Date | Change | Summary | |---|---|---| +| 2026-11-10 | patch | M10, #1343 (also #1422, #2233): Windows: the window no longer draws below a hidden caption. FigCraft draws its own title bar on Windows and opens undecorated windows, but winit 0.30 still gives them `WS_CAPTION | WS_BORDER`; on some systems the desktop compositor reserves that caption, so the content was drawn about 30 px low (a black band above it) while clicks kept the client coordinates and landed above what was drawn. A per-frame step (`apps/figcraft/src/window_frame.rs`, safe `winsafe` calls, Windows only) clears `WS_CAPTION` and `WS_BORDER` from every FigCraft window, the main one and the others, keeping the sizing border and window buttons so edge resizing and snap work, and writes only when a style changed (winit puts them back on maximize and restore). The same fix as DesignCraft #2139 and PhotoCraft #2401; the maximize-to-work-area trim from DesignCraft is left for a later change. Not run on a Windows machine that shows the offset: the style math and the per-frame hook are tested, the window itself needs a live check. Tests: `window_frame_tests`. Numbers unchanged | | 2026-11-06 | patch | M8, #1906: under Wayland (seen on GNOME and KDE Plasma) a minimised FigCraft window still reports itself visible and the compositor stops asking it to draw, so every control or attached-MCP request waited for a frame and timed out after 60 s ("it was not applied"), though eframe kept running the app's logic. `control::background` now treats a window that drew no frame for `NOT_DRAWING_AFTER` (0.2 s) while a request waited for it as hidden: state-only requests are answered from the logic passes (0.54 s each, measured on GNOME Wayland; they took 13.7 s or timed out before), the wait starts again when the window draws, and screenshots and `ui.input` still wait for a frame. Test: `idle_tests::a_window_that_stopped_drawing_answers_from_its_logic_passes` | | 2026-10-31 | minor | M1, #492: Web row: the browser pastes images copied in other apps, read from the paste event under the same limits as the desktop. Numbers unchanged. | | 2026-10-30 | minor | M8: text reads only the fallback fonts it draws with. Each fallback family reads the face nearest a run's style, not all of them (Noto Sans CJK is seven files of 16–20 MB); families naming the faces of one file share its bytes; and the faces are worked out once per style until fonts change, not for every text laid out. First text laid out on a Linux machine with Noto Sans CJK, DejaVu Sans and Inter: 41 files (265 MiB, kept in memory) and 41 faces parsed → 3 files (20 MiB) and 4 faces; fallback lookups per text laid out ~45 µs → 0.2 µs. Tests: `fontdb_fallback_tests`. Numbers unchanged | From 8e1a2ff26223e25bbf452bebb606564241eca7a0 Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Wed, 11 Nov 2026 00:35:51 -0500 Subject: [PATCH 059/101] M10: Docs: the hardware-parity row keeps its three cells (#1343) A bare pipe inside the code span `WS_CAPTION | WS_BORDER` split the table row; the two style names are separate code spans now. Co-Authored-By: Claude Opus 5.5 Model-Effort: Opus 5.5 drove and wrote --- docs/hardware-parity.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/hardware-parity.md b/docs/hardware-parity.md index 846c8a199..b827a887c 100644 --- a/docs/hardware-parity.md +++ b/docs/hardware-parity.md @@ -50,7 +50,7 @@ Nothing has been timed against Figma on the same document (needs `.fig` import). | Date | Change | Summary | |---|---|---| -| 2026-11-10 | patch | M10, #1343 (also #1422, #2233): Windows: the window no longer draws below a hidden caption. FigCraft draws its own title bar on Windows and opens undecorated windows, but winit 0.30 still gives them `WS_CAPTION | WS_BORDER`; on some systems the desktop compositor reserves that caption, so the content was drawn about 30 px low (a black band above it) while clicks kept the client coordinates and landed above what was drawn. A per-frame step (`apps/figcraft/src/window_frame.rs`, safe `winsafe` calls, Windows only) clears `WS_CAPTION` and `WS_BORDER` from every FigCraft window, the main one and the others, keeping the sizing border and window buttons so edge resizing and snap work, and writes only when a style changed (winit puts them back on maximize and restore). The same fix as DesignCraft #2139 and PhotoCraft #2401; the maximize-to-work-area trim from DesignCraft is left for a later change. Not run on a Windows machine that shows the offset: the style math and the per-frame hook are tested, the window itself needs a live check. Tests: `window_frame_tests`. Numbers unchanged | +| 2026-11-10 | patch | M10, #1343 (also #1422, #2233): Windows: the window no longer draws below a hidden caption. FigCraft draws its own title bar on Windows and opens undecorated windows, but winit 0.30 still gives them `WS_CAPTION` and `WS_BORDER`; on some systems the desktop compositor reserves that caption, so the content was drawn about 30 px low (a black band above it) while clicks kept the client coordinates and landed above what was drawn. A per-frame step (`apps/figcraft/src/window_frame.rs`, safe `winsafe` calls, Windows only) clears `WS_CAPTION` and `WS_BORDER` from every FigCraft window, the main one and the others, keeping the sizing border and window buttons so edge resizing and snap work, and writes only when a style changed (winit puts them back on maximize and restore). The same fix as DesignCraft #2139 and PhotoCraft #2401; the maximize-to-work-area trim from DesignCraft is left for a later change. Not run on a Windows machine that shows the offset: the style math and the per-frame hook are tested, the window itself needs a live check. Tests: `window_frame_tests`. Numbers unchanged | | 2026-11-06 | patch | M8, #1906: under Wayland (seen on GNOME and KDE Plasma) a minimised FigCraft window still reports itself visible and the compositor stops asking it to draw, so every control or attached-MCP request waited for a frame and timed out after 60 s ("it was not applied"), though eframe kept running the app's logic. `control::background` now treats a window that drew no frame for `NOT_DRAWING_AFTER` (0.2 s) while a request waited for it as hidden: state-only requests are answered from the logic passes (0.54 s each, measured on GNOME Wayland; they took 13.7 s or timed out before), the wait starts again when the window draws, and screenshots and `ui.input` still wait for a frame. Test: `idle_tests::a_window_that_stopped_drawing_answers_from_its_logic_passes` | | 2026-10-31 | minor | M1, #492: Web row: the browser pastes images copied in other apps, read from the paste event under the same limits as the desktop. Numbers unchanged. | | 2026-10-30 | minor | M8: text reads only the fallback fonts it draws with. Each fallback family reads the face nearest a run's style, not all of them (Noto Sans CJK is seven files of 16–20 MB); families naming the faces of one file share its bytes; and the faces are worked out once per style until fonts change, not for every text laid out. First text laid out on a Linux machine with Noto Sans CJK, DejaVu Sans and Inter: 41 files (265 MiB, kept in memory) and 41 faces parsed → 3 files (20 MiB) and 4 faces; fallback lookups per text laid out ~45 µs → 0.2 µs. Tests: `fontdb_fallback_tests`. Numbers unchanged | From 016dba8c34d697419c7db87ebfd5aa13b925511e Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 10 Nov 2026 23:49:43 -0800 Subject: [PATCH 060/101] Export: the color profile note says Display P3 tagging applies to exports that use the file's profile An export setting set to sRGB still writes sRGB files in a Display P3 document, so the note no longer says every exported PNG, JPG and WebP is tagged Display P3. Follows #1759. --- crates/ui-egui/locales/ar.toml | 2 +- crates/ui-egui/locales/bn.toml | 2 +- crates/ui-egui/locales/bs.toml | 2 +- crates/ui-egui/locales/cs.toml | 2 +- crates/ui-egui/locales/de.toml | 2 +- crates/ui-egui/locales/en.toml | 2 +- crates/ui-egui/locales/es.toml | 2 +- crates/ui-egui/locales/fi.toml | 2 +- crates/ui-egui/locales/fr.toml | 2 +- crates/ui-egui/locales/id.toml | 2 +- crates/ui-egui/locales/it.toml | 2 +- crates/ui-egui/locales/ja.toml | 2 +- crates/ui-egui/locales/ka.toml | 2 +- crates/ui-egui/locales/ko.toml | 2 +- crates/ui-egui/locales/nl.toml | 2 +- crates/ui-egui/locales/pl.toml | 2 +- crates/ui-egui/locales/pt-BR.toml | 2 +- crates/ui-egui/locales/ru.toml | 2 +- crates/ui-egui/locales/sv.toml | 2 +- crates/ui-egui/locales/th.toml | 2 +- crates/ui-egui/locales/tr.toml | 2 +- crates/ui-egui/locales/vi.toml | 2 +- crates/ui-egui/locales/zh-Hans.toml | 2 +- crates/ui-egui/locales/zh-Hant.toml | 2 +- crates/ui-egui/src/dialogs/color_profile.rs | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/crates/ui-egui/locales/ar.toml b/crates/ui-egui/locales/ar.toml index e50a9b9c4..cc55d730a 100644 --- a/crates/ui-egui/locales/ar.toml +++ b/crates/ui-egui/locales/ar.toml @@ -1496,7 +1496,7 @@ status = "draft — needs native review" "Text styles" = "أنماط النص" "Texts" = "النصوص" "Texture" = "النسيج" -"The canvas previews colors in sRGB; exported PNG, JPG and WebP files are tagged Display P3." = "تُعاين الألوان على لوحة الرسم بفضاء sRGB؛ وتُوسم ملفات PNG وJPG وWebP المصدّرة بملف Display P3." +"The canvas previews colors in sRGB; PNG, JPG and WebP exports that use the file's profile are tagged Display P3." = "تُعاين الألوان على لوحة الرسم بفضاء sRGB؛ وملفات PNG وJPG وWebP المصدّرة بملف تعريف الألوان الخاص بالملف تُوسم بملف Display P3." "The destination document is unavailable. Nothing was imported." = "المستند الوجهة غير متاح. لم يُستورد شيء." "The destination document was closed. Nothing was imported." = "أُغلق المستند الوجهة. لم يُستورد شيء." "The destination page was removed. Nothing was imported." = "أُزيلت الصفحة الوجهة. لم يُستورد شيء." diff --git a/crates/ui-egui/locales/bn.toml b/crates/ui-egui/locales/bn.toml index b79877271..03927be6b 100644 --- a/crates/ui-egui/locales/bn.toml +++ b/crates/ui-egui/locales/bn.toml @@ -1453,7 +1453,7 @@ status = "draft — needs native review" "Text styles" = "টেক্সট স্টাইলসমূহ" "Texts" = "টেক্সটসমূহ" "Texture" = "টেক্সচার" -"The canvas previews colors in sRGB; exported PNG, JPG and WebP files are tagged Display P3." = "ক্যানভাস sRGB-তে রঙ প্রিভিউ করে; এক্সপোর্ট করা PNG, JPG এবং WebP ফাইলে Display P3 ট্যাগ করা থাকে।" +"The canvas previews colors in sRGB; PNG, JPG and WebP exports that use the file's profile are tagged Display P3." = "ক্যানভাস sRGB-তে রঙ প্রিভিউ করে; ফাইলের প্রোফাইল দিয়ে এক্সপোর্ট করা PNG, JPG এবং WebP ফাইলে Display P3 ট্যাগ করা থাকে।" "The destination document is unavailable. Nothing was imported." = "গন্তব্য ডকুমেন্ট অনুপলব্ধ। কিছু ইম্পোর্ট করা হয়নি।" "The destination document was closed. Nothing was imported." = "গন্তব্য ডকুমেন্ট বন্ধ করা হয়েছিল। কিছু ইম্পোর্ট করা হয়নি।" "The destination page was removed. Nothing was imported." = "গন্তব্য পেজ সরানো হয়েছে। কিছু ইম্পোর্ট করা হয়নি।" diff --git a/crates/ui-egui/locales/bs.toml b/crates/ui-egui/locales/bs.toml index 919bc0381..bbb268933 100644 --- a/crates/ui-egui/locales/bs.toml +++ b/crates/ui-egui/locales/bs.toml @@ -1508,7 +1508,7 @@ status = "draft — needs native review" "Text styles" = "Stilovi teksta" "Texts" = "Tekstovi" "Texture" = "Tekstura" -"The canvas previews colors in sRGB; exported PNG, JPG and WebP files are tagged Display P3." = "Platno prikazuje boje u sRGB-u; izvezene PNG, JPG i WebP datoteke su označene kao Display P3." +"The canvas previews colors in sRGB; PNG, JPG and WebP exports that use the file's profile are tagged Display P3." = "Platno prikazuje boje u sRGB-u; PNG, JPG i WebP datoteke izvezene s profilom datoteke su označene kao Display P3." "The destination document is unavailable. Nothing was imported." = "Odredišni dokument nije dostupan. Ništa nije uvezeno." "The destination document was closed. Nothing was imported." = "Odredišni dokument je zatvoren. Ništa nije uvezeno." "The destination page was removed. Nothing was imported." = "Odredišna stranica je uklonjena. Ništa nije uvezeno." diff --git a/crates/ui-egui/locales/cs.toml b/crates/ui-egui/locales/cs.toml index 7ecc6779a..6f6399811 100644 --- a/crates/ui-egui/locales/cs.toml +++ b/crates/ui-egui/locales/cs.toml @@ -1428,7 +1428,7 @@ status = "draft — needs native review" "Text styles" = "Textové styly" "Texts" = "Texty" "Texture" = "Textura" -"The canvas previews colors in sRGB; exported PNG, JPG and WebP files are tagged Display P3." = "Plátno zobrazuje barvy v sRGB; exportované soubory PNG, JPG a WebP mají profil Display P3." +"The canvas previews colors in sRGB; PNG, JPG and WebP exports that use the file's profile are tagged Display P3." = "Plátno zobrazuje barvy v sRGB; soubory PNG, JPG a WebP exportované s profilem souboru mají profil Display P3." "The file is deleted from the server: nobody can open or join it from there again, and this can't be undone. Copies that are open stay with whoever has them." = "Soubor se smaže ze serveru: nikdo ho odtud již neotevře ani se k němu nepřipojí a tuto akci nelze vrátit zpět. Otevřené kopie zůstanou těm, kteří je mají." "The file now holds another library" = "Soubor nyní obsahuje jinou knihovnu" "The file now holds another library (\"{name}\")" = "Soubor nyní obsahuje jinou knihovnu („{name}“)" diff --git a/crates/ui-egui/locales/de.toml b/crates/ui-egui/locales/de.toml index f57fcc5d3..d0e1536fe 100644 --- a/crates/ui-egui/locales/de.toml +++ b/crates/ui-egui/locales/de.toml @@ -1398,7 +1398,7 @@ status = "draft — needs native review" "Text styles" = "Textstile" "Texts" = "Texte" "Texture" = "Textur" -"The canvas previews colors in sRGB; exported PNG, JPG and WebP files are tagged Display P3." = "Die Arbeitsfläche zeigt Farben in sRGB an; exportierte PNG-, JPG- und WebP-Dateien werden als Display P3 gekennzeichnet." +"The canvas previews colors in sRGB; PNG, JPG and WebP exports that use the file's profile are tagged Display P3." = "Die Arbeitsfläche zeigt Farben in sRGB an; PNG-, JPG- und WebP-Exporte mit dem Profil der Datei werden als Display P3 gekennzeichnet." "The destination document is unavailable. Nothing was imported." = "Das Zieldokument ist nicht verfügbar. Es wurde nichts importiert." "The destination document was closed. Nothing was imported." = "Das Zieldokument wurde geschlossen. Es wurde nichts importiert." "The destination page was removed. Nothing was imported." = "Die Zielseite wurde entfernt. Es wurde nichts importiert." diff --git a/crates/ui-egui/locales/en.toml b/crates/ui-egui/locales/en.toml index 625ee3bd8..3d3fb7fc4 100644 --- a/crates/ui-egui/locales/en.toml +++ b/crates/ui-egui/locales/en.toml @@ -1577,7 +1577,7 @@ name = "English" "Text styles" = "Text styles" "Texts" = "Texts" "Texture" = "Texture" -"The canvas previews colors in sRGB; exported PNG, JPG and WebP files are tagged Display P3." = "The canvas previews colors in sRGB; exported PNG, JPG and WebP files are tagged Display P3." +"The canvas previews colors in sRGB; PNG, JPG and WebP exports that use the file's profile are tagged Display P3." = "The canvas previews colors in sRGB; PNG, JPG and WebP exports that use the file's profile are tagged Display P3." "The destination document is unavailable. Nothing was imported." = "The destination document is unavailable. Nothing was imported." "The destination document was closed. Nothing was imported." = "The destination document was closed. Nothing was imported." "The destination page was removed. Nothing was imported." = "The destination page was removed. Nothing was imported." diff --git a/crates/ui-egui/locales/es.toml b/crates/ui-egui/locales/es.toml index 258a1527d..f6f437925 100644 --- a/crates/ui-egui/locales/es.toml +++ b/crates/ui-egui/locales/es.toml @@ -1491,7 +1491,7 @@ status = "draft — needs native review" "Text styles" = "Estilos de texto" "Texts" = "Textos" "Texture" = "Textura" -"The canvas previews colors in sRGB; exported PNG, JPG and WebP files are tagged Display P3." = "El lienzo muestra los colores en sRGB; los archivos PNG, JPG y WebP exportados se etiquetan como Display P3." +"The canvas previews colors in sRGB; PNG, JPG and WebP exports that use the file's profile are tagged Display P3." = "El lienzo muestra los colores en sRGB; los archivos PNG, JPG y WebP exportados con el perfil del archivo se etiquetan como Display P3." "The destination document is unavailable. Nothing was imported." = "El documento de destino no está disponible. No se importó nada." "The destination document was closed. Nothing was imported." = "Se cerró el documento de destino. No se importó nada." "The destination page was removed. Nothing was imported." = "Se eliminó la página de destino. No se importó nada." diff --git a/crates/ui-egui/locales/fi.toml b/crates/ui-egui/locales/fi.toml index 88fb21e06..d9544ec94 100644 --- a/crates/ui-egui/locales/fi.toml +++ b/crates/ui-egui/locales/fi.toml @@ -1522,7 +1522,7 @@ status = "draft — needs native review" "Text styles" = "Tekstityylit" "Texts" = "Tekstit" "Texture" = "Tekstuuri" -"The canvas previews colors in sRGB; exported PNG, JPG and WebP files are tagged Display P3." = "Piirtoalue esikatselee värit sRGB-muodossa. Vietäviin PNG-, JPG- ja WebP-tiedostoihin merkitään Display P3 -profiili." +"The canvas previews colors in sRGB; PNG, JPG and WebP exports that use the file's profile are tagged Display P3." = "Piirtoalue esikatselee värit sRGB-muodossa. Tiedoston profiililla vietäviin PNG-, JPG- ja WebP-tiedostoihin merkitään Display P3 -profiili." "The destination document is unavailable. Nothing was imported." = "Kohdeasiakirja ei ole käytettävissä. Mitään ei tuotu." "The destination document was closed. Nothing was imported." = "Kohdeasiakirja suljettiin. Mitään ei tuotu." "The destination page was removed. Nothing was imported." = "Kohdesivu poistettiin. Mitään ei tuotu." diff --git a/crates/ui-egui/locales/fr.toml b/crates/ui-egui/locales/fr.toml index e40b3a060..33c7d1ad4 100644 --- a/crates/ui-egui/locales/fr.toml +++ b/crates/ui-egui/locales/fr.toml @@ -1457,7 +1457,7 @@ status = "draft — needs native review" "Text styles" = "Styles de texte" "Texts" = "Textes" "Texture" = "Texture" -"The canvas previews colors in sRGB; exported PNG, JPG and WebP files are tagged Display P3." = "Le canevas affiche les couleurs en sRGB ; les fichiers PNG, JPG et WebP exportés sont balisés Display P3." +"The canvas previews colors in sRGB; PNG, JPG and WebP exports that use the file's profile are tagged Display P3." = "Le canevas affiche les couleurs en sRGB ; les fichiers PNG, JPG et WebP exportés avec le profil du fichier sont balisés Display P3." "The destination document is unavailable. Nothing was imported." = "Le document de destination est indisponible. Rien n’a été importé." "The destination document was closed. Nothing was imported." = "Le document de destination a été fermé. Rien n’a été importé." "The destination page was removed. Nothing was imported." = "La page de destination a été supprimée. Rien n’a été importé." diff --git a/crates/ui-egui/locales/id.toml b/crates/ui-egui/locales/id.toml index 59dbd492c..2945719fd 100644 --- a/crates/ui-egui/locales/id.toml +++ b/crates/ui-egui/locales/id.toml @@ -1434,7 +1434,7 @@ status = "draft — needs native review" "Text styles" = "Gaya teks" "Texts" = "Teks" "Texture" = "Tekstur" -"The canvas previews colors in sRGB; exported PNG, JPG and WebP files are tagged Display P3." = "Kanvas mempratinjau warna dalam sRGB; file PNG, JPG, dan WebP yang diekspor ditandai Display P3." +"The canvas previews colors in sRGB; PNG, JPG and WebP exports that use the file's profile are tagged Display P3." = "Kanvas mempratinjau warna dalam sRGB; file PNG, JPG, dan WebP yang diekspor dengan profil file ditandai Display P3." "The file is deleted from the server: nobody can open or join it from there again, and this can't be undone. Copies that are open stay with whoever has them." = "File dihapus dari server: tidak ada yang dapat membuka atau bergabung ke file itu dari sana lagi, dan tindakan ini tidak dapat diurungkan. Salinan yang sedang terbuka tetap ada pada pemiliknya." "The file now holds another library" = "File kini berisi pustaka lain" "The file now holds another library (\"{name}\")" = "File kini berisi pustaka lain (\"{name}\")" diff --git a/crates/ui-egui/locales/it.toml b/crates/ui-egui/locales/it.toml index f61ee86fe..16001e8cb 100644 --- a/crates/ui-egui/locales/it.toml +++ b/crates/ui-egui/locales/it.toml @@ -1389,7 +1389,7 @@ status = "draft — needs native review" "Text styles" = "Stili di testo" "Texts" = "Testi" "Texture" = "Texture" -"The canvas previews colors in sRGB; exported PNG, JPG and WebP files are tagged Display P3." = "Il canvas mostra i colori in sRGB; i file PNG, JPG e WebP esportati sono contrassegnati come Display P3." +"The canvas previews colors in sRGB; PNG, JPG and WebP exports that use the file's profile are tagged Display P3." = "Il canvas mostra i colori in sRGB; i file PNG, JPG e WebP esportati con il profilo del file sono contrassegnati come Display P3." "The destination document is unavailable. Nothing was imported." = "Il documento di destinazione non è disponibile. Non è stato importato nulla." "The destination document was closed. Nothing was imported." = "Il documento di destinazione è stato chiuso. Non è stato importato nulla." "The destination page was removed. Nothing was imported." = "La pagina di destinazione è stata rimossa. Non è stato importato nulla." diff --git a/crates/ui-egui/locales/ja.toml b/crates/ui-egui/locales/ja.toml index d440e910f..94a7e9574 100644 --- a/crates/ui-egui/locales/ja.toml +++ b/crates/ui-egui/locales/ja.toml @@ -1444,7 +1444,7 @@ status = "draft — needs native review" "Text styles" = "テキストスタイル" "Texts" = "テキスト" "Texture" = "テクスチャ" -"The canvas previews colors in sRGB; exported PNG, JPG and WebP files are tagged Display P3." = "キャンバスは sRGB で色をプレビュー。書き出した PNG、JPG、WebP ファイルには Display P3 のタグが付く。" +"The canvas previews colors in sRGB; PNG, JPG and WebP exports that use the file's profile are tagged Display P3." = "キャンバスは sRGB で色をプレビュー。ファイルのプロファイルで書き出した PNG、JPG、WebP ファイルには Display P3 のタグが付く。" "The file is deleted from the server: nobody can open or join it from there again, and this can't be undone. Copies that are open stay with whoever has them." = "ファイルはサーバーから削除される:サーバーから開いたり参加したりすることは誰にもできなくなり、元に戻せない。開いているコピーは各自の手元に残る。" "The file now holds another library" = "このファイルは別のライブラリになっている" "The file now holds another library (\"{name}\")" = "このファイルは別のライブラリ(「{name}」)になっている" diff --git a/crates/ui-egui/locales/ka.toml b/crates/ui-egui/locales/ka.toml index 4c6764afa..816381c24 100644 --- a/crates/ui-egui/locales/ka.toml +++ b/crates/ui-egui/locales/ka.toml @@ -1477,7 +1477,7 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv "Text styles" = "ტექსტის სტილები" "Texts" = "ტექსტები" "Texture" = "ტექსტურა" -"The canvas previews colors in sRGB; exported PNG, JPG and WebP files are tagged Display P3." = "ტილო ფერებს sRGB-ში აჩვენებს; ექსპორტირებულ PNG, JPG და WebP ფაილებს Display P3 ჭდე აქვს." +"The canvas previews colors in sRGB; PNG, JPG and WebP exports that use the file's profile are tagged Display P3." = "ტილო ფერებს sRGB-ში აჩვენებს; ფაილის პროფილით ექსპორტირებულ PNG, JPG და WebP ფაილებს Display P3 ჭდე აქვს." "The destination document is unavailable. Nothing was imported." = "დანიშნულების დოკუმენტი მიუწვდომელია. იმპორტი არ შესრულდა." "The destination document was closed. Nothing was imported." = "დანიშნულების დოკუმენტი დაიხურა. იმპორტი არ შესრულდა." "The destination page was removed. Nothing was imported." = "დანიშნულების გვერდი წაიშალა. იმპორტი არ შესრულდა." diff --git a/crates/ui-egui/locales/ko.toml b/crates/ui-egui/locales/ko.toml index b4c960fbc..666fd02c8 100644 --- a/crates/ui-egui/locales/ko.toml +++ b/crates/ui-egui/locales/ko.toml @@ -1379,7 +1379,7 @@ status = "draft — needs native review" "Text styles" = "텍스트 스타일" "Texts" = "텍스트" "Texture" = "텍스처" -"The canvas previews colors in sRGB; exported PNG, JPG and WebP files are tagged Display P3." = "캔버스는 sRGB로 색상을 미리 보여 줌. 내보낸 PNG, JPG, WebP 파일에는 Display P3 태그가 붙음." +"The canvas previews colors in sRGB; PNG, JPG and WebP exports that use the file's profile are tagged Display P3." = "캔버스는 sRGB로 색상을 미리 보여 줌. 파일의 프로필로 내보낸 PNG, JPG, WebP 파일에는 Display P3 태그가 붙음." "The file is deleted from the server: nobody can open or join it from there again, and this can't be undone. Copies that are open stay with whoever has them." = "파일이 서버에서 삭제됨: 누구도 서버에서 다시 열거나 참여할 수 없으며 되돌릴 수 없음. 열려 있는 사본은 각자에게 남음." "The file now holds another library" = "이 파일은 이제 다른 라이브러리를 담고 있음" "The file now holds another library (\"{name}\")" = "이 파일은 이제 다른 라이브러리(\"{name}\")를 담고 있음" diff --git a/crates/ui-egui/locales/nl.toml b/crates/ui-egui/locales/nl.toml index 2d6816ab6..9e289ef1f 100644 --- a/crates/ui-egui/locales/nl.toml +++ b/crates/ui-egui/locales/nl.toml @@ -1458,7 +1458,7 @@ status = "draft — needs native review" "Text styles" = "Tekststijlen" "Texts" = "Teksten" "Texture" = "Texture" -"The canvas previews colors in sRGB; exported PNG, JPG and WebP files are tagged Display P3." = "Het canvas toont de kleuren als voorvertoning in sRGB; geëxporteerde PNG-, JPG- en WebP-bestanden worden gelabeld als Display P3." +"The canvas previews colors in sRGB; PNG, JPG and WebP exports that use the file's profile are tagged Display P3." = "Het canvas toont de kleuren als voorvertoning in sRGB; PNG-, JPG- en WebP-bestanden die met het profiel van het bestand worden geëxporteerd, worden gelabeld als Display P3." "The destination document is unavailable. Nothing was imported." = "Het doeldocument is niet beschikbaar. Er is niets geïmporteerd." "The destination document was closed. Nothing was imported." = "Het doeldocument is gesloten. Er is niets geïmporteerd." "The destination page was removed. Nothing was imported." = "De doelpagina is verwijderd. Er is niets geïmporteerd." diff --git a/crates/ui-egui/locales/pl.toml b/crates/ui-egui/locales/pl.toml index bcc9f0051..fb93dcaf0 100644 --- a/crates/ui-egui/locales/pl.toml +++ b/crates/ui-egui/locales/pl.toml @@ -1465,7 +1465,7 @@ name = "Polski" "Text styles" = "Style tekstu" "Texts" = "Teksty" "Texture" = "Tekstura" -"The canvas previews colors in sRGB; exported PNG, JPG and WebP files are tagged Display P3." = "Płótno wyświetla podgląd kolorów w sRGB; wyeksportowane pliki PNG, JPG i WebP są oznaczane profilem Display P3." +"The canvas previews colors in sRGB; PNG, JPG and WebP exports that use the file's profile are tagged Display P3." = "Płótno wyświetla podgląd kolorów w sRGB; pliki PNG, JPG i WebP wyeksportowane z profilem pliku są oznaczane profilem Display P3." "The destination document is unavailable. Nothing was imported." = "Dokument docelowy jest niedostępny. Nic nie zostało zaimportowane." "The destination document was closed. Nothing was imported." = "Dokument docelowy został zamknięty. Nic nie zostało zaimportowane." "The destination page was removed. Nothing was imported." = "Strona docelowa została usunięta. Nic nie zostało zaimportowane." diff --git a/crates/ui-egui/locales/pt-BR.toml b/crates/ui-egui/locales/pt-BR.toml index 9108dea4d..7e7500145 100644 --- a/crates/ui-egui/locales/pt-BR.toml +++ b/crates/ui-egui/locales/pt-BR.toml @@ -1377,7 +1377,7 @@ status = "draft — needs native review" "Text styles" = "Estilos de texto" "Texts" = "Textos" "Texture" = "Textura" -"The canvas previews colors in sRGB; exported PNG, JPG and WebP files are tagged Display P3." = "A tela exibe as cores em sRGB; os arquivos PNG, JPG e WebP exportados são marcados como Display P3." +"The canvas previews colors in sRGB; PNG, JPG and WebP exports that use the file's profile are tagged Display P3." = "A tela exibe as cores em sRGB; os arquivos PNG, JPG e WebP exportados com o perfil do arquivo são marcados como Display P3." "The file is deleted from the server: nobody can open or join it from there again, and this can't be undone. Copies that are open stay with whoever has them." = "O arquivo é excluído do servidor: ninguém poderá abri-lo nem entrar nele a partir de lá de novo, e isso não pode ser desfeito. As cópias abertas ficam com quem as tem." "The file now holds another library" = "O arquivo agora contém outra biblioteca" "The file now holds another library (\"{name}\")" = "O arquivo agora contém outra biblioteca (\"{name}\")" diff --git a/crates/ui-egui/locales/ru.toml b/crates/ui-egui/locales/ru.toml index 36e9abeaa..92670011a 100644 --- a/crates/ui-egui/locales/ru.toml +++ b/crates/ui-egui/locales/ru.toml @@ -1465,7 +1465,7 @@ name = "Русский" "Text styles" = "Текстовые стили" "Texts" = "Тексты" "Texture" = "Текстура" -"The canvas previews colors in sRGB; exported PNG, JPG and WebP files are tagged Display P3." = "На холсте цвета отображаются в sRGB; экспортированные PNG, JPG и WebP помечены профилем Display P3." +"The canvas previews colors in sRGB; PNG, JPG and WebP exports that use the file's profile are tagged Display P3." = "На холсте цвета отображаются в sRGB; PNG, JPG и WebP, экспортированные с профилем файла, помечены профилем Display P3." "The destination document is unavailable. Nothing was imported." = "Документ назначения недоступен. Ничего не импортировано." "The destination document was closed. Nothing was imported." = "Документ назначения закрыт. Ничего не импортировано." "The destination page was removed. Nothing was imported." = "Страница назначения удалена. Ничего не импортировано." diff --git a/crates/ui-egui/locales/sv.toml b/crates/ui-egui/locales/sv.toml index ce02b3f7f..93353be22 100644 --- a/crates/ui-egui/locales/sv.toml +++ b/crates/ui-egui/locales/sv.toml @@ -1537,7 +1537,7 @@ name = "Svenska" "Text styles" = "Textstilar" "Texts" = "Texter" "Texture" = "Textur" -"The canvas previews colors in sRGB; exported PNG, JPG and WebP files are tagged Display P3." = "Arbetsytan förhandsgranskar färger i sRGB; exporterade PNG-, JPG- och WebP-filer märks med Display P3." +"The canvas previews colors in sRGB; PNG, JPG and WebP exports that use the file's profile are tagged Display P3." = "Arbetsytan förhandsgranskar färger i sRGB; PNG-, JPG- och WebP-filer som exporteras med filens profil märks med Display P3." "The destination document is unavailable. Nothing was imported." = "Måldokumentet är inte tillgängligt. Ingenting importerades." "The destination document was closed. Nothing was imported." = "Måldokumentet stängdes. Ingenting importerades." "The destination page was removed. Nothing was imported." = "Målsidan togs bort. Ingenting importerades." diff --git a/crates/ui-egui/locales/th.toml b/crates/ui-egui/locales/th.toml index f4662a2b8..629abaa56 100644 --- a/crates/ui-egui/locales/th.toml +++ b/crates/ui-egui/locales/th.toml @@ -1446,7 +1446,7 @@ status = "draft — needs native review" "Text styles" = "สไตล์ข้อความ" "Texts" = "ข้อความ" "Texture" = "เท็กซ์เจอร์" -"The canvas previews colors in sRGB; exported PNG, JPG and WebP files are tagged Display P3." = "แคนวาสแสดงตัวอย่างสีใน sRGB ส่วนไฟล์ PNG, JPG และ WebP ที่ส่งออกจะติดแท็ก Display P3" +"The canvas previews colors in sRGB; PNG, JPG and WebP exports that use the file's profile are tagged Display P3." = "แคนวาสแสดงตัวอย่างสีใน sRGB ส่วนไฟล์ PNG, JPG และ WebP ที่ส่งออกด้วยโปรไฟล์ของไฟล์จะติดแท็ก Display P3" "The destination document is unavailable. Nothing was imported." = "เอกสารปลายทางใช้ไม่ได้ ไม่มีอะไรถูกนำเข้า" "The destination document was closed. Nothing was imported." = "เอกสารปลายทางถูกปิดแล้ว ไม่มีอะไรถูกนำเข้า" "The destination page was removed. Nothing was imported." = "หน้าปลายทางถูกลบแล้ว ไม่มีอะไรถูกนำเข้า" diff --git a/crates/ui-egui/locales/tr.toml b/crates/ui-egui/locales/tr.toml index b98f8389b..f27ccf52f 100644 --- a/crates/ui-egui/locales/tr.toml +++ b/crates/ui-egui/locales/tr.toml @@ -1433,7 +1433,7 @@ name = "Türkçe" "Text styles" = "Metin stilleri" "Texts" = "Metinler" "Texture" = "Doku" -"The canvas previews colors in sRGB; exported PNG, JPG and WebP files are tagged Display P3." = "Tuval renkleri sRGB olarak önizler; dışa aktarılan PNG, JPG ve WebP dosyaları Display P3 olarak etiketlenir." +"The canvas previews colors in sRGB; PNG, JPG and WebP exports that use the file's profile are tagged Display P3." = "Tuval renkleri sRGB olarak önizler; dosyanın profiliyle dışa aktarılan PNG, JPG ve WebP dosyaları Display P3 olarak etiketlenir." "The file is deleted from the server: nobody can open or join it from there again, and this can't be undone. Copies that are open stay with whoever has them." = "Dosya sunucudan silinir: artık kimse onu oradan açamaz veya ona katılamaz ve bu işlem geri alınamaz. Açık olan kopyalar, kimdeyse onda kalır." "The file now holds another library" = "Dosya artık başka bir kitaplık içeriyor" "The file now holds another library (\"{name}\")" = "Dosya artık başka bir kitaplık içeriyor (“{name}”)" diff --git a/crates/ui-egui/locales/vi.toml b/crates/ui-egui/locales/vi.toml index 5bd9cf7ff..83142691c 100644 --- a/crates/ui-egui/locales/vi.toml +++ b/crates/ui-egui/locales/vi.toml @@ -1390,7 +1390,7 @@ status = "draft — needs native review" "Text styles" = "Kiểu văn bản" "Texts" = "Văn bản" "Texture" = "Kết cấu" -"The canvas previews colors in sRGB; exported PNG, JPG and WebP files are tagged Display P3." = "Vùng vẽ xem trước màu theo sRGB; các tệp PNG, JPG và WebP xuất ra được gắn thẻ Display P3." +"The canvas previews colors in sRGB; PNG, JPG and WebP exports that use the file's profile are tagged Display P3." = "Vùng vẽ xem trước màu theo sRGB; các tệp PNG, JPG và WebP xuất ra theo cấu hình của tệp được gắn thẻ Display P3." "The destination document is unavailable. Nothing was imported." = "Tài liệu đích không khả dụng. Không có nội dung nào được nhập." "The destination document was closed. Nothing was imported." = "Tài liệu đích đã đóng. Không có nội dung nào được nhập." "The destination page was removed. Nothing was imported." = "Trang đích đã bị xóa. Không có nội dung nào được nhập." diff --git a/crates/ui-egui/locales/zh-Hans.toml b/crates/ui-egui/locales/zh-Hans.toml index f78f0d938..9c593ccd5 100644 --- a/crates/ui-egui/locales/zh-Hans.toml +++ b/crates/ui-egui/locales/zh-Hans.toml @@ -1387,7 +1387,7 @@ status = "draft — needs native review" "Text styles" = "文本样式" "Texts" = "文本" "Texture" = "纹理" -"The canvas previews colors in sRGB; exported PNG, JPG and WebP files are tagged Display P3." = "画布以 sRGB 预览颜色;导出的 PNG、JPG 和 WebP 文件标记为 Display P3。" +"The canvas previews colors in sRGB; PNG, JPG and WebP exports that use the file's profile are tagged Display P3." = "画布以 sRGB 预览颜色;使用文件配置文件导出的 PNG、JPG 和 WebP 文件标记为 Display P3。" "The file is deleted from the server: nobody can open or join it from there again, and this can't be undone. Copies that are open stay with whoever has them." = "文件将从服务器删除:任何人都无法再从服务器打开或加入它,且无法撤销。已打开的副本仍归各自持有者所有。" "The file now holds another library" = "该文件现在包含另一个库" "The file now holds another library (\"{name}\")" = "该文件现在包含另一个库(“{name}”)" diff --git a/crates/ui-egui/locales/zh-Hant.toml b/crates/ui-egui/locales/zh-Hant.toml index a1179aa0c..fb941ceec 100644 --- a/crates/ui-egui/locales/zh-Hant.toml +++ b/crates/ui-egui/locales/zh-Hant.toml @@ -1542,7 +1542,7 @@ status = "draft — needs native review" "Texts" = "文字" "Texture" = "材質" "The bars are hidden. {shortcut} shows them again" = "工具列已隱藏。按 {shortcut} 可再次顯示" -"The canvas previews colors in sRGB; exported PNG, JPG and WebP files are tagged Display P3." = "畫布以 sRGB 預覽顏色;匯出的 PNG、JPG 與 WebP 檔案會標記為 Display P3。" +"The canvas previews colors in sRGB; PNG, JPG and WebP exports that use the file's profile are tagged Display P3." = "畫布以 sRGB 預覽顏色;使用檔案描述檔匯出的 PNG、JPG 與 WebP 檔案會標記為 Display P3。" "The destination document is unavailable. Nothing was imported." = "目的地文件無法使用。未匯入任何內容。" "The destination document was closed. Nothing was imported." = "目的地文件已關閉。未匯入任何內容。" "The destination page was removed. Nothing was imported." = "目的地頁面已移除。未匯入任何內容。" diff --git a/crates/ui-egui/src/dialogs/color_profile.rs b/crates/ui-egui/src/dialogs/color_profile.rs index 3cf941dc0..1a5cb3587 100644 --- a/crates/ui-egui/src/dialogs/color_profile.rs +++ b/crates/ui-egui/src/dialogs/color_profile.rs @@ -36,7 +36,7 @@ pub(super) fn color_profile_dialog(app: &mut FigApp, ctx: &Context) { if !chosen.is_srgb() { ui.add_space(4.0); ui.label( - RichText::new(tr("The canvas previews colors in sRGB; exported PNG, JPG and WebP files are tagged Display P3.")) + RichText::new(tr("The canvas previews colors in sRGB; PNG, JPG and WebP exports that use the file's profile are tagged Display P3.")) .color(t.text_secondary) .font(regular(11.0)), ); From 3d4c798ff23a04a953118439f2a52b4c2d671d0c Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 10 Nov 2026 23:58:47 -0800 Subject: [PATCH 061/101] Export: the Vietnamese color profile note names the file's color profile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Vietnamese row said "cấu hình của tệp" (the file's configuration) for the file's profile. It now says "hồ sơ màu của tệp", the term the Color profile label uses. --- crates/ui-egui/locales/vi.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ui-egui/locales/vi.toml b/crates/ui-egui/locales/vi.toml index 83142691c..578619809 100644 --- a/crates/ui-egui/locales/vi.toml +++ b/crates/ui-egui/locales/vi.toml @@ -1390,7 +1390,7 @@ status = "draft — needs native review" "Text styles" = "Kiểu văn bản" "Texts" = "Văn bản" "Texture" = "Kết cấu" -"The canvas previews colors in sRGB; PNG, JPG and WebP exports that use the file's profile are tagged Display P3." = "Vùng vẽ xem trước màu theo sRGB; các tệp PNG, JPG và WebP xuất ra theo cấu hình của tệp được gắn thẻ Display P3." +"The canvas previews colors in sRGB; PNG, JPG and WebP exports that use the file's profile are tagged Display P3." = "Vùng vẽ xem trước màu theo sRGB; các tệp PNG, JPG và WebP xuất ra theo hồ sơ màu của tệp được gắn thẻ Display P3." "The destination document is unavailable. Nothing was imported." = "Tài liệu đích không khả dụng. Không có nội dung nào được nhập." "The destination document was closed. Nothing was imported." = "Tài liệu đích đã đóng. Không có nội dung nào được nhập." "The destination page was removed. Nothing was imported." = "Trang đích đã bị xóa. Không có nội dung nào được nhập." From 0f0826906786563a4f287d2145a1ede733eb8cb7 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Wed, 11 Nov 2026 08:36:29 -0500 Subject: [PATCH 062/101] fix(collab-net): never send the server key over plain ws:// to another machine (#1923) * fix(collab-net): never send the server key over plain ws:// to another machine Publishing a plugin, uploading or sharing with the server's key accepted a ws:// address for a remote host, so the reusable administrative key went out in clear text. The key now goes only over wss://, or over ws:// to this machine (loopback or localhost); browsing without a key is unchanged. * address review: connect only to loopback addresses for a plain ws://localhost endpoint --- crates/collab-net/src/link.rs | 4 ++++ crates/collab-net/src/net.rs | 38 +++++++++++++++++++++++++++---- crates/collab-net/src/requests.rs | 27 ++++++++++++++++++++++ 3 files changed, 65 insertions(+), 4 deletions(-) diff --git a/crates/collab-net/src/link.rs b/crates/collab-net/src/link.rs index 1cf23c9a2..30bc587c3 100644 --- a/crates/collab-net/src/link.rs +++ b/crates/collab-net/src/link.rs @@ -220,6 +220,7 @@ impl LiveLink for NetLink { let (server, query) = Endpoint::parse(&o.server)?; // Without a key: as anyone may, when the server is open to the public (it says if not). let key = requests::server_key(o.key, query); + requests::key_over_tls(&server, key.as_deref())?; // Until the upload is done the invite names only the server. let cfg = self.guest_config(Invite { server: server.clone(), file: String::new(), token: String::new() }, None, &o.me); let inbox = self.sessions.inbox(); @@ -342,6 +343,7 @@ fn upload(o: PublishOptions, limits: &NetLimits) -> Result { let (server, query) = Endpoint::parse(&o.server)?; let key = requests::server_key(o.key, query) .ok_or("the server address needs the server's key (ws://host:port/?key=…; `figcraft-server key` prints it)")?; + requests::key_over_tls(&server, Some(&key))?; upload_file(&server, Some(&key), &o.name, &o.doc, limits, CONNECT).map(|(_, published, _)| published) } @@ -358,6 +360,7 @@ fn hosting(server: &str, file: &str, owner: &str, req: Option, limits: &N fn share(server: &str, file: &str, owner: &str, revoke: &[String], create: bool, limits: &NetLimits) -> Result, String> { let (endpoint, query) = Endpoint::parse(server)?; let key = requests::server_key(None, query); + requests::key_over_tls(&endpoint, key.as_deref())?; manage::share(&endpoint, key.as_deref(), file, owner, revoke, create, limits, CONNECT) } @@ -365,6 +368,7 @@ fn share(server: &str, file: &str, owner: &str, revoke: &[String], create: bool, fn plugins(server: &str, req: PluginReq, limits: &NetLimits) -> Result { let (server, query) = Endpoint::parse(server)?; let key = query.into_iter().find(|(k, _)| k == "key").map(|(_, v)| v).unwrap_or_default(); + requests::key_over_tls(&server, Some(&key))?; manage::plugins(&server, key.trim(), req, limits, CONNECT) } diff --git a/crates/collab-net/src/net.rs b/crates/collab-net/src/net.rs index 9c35b5d1c..c8c29bbdb 100644 --- a/crates/collab-net/src/net.rs +++ b/crates/collab-net/src/net.rs @@ -242,18 +242,30 @@ pub fn shutdown(s: &TcpStream) { /// Connect to `server` (through TLS for `wss://`): the reader's and the writer's handles, and the /// socket to shut it down with. pub fn open(server: &Endpoint, timeout: Duration, limits: &NetLimits) -> Result<(Duplex, Duplex, TcpStream), String> { - let stream = dial(&server.host, timeout, limits)?; + // A plain `ws://localhost` is trusted as this machine (a key may go over it), so only loopback + // addresses are connected to: a resolver mapping the name elsewhere must not carry it off-machine. + let stream = dial(&server.host, !server.secure && server.loopback(), timeout, limits)?; let tls = if server.secure { Some(tls::handshake(&stream, &server.host)?) } else { None }; Duplex::split(stream, tls).map_err(|e| e.to_string()) } -/// Connect to `host` (`name:port`), trying each of its addresses within `timeout`, with Nagle off -/// and reads and writes bounded by `limits`' hello and write timeouts. -fn dial(host: &str, timeout: Duration, limits: &NetLimits) -> Result { +/// Whether `a` may be connected to: any address, or with `loopback_only` just this machine's. +fn dialable(a: &std::net::SocketAddr, loopback_only: bool) -> bool { + !loopback_only || a.ip().is_loopback() +} + +/// Connect to `host` (`name:port`), trying each of its addresses within `timeout` (only loopback +/// ones with `loopback_only`), with Nagle off and reads and writes bounded by `limits`' hello and +/// write timeouts. +fn dial(host: &str, loopback_only: bool, timeout: Duration, limits: &NetLimits) -> Result { use std::net::ToSocketAddrs; let addrs = host.to_socket_addrs().map_err(|e| format!("can't find {host}: {e}"))?; let mut last = format!("can't find {host}"); for a in addrs { + if !dialable(&a, loopback_only) { + last = format!("{host} resolves to {a}, which is not this machine"); + continue; + } match TcpStream::connect_timeout(&a, timeout) { Ok(s) => { let _ = s.set_nodelay(true); @@ -318,3 +330,21 @@ impl Bucket { self.tokens = (self.tokens + n).min(self.burst); } } + +#[cfg(test)] +mod dial_tests { + use super::dialable; + use std::net::SocketAddr; + + #[test] + fn a_loopback_only_dial_skips_addresses_off_this_machine() { + let at = |s: &str| s.parse::().unwrap(); + for a in ["127.0.0.1:9", "[::1]:9", "127.5.5.5:9"] { + assert!(dialable(&at(a), true), "{a}"); + } + for a in ["10.0.0.5:9", "203.0.113.7:9", "[2001:db8::1]:9"] { + assert!(!dialable(&at(a), true), "{a}"); + assert!(dialable(&at(a), false), "{a} when anywhere is allowed"); + } + } +} diff --git a/crates/collab-net/src/requests.rs b/crates/collab-net/src/requests.rs index e9c63283c..a2c7f9439 100644 --- a/crates/collab-net/src/requests.rs +++ b/crates/collab-net/src/requests.rs @@ -32,6 +32,15 @@ pub(crate) fn server_key(given: Option, query: Vec<(String, String)>) -> given.or_else(|| query.into_iter().find(|(k, _)| k == "key").map(|(_, v)| v)).filter(|k| !k.trim().is_empty()) } +/// Refuse to send the server's key (its whole administrative authority, reusable) in the clear: +/// `ws://` is only for a server on this machine; anywhere else needs `wss://`. +pub(crate) fn key_over_tls(server: &Endpoint, key: Option<&str>) -> Result<(), String> { + if key.is_some_and(|k| !k.trim().is_empty()) && !server.secure && !server.loopback() { + return Err("the server's key is only sent over wss:// (or ws:// to this machine): it would be readable on the network".into()); + } + Ok(()) +} + /// Why asking `server` about its hosting failed with `e`: a server older than open hosting can't /// read the question. pub(crate) fn hosting_error(server: &Endpoint, e: String) -> String { @@ -145,3 +154,21 @@ pub(crate) fn hosted(server: &Endpoint, reply: Option) -> Option other, }) } + +#[cfg(test)] +mod key_tests { + use super::*; + + #[test] + fn the_key_never_goes_over_plain_tcp_to_another_machine() { + let at = |url: &str| Endpoint::parse(url).unwrap().0; + assert!(key_over_tls(&at("ws://share.example:9000/"), Some("k")).is_err()); + assert!(key_over_tls(&at("ws://10.0.0.5:9000/"), Some("k")).is_err()); + assert!(key_over_tls(&at("wss://share.example/"), Some("k")).is_ok()); + assert!(key_over_tls(&at("ws://127.0.0.1:9000/"), Some("k")).is_ok()); + assert!(key_over_tls(&at("ws://localhost:9000/"), Some("k")).is_ok()); + // Browsing or publishing as anyone sends no key, so plain is fine. + assert!(key_over_tls(&at("ws://share.example:9000/"), None).is_ok()); + assert!(key_over_tls(&at("ws://share.example:9000/"), Some(" ")).is_ok()); + } +} From 401f449729210e69029aac0af8852c1697f787d7 Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Wed, 11 Nov 2026 09:02:45 -0500 Subject: [PATCH 063/101] M8: zoom previews: scan system fonts before the zoom-preview tests render (#2230) pans_and_edits_get_no_preview_and_build_on_the_kept_image failed in full lib runs with "a pan after a previewed zoom renders strips only: Full". The render kept from the zoom is stale once the global font generation changes (retained.rs prepare: last.fonts == layout_generation()), and the once-per-process system font scan that many other tests start bumps it (fontdb.rs scan_system_fonts -> clear_layout_cache). When that scan landed between the test's zoom and its pan, the pan redrew in full instead of patching. Unrelated to the clock or the threshold. document() now runs scan_system_fonts() first (a concurrent caller waits for the scan), so the generation is settled before any render. Test-only change; the shipped staleness check is intended behaviour. Stress, full lib binary with 16 test threads: 3 of 6 runs failed before, 0 of 25 after. Model-Effort: Opus 5.5 drove; Opus 5.5 briefed; Sonnet 5.5 wrote at medium Co-authored-by: Claude Sonnet 5.5 --- crates/ui-egui/src/canvas/zoom_preview_tests.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/canvas/zoom_preview_tests.rs b/crates/ui-egui/src/canvas/zoom_preview_tests.rs index 62951f8bd..bb36c0aae 100644 --- a/crates/ui-egui/src/canvas/zoom_preview_tests.rs +++ b/crates/ui-egui/src/canvas/zoom_preview_tests.rs @@ -23,8 +23,12 @@ use crate::render_worker::{ Done, Inline, Job, PREVIEW_AFTER_MS, PREVIEW_FACTOR, Refined, Renders, SETTLE_MS, Worker, better, coarse_view, preview_with, render_now, }; -/// A page of ellipses with a rectangle on top; the session and the rectangle. +/// A page of ellipses with a rectangle on top; the session and the rectangle. The system fonts are +/// scanned first (once per process, and a concurrent caller waits for it): the scan another test +/// starts bumps the global font generation, and a render kept from before it is stale, so a pan +/// or an edit meanwhile would redraw in full instead of patching. fn document() -> (Session, NodeId) { + figcraft_text::scan_system_fonts(); let mut s = Session::new(); for k in 0..12 { let k = f64::from(k); From 9e815546ba1f51782bf2ef788e725f111a49c745 Mon Sep 17 00:00:00 2001 From: Pavel Ivanov Date: Wed, 11 Nov 2026 15:05:04 +0100 Subject: [PATCH 064/101] M8: switching back to a tab shows its page at once (#2075) * **No blank canvas** when switching back to a document tab or to a page in a file: the image it had when last shown is drawn from the first frame while it renders again * Images of up to four recently shown files and pages are kept; closing a tab frees its image right away Refs: #2074 --- crates/ui-egui/src/app.rs | 2 + crates/ui-egui/src/canvas.rs | 49 ++++++ crates/ui-egui/src/canvas/tab_switch_tests.rs | 159 ++++++++++++++++++ 3 files changed, 210 insertions(+) create mode 100644 crates/ui-egui/src/canvas/tab_switch_tests.rs diff --git a/crates/ui-egui/src/app.rs b/crates/ui-egui/src/app.rs index 0267dd769..45dc80f09 100644 --- a/crates/ui-egui/src/app.rs +++ b/crates/ui-egui/src/app.rs @@ -268,6 +268,8 @@ impl FigApp { return; } if !self.has_files() || self.ui.home { + let docs = &self.session.docs; + self.canvas.drop_closed(|uid| docs.iter().any(|d| d.uid == uid)); home::show(self, ui); // The shortcuts panel belongs to the canvas; it doesn't hang over the home screen // (cleared after the home widgets, which may have just asked for it). diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs index 251ff25e6..02d0415ff 100644 --- a/crates/ui-egui/src/canvas.rs +++ b/crates/ui-egui/src/canvas.rs @@ -57,6 +57,10 @@ pub struct CanvasState { pub tex_coarse: bool, /// The request the texture answers ([`crate::render_worker::Done::seq`]). tex_seq: u64, + /// Refined images of the files and pages shown before, newest first: switching back to one + /// shows its image at once while it renders again, instead of a blank canvas (and, where + /// renders are slow, a coarse preview). + kept: Vec, submitted: Option, /// The view of the last render asked for. want_view: Option, @@ -98,6 +102,7 @@ impl Default for CanvasState { tex_of: None, tex_coarse: false, tex_seq: 0, + kept: Vec::new(), submitted: None, want_view: None, render_work: None, @@ -119,6 +124,45 @@ impl Default for CanvasState { } } +/// At most this many images of files and pages not shown are kept (each is a canvas-sized texture). +const KEPT: usize = 4; + +/// A refined canvas image of a file and page not shown now ([`CanvasState::kept`]). +struct Kept { + texture: egui::TextureHandle, + view: figcraft_render::View, + of: (u64, NodeId), + seq: u64, +} + +impl CanvasState { + /// When the file or page shown is no longer the one the texture is of, set the texture aside + /// (if refined) and bring back the image kept for `shown`, if any. Images of files that are no + /// longer open (`open` says which are) are dropped every frame, not only on a switch: a + /// background tab can close while the file shown stays the same. + fn switch_texture(&mut self, shown: Option<(u64, NodeId)>, open: impl Fn(u64) -> bool) { + if shown.is_some() && self.tex_of != shown { + let back = self.kept.iter().position(|k| Some(k.of) == shown).map(|i| self.kept.remove(i)); + let (texture, view, of) = (self.texture.take(), self.tex_view.take(), self.tex_of.take()); + if let (Some(texture), Some(view), Some(of), false) = (texture, view, of, self.tex_coarse) { + self.kept.insert(0, Kept { texture, view, of, seq: self.tex_seq }); + } + self.tex_coarse = false; + if let Some(k) = back { + (self.texture, self.tex_view, self.tex_of, self.tex_seq) = (Some(k.texture), Some(k.view), Some(k.of), k.seq); + } + } + self.drop_closed(open); + self.kept.truncate(KEPT); + } + + /// Drop the kept images of files that are no longer open (`open` says which are). Home calls + /// this too: the canvas isn't shown there, and closing the last file leads to it. + pub(crate) fn drop_closed(&mut self, open: impl Fn(u64) -> bool) { + self.kept.retain(|k| open(k.of.0)); + } +} + /// What the canvas shows while an IME composition is in progress: the document with the /// composition inserted at the caret (the real document only gets it on commit). pub struct PreeditView { @@ -264,6 +308,8 @@ pub fn show(app: &mut FigApp, ui: &mut Ui, worker: &mut Worker) { // Every finished render is shown, even when a newer one is already on its way: renders finish // in order, and an edit every frame (a drag) would otherwise never show until it stopped. let shown = app.session.ds().map(|ds| (ds.uid, ds.page)).ok(); + let docs = &app.session.docs; + app.canvas.switch_texture(shown, |uid| docs.iter().any(|d| d.uid == uid)); if let Some(done) = worker.poll() && shows(&app.canvas, &done, shown) { @@ -408,3 +454,6 @@ mod wheel_zoom_tests; #[cfg(test)] mod zoom_preview_tests; + +#[cfg(test)] +mod tab_switch_tests; diff --git a/crates/ui-egui/src/canvas/tab_switch_tests.rs b/crates/ui-egui/src/canvas/tab_switch_tests.rs new file mode 100644 index 000000000..f5629d3ef --- /dev/null +++ b/crates/ui-egui/src/canvas/tab_switch_tests.rs @@ -0,0 +1,159 @@ +//! Switching tabs: the canvas shows the image a file had when it was last on screen from the first +//! frame back, instead of a blank page (and, where renders are slow, a coarse preview) while the +//! file renders again. + +use egui::{Pos2, RawInput, Rect, vec2}; +use figcraft_engine::Session; +use serde_json::json; + +use crate::idle_tests::wait_for_render; +use crate::{FigApp, NoServices}; + +/// The whole UI, driven headless, with files of their own names open. +struct Harness { + ctx: egui::Context, + app: FigApp, + time: f64, +} + +impl Harness { + /// The UI with a file named after each of `names` (each with a rectangle); the last is shown. + fn new(names: &[&str]) -> Self { + figcraft_text::scan_system_fonts(); + let mut s = Session::empty(); + for n in names { + s.execute("file.new", &json!({"name": n})).unwrap(); + s.execute("shape.rectangle", &json!({"x": 10, "y": 10, "width": 200, "height": 120})).unwrap(); + } + Self { ctx: egui::Context::default(), app: FigApp::new(s, Box::new(NoServices)), time: 0.0 } + } + + /// One frame with no input, 1/60 s after the last. + fn frame(&mut self) { + self.time += 1.0 / 60.0; + self.app.clock.set_test_now(Some(self.time)); + let input = RawInput { screen_rect: Some(Rect::from_min_size(Pos2::ZERO, vec2(1440.0, 900.0))), time: Some(self.time), ..Default::default() }; + let app = &mut self.app; + let mut out = self.ctx.run_ui(input, |ui| app.ui(ui)); + out.textures_delta.clear(); + } + + /// Frames until the canvas shows a refined image of the file and page on screen. + fn settle(&mut self) { + for _ in 0..200 { + self.frame(); + wait_for_render(&self.app); + let ds = self.app.session.ds().unwrap(); + let c = &self.app.canvas; + if c.tex_of == Some((ds.uid, ds.page)) && !c.tex_coarse && c.texture.is_some() { + return; + } + } + panic!("the canvas never showed a refined image"); + } + + /// Show the file named `name`, as clicking its tab does. + fn switch(&mut self, name: &str) { + let i = self.app.session.docs.iter().position(|d| d.doc.name == name).unwrap(); + self.app.run("doc.switch", json!({"index": i})); + } + + /// The file and page on screen. + fn shown(&self) -> (u64, figcraft_doc::NodeId) { + let ds = self.app.session.ds().unwrap(); + (ds.uid, ds.page) + } +} + +#[test] +fn switching_back_to_a_tab_shows_its_image_on_the_first_frame() { + let mut h = Harness::new(&["A", "B"]); + h.switch("A"); + h.settle(); + let a = (h.shown(), h.app.canvas.tex_seq, h.app.canvas.texture.as_ref().map(egui::TextureHandle::id)); + h.switch("B"); + h.settle(); + let b = (h.shown(), h.app.canvas.tex_seq); + assert_ne!(h.app.canvas.tex_of, Some(a.0)); + + // The image brought back is the one A had when it was last shown. Looked at without a frame: + // in one, a render of A asked for in it could already have come back and replaced it. + let c = &mut h.app.canvas; + c.switch_texture(Some(a.0), |_| true); + assert_eq!((c.tex_of, c.tex_seq, c.texture.as_ref().map(egui::TextureHandle::id)), (Some(a.0), a.1, a.2)); + c.switch_texture(Some(b.0), |_| true); + assert_eq!((c.tex_of, c.tex_seq), (Some(b.0), b.1), "B's image was kept in turn"); + + h.switch("A"); + h.frame(); + let c = &h.app.canvas; + assert_eq!(c.tex_of, Some(a.0), "A's image is on screen at once"); + assert!(!c.tex_coarse, "and it is the refined one, not a preview"); + assert!(c.kept.iter().any(|k| k.of == b.0), "B's image is kept in turn"); + h.settle(); +} + +#[test] +fn switching_back_to_a_page_shows_its_image_on_the_first_frame() { + let mut h = Harness::new(&["A"]); + h.settle(); + let first = (h.shown(), h.app.canvas.tex_seq, h.app.canvas.texture.as_ref().map(egui::TextureHandle::id)); + h.app.run("page.add", json!({})); + h.app.run("shape.ellipse", json!({"x": 40, "y": 40, "width": 120, "height": 120})); + h.settle(); + let second = (h.shown(), h.app.canvas.tex_seq); + assert_ne!(first.0, second.0); + + // Looked at without a frame, as for tabs: a render asked for in one could replace the image. + let c = &mut h.app.canvas; + c.switch_texture(Some(first.0), |_| true); + assert_eq!((c.tex_of, c.tex_seq, c.texture.as_ref().map(egui::TextureHandle::id)), (Some(first.0), first.1, first.2)); + c.switch_texture(Some(second.0), |_| true); + assert_eq!((c.tex_of, c.tex_seq), (Some(second.0), second.1), "the second page's image was kept in turn"); + + h.app.run("page.select", json!({"index": 0})); + h.frame(); + let c = &h.app.canvas; + assert_eq!(c.tex_of, Some(first.0), "the first page's image is on screen at once"); + assert!(!c.tex_coarse); + assert!(c.kept.iter().any(|k| k.of == second.0), "the second page's image is kept in turn"); + h.settle(); +} + +#[test] +fn kept_images_are_bounded_and_dropped_with_their_files() { + let names = ["A", "B", "C", "D", "E", "F", "G"]; + let mut h = Harness::new(&names); + for n in names { + h.switch(n); + h.settle(); + } + assert_eq!(h.app.canvas.kept.len(), super::KEPT); + + let f = h.app.session.docs.iter().position(|d| d.doc.name == "F").unwrap(); + let f_uid = h.app.session.docs[f].uid; + assert!(h.app.canvas.kept.iter().any(|k| k.of.0 == f_uid)); + // A tab closed in the background: the file shown stays the same. + let before = h.shown(); + h.app.run("file.close", json!({"index": f, "force": true})); + h.frame(); + assert_eq!(h.shown(), before); + assert!(h.app.canvas.kept.iter().all(|k| k.of.0 != f_uid), "a closed file's image goes"); +} + +#[test] +fn closing_the_last_file_drops_its_kept_images() { + let mut h = Harness::new(&["A", "B"]); + h.switch("A"); + h.settle(); + h.switch("B"); + h.settle(); + assert_eq!(h.app.canvas.kept.len(), 1, "A's image is kept"); + // Both close before the next frame, which then shows Home, not the canvas. + let a = h.app.session.docs.iter().position(|d| d.doc.name == "A").unwrap(); + h.app.run("file.close", json!({"index": a, "force": true})); + h.app.run("file.close", json!({"index": 0, "force": true})); + assert!(h.app.session.docs.is_empty()); + h.frame(); + assert!(h.app.canvas.kept.is_empty(), "no closed file's image stays behind Home"); +} From 2dd1b5a53a58c36c40ec8fb7d4d74a894675c208 Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Wed, 11 Nov 2026 09:32:21 -0500 Subject: [PATCH 065/101] Menus: the main menu and its submenus stay inside the window and scroll when taller (#2217) (#2220) Submenus of the main menu were not constrained to the window (constrain: false, so they sit beside their row), so the Object submenu ran past the bottom edge with its lowest commands out of reach. Menus and submenus are now held within the window's height (moved up, never above the top, 8 pt margins, still beside their row so menu-aim is unchanged), and a panel taller than that scrolls with the wheel; the keyboard's focus scrolls into view. Model-Effort: Opus 5.5 drove; Opus 5.5 briefed; Sonnet 5.5 wrote at medium Co-authored-by: Claude Sonnet 5.5 --- crates/ui-egui/src/lib.rs | 2 + crates/ui-egui/src/menu_overflow_tests.rs | 107 ++++++++++++++++++++++ crates/ui-egui/src/menus.rs | 71 +++++++------- crates/ui-egui/src/menus/tree.rs | 57 +++++++++++- docs/ui-parity.md | 5 +- 5 files changed, 207 insertions(+), 35 deletions(-) create mode 100644 crates/ui-egui/src/menu_overflow_tests.rs diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 60c68f526..1c87b5660 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -180,6 +180,8 @@ mod menu_contrast_tests; #[cfg(test)] mod menu_input_tests; #[cfg(test)] +mod menu_overflow_tests; +#[cfg(test)] mod mirror_tests; #[cfg(test)] mod missing_fonts_tests; diff --git a/crates/ui-egui/src/menu_overflow_tests.rs b/crates/ui-egui/src/menu_overflow_tests.rs new file mode 100644 index 000000000..5cb2885b6 --- /dev/null +++ b/crates/ui-egui/src/menu_overflow_tests.rs @@ -0,0 +1,107 @@ +//! The main menu and its submenus stay inside the window (#2217): a submenu that would run past +//! the bottom moves up to fit, and one taller than the window scrolls. + +use egui::{Event, Id, MouseWheelUnit, Rect, TouchPhase, pos2, vec2}; +use figcraft_engine::Session; +use serde_json::json; + +use crate::layers_drag_tests::Ui; +use crate::live_tests::{flat, text_center}; +use crate::menus::{HOVER_DELAY, main_menu_id}; +use crate::present_tests::id; + +/// A window `h` tall with the main menu open and the Object submenu showing. +fn object_menu_open(s: Session, h: f32) -> Ui { + let mut u = Ui::new(s); + u.screen = vec2(1280.0, h); + u.app.ui.main_menu = true; + u.frame(vec![Event::PointerMoved(pos2(1000.0, 10.0))]); + u.frame(vec![]); + let m = u.ctx.memory(|m| m.area_rect(main_menu_id())).expect("main menu drawn"); + // Frame margin, the Actions row and the space under it, then three rows down to Object. + let y = m.min.y + 8.0 + 30.0 + 6.0 + 28.0 * 3.0 + 14.0; + u.frame(vec![Event::PointerMoved(pos2(m.min.x + 60.0, y))]); + for _ in 0..((HOVER_DELAY + 0.3) * 60.0) as usize { + u.frame(vec![]); + } + u +} + +fn object_panel(u: &Ui) -> Rect { + u.ctx.memory(|m| m.area_rect(Id::unique(("menu", "Object")))).expect("the Object submenu is drawn") +} + +#[test] +fn the_object_submenu_stays_inside_a_short_window() { + let u = object_menu_open(Session::new(), 600.0); + let panel = object_panel(&u); + let window = Rect::from_min_size(pos2(0.0, 0.0), vec2(1280.0, 600.0)); + assert!(window.contains_rect(panel), "the Object submenu {panel:?} runs outside the window {window:?}"); +} + +#[test] +fn a_menu_taller_than_the_window_scrolls_to_its_last_command() { + let mut s = Session::new(); + let a = id(&s.execute("shape.rectangle", &json!({"x": 0, "y": 0, "width": 40, "height": 30})).unwrap()); + let b = id(&s.execute("shape.rectangle", &json!({"x": 100, "y": 30, "width": 20, "height": 20})).unwrap()); + s.execute("select.set", &json!({"ids": [b]})).unwrap(); + let mut u = object_menu_open(s, 420.0); + let panel = object_panel(&u); + assert!(Rect::from_min_size(pos2(0.0, 0.0), vec2(1280.0, 420.0)).contains_rect(panel), "{panel:?} outside the window"); + // Turn the wheel over the panel until the end of the list is in view. + for _ in 0..4 { + let wheel = Event::MouseWheel { + unit: MouseWheelUnit::Point, + source: egui::MouseWheelSource::Unknown, + delta: vec2(0.0, -1500.0), + phase: TouchPhase::Move, + modifiers: Default::default(), + }; + u.frame(vec![Event::PointerMoved(panel.center()), wheel]); + for _ in 0..20 { + u.frame(vec![]); + } + } + let shapes = flat(&u.frame_output(vec![]).shapes); + let at = text_center(&shapes, "Move to page"); + assert!(panel.contains(at), "the last commands are out of reach: at {at:?} outside {panel:?}"); + // And a command above it, reached by scrolling back up, runs on click. + let wheel = Event::MouseWheel { + unit: MouseWheelUnit::Point, + source: egui::MouseWheelSource::Unknown, + delta: vec2(0.0, 1.0e5), + phase: TouchPhase::Move, + modifiers: Default::default(), + }; + u.frame(vec![Event::PointerMoved(panel.center()), wheel]); + for _ in 0..20 { + u.frame(vec![]); + } + // Scroll down in small steps until "Send to back" shows inside the panel, then click it. + let mut hit = None; + for _ in 0..40 { + let shapes = flat(&u.frame_output(vec![]).shapes); + let at = text_center(&shapes, "Send to back"); + if panel.contains(at) { + hit = Some(at); + break; + } + let wheel = Event::MouseWheel { + unit: MouseWheelUnit::Point, + source: egui::MouseWheelSource::Unknown, + delta: vec2(0.0, -120.0), + phase: TouchPhase::Move, + modifiers: Default::default(), + }; + u.frame(vec![Event::PointerMoved(panel.center()), wheel]); + for _ in 0..10 { + u.frame(vec![]); + } + } + let at = hit.expect("Send to back scrolls into view"); + crate::component_swap_default_tests::click(&mut u, at); + let doc = u.app.session.doc().unwrap(); + let page = u.app.session.page().unwrap(); + let kids = &doc.node(page).unwrap().children; + assert_eq!((kids.first().copied(), kids.last().copied()), (Some(b), Some(a)), "Send to back ran"); +} diff --git a/crates/ui-egui/src/menus.rs b/crates/ui-egui/src/menus.rs index a5361778c..c9c197a50 100644 --- a/crates/ui-egui/src/menus.rs +++ b/crates/ui-egui/src/menus.rs @@ -382,40 +382,49 @@ pub fn popups(app: &mut FigApp, ctx: &egui::Context) { // Main menu. if app.ui.main_menu { let mut close = false; - let area = egui::Area::new(main_menu_id()).fixed_pos(pos2(8.0, crate::tabs::HEIGHT + 48.0)).order(egui::Order::Foreground).show(ctx, |ui| { - menu_frame(ui, &t, At { root: main_menu_id(), path: String::new() }, |ui| { - // Quick actions search row. - let (r, resp) = ui.allocate_exact_size(vec2(ui.available_width(), 30.0), Sense::click()); - plain_row_hover(ui, &resp); - a11y::menu_item(&resp, tr("Actions…"), crate::shortcuts::shortcut("app.actions").unwrap_or(""), None); - ui.painter().rect_filled(r.shrink(2.0), CornerRadius::same(5), Color32::from_white_alpha(18)); - icons::paint(ui.painter(), Rect::from_center_size(pos2(r.min.x + 16.0, r.center().y), vec2(14.0, 14.0)), Icon::Search, t.menu_dim); - ui.painter().text(pos2(r.min.x + 32.0, r.center().y), Align2::LEFT_CENTER, tr("Actions…"), regular(12.0), t.menu_dim); - ui.painter().text( - pos2(r.max.x - 10.0, r.center().y), - Align2::RIGHT_CENTER, - pretty_shortcut(crate::shortcuts::shortcut("app.actions").unwrap_or("")), - regular(12.0), - t.menu_dim, - ); - if resp.clicked() { - set_palette(&mut app.ui, true); - close = true; - } - ui.add_space(6.0); - for top in TOP_MENUS { - if submenu_at( - ui, - SubmenuOptions { area: Id::unique(("menu", *top)), key: top, label: tr(top), gap: 12.0, constrain: false, tokens: &t }, - |ui| menu_level(app, ui, top).then_some(()), - ) - .is_some() - { + let area = egui::Area::new(main_menu_id()) + .fixed_pos(pos2(8.0, crate::tabs::HEIGHT + 48.0)) + .order(egui::Order::Foreground) + .constrain_to(tree::vertical_bounds(ctx)) + .show(ctx, |ui| { + menu_frame(ui, &t, At { root: main_menu_id(), path: String::new() }, |ui| { + // Quick actions search row. + let (r, resp) = ui.allocate_exact_size(vec2(ui.available_width(), 30.0), Sense::click()); + plain_row_hover(ui, &resp); + a11y::menu_item(&resp, tr("Actions…"), crate::shortcuts::shortcut("app.actions").unwrap_or(""), None); + ui.painter().rect_filled(r.shrink(2.0), CornerRadius::same(5), Color32::from_white_alpha(18)); + icons::paint( + ui.painter(), + Rect::from_center_size(pos2(r.min.x + 16.0, r.center().y), vec2(14.0, 14.0)), + Icon::Search, + t.menu_dim, + ); + ui.painter().text(pos2(r.min.x + 32.0, r.center().y), Align2::LEFT_CENTER, tr("Actions…"), regular(12.0), t.menu_dim); + ui.painter().text( + pos2(r.max.x - 10.0, r.center().y), + Align2::RIGHT_CENTER, + pretty_shortcut(crate::shortcuts::shortcut("app.actions").unwrap_or("")), + regular(12.0), + t.menu_dim, + ); + if resp.clicked() { + set_palette(&mut app.ui, true); close = true; } - } + ui.add_space(6.0); + for top in TOP_MENUS { + if submenu_at( + ui, + SubmenuOptions { area: Id::unique(("menu", *top)), key: top, label: tr(top), gap: 12.0, constrain: false, tokens: &t }, + |ui| menu_level(app, ui, top).then_some(()), + ) + .is_some() + { + close = true; + } + } + }); }); - }); let clicked_outside = ctx.input(|i| i.pointer.any_pressed()) && !over_menu(ctx) || ctx.input(|i| i.key_pressed(egui::Key::Escape)); if close || (clicked_outside && !area.response.hovered()) { app.ui.main_menu = false; diff --git a/crates/ui-egui/src/menus/tree.rs b/crates/ui-egui/src/menus/tree.rs index f0c645509..17ab9eb76 100644 --- a/crates/ui-egui/src/menus/tree.rs +++ b/crates/ui-egui/src/menus/tree.rs @@ -289,6 +289,7 @@ pub(super) fn submenu_at(ui: &mut Ui, options: SubmenuOptions<'_>, add: impl .fixed_pos(pos) .order(egui::Order::Foreground) .constrain(constrain || cramped) + .constrain_to(if constrain || cramped { screen } else { vertical_bounds(ui.ctx()) }) .show(ui.ctx(), |ui| menu_frame(ui, t, child, add)); let panel = shown.response.rect; with_level(ui.ctx(), &at, |l| l.panel = Some(panel)); @@ -316,12 +317,64 @@ pub(super) fn menu_frame(ui: &mut Ui, t: &Tokens, at: At, add: impl FnOnce(&m ui.set_width(w); ui.spacing_mut().item_spacing = vec2(0.0, 0.0); let key = at_key(ui); - ui.data_mut(|d| d.insert_temp(key, at)); - add(ui) + ui.data_mut(|d| d.insert_temp(key, at.clone())); + // Taller than the window (as measured last frame): its rows scroll. Otherwise they + // draw straight into the panel, so a menu that fits behaves as it always did. + let max_h = (ui.ctx().content_rect().height() - 2.0 * EDGE_MARGIN - 16.0).max(MENU_ROW_H); + let height_key = at_key(ui).with("content_h"); + let last_h = ui.data(|d| d.get_temp::(height_key)).unwrap_or(0.0); + if last_h <= max_h { + let top = ui.cursor().min.y; + let r = add(ui); + let h = ui.min_rect().max.y - top; + ui.data_mut(|d| d.insert_temp(height_key, h)); + if h > max_h { + ui.ctx().request_repaint(); + } + return r; + } + // The scroll area's ui has its own scope, so it gets the level and width state of this + // one, and hands back the width its rows asked for. + let outer_w = width_key(ui); + let asked = ui.data(|d| d.get_temp::(outer_w)); + let shown = egui::ScrollArea::vertical() + .max_height(max_h) + .auto_shrink([false, true]) + .scroll_source(egui::scroll_area::ScrollSource::MOUSE_WHEEL | egui::scroll_area::ScrollSource::SCROLL_BAR) + .show(ui, |ui| { + let (inner_at, inner_w) = (at_key(ui), width_key(ui)); + ui.data_mut(|d| { + d.insert_temp(inner_at, at); + if let Some(a) = asked { + d.insert_temp(inner_w, a); + } + }); + let r = add(ui); + (r, ui.data(|d| d.get_temp::(inner_w))) + }); + ui.data_mut(|d| d.insert_temp(height_key, shown.content_size.y)); + let (r, wanted) = shown.inner; + if let Some(wanted) = wanted.filter(|w| asked.is_none_or(|a| *w > a)) { + ui.data_mut(|d| d.insert_temp(outer_w, wanted)); + } + r }) .inner } +/// The gap a menu keeps from the window's top and bottom edges. +pub(super) const EDGE_MARGIN: f32 = 8.0; + +/// A menu row's height. +const MENU_ROW_H: f32 = 28.0; + +/// Where a menu may sit: anywhere across, within the window's height less the margins. A menu that +/// would run past the bottom moves up (never above the top); one taller than that scrolls. +pub(super) fn vertical_bounds(ctx: &egui::Context) -> Rect { + let s = ctx.content_rect(); + Rect::from_min_max(pos2(-1.0e5, s.min.y + EDGE_MARGIN), pos2(1.0e5, s.max.y - EDGE_MARGIN)) +} + /// A menu's narrowest width. const MENU_W: f32 = 240.0; diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 463be3b47..4c684c81b 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -1,6 +1,6 @@ # UI and interaction parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-04 · **Change:** minor (the left rail's and tab strip's icons are larger, 20 pt (#553); pick select: Tab while the keyboard selection box shows (or the chord again) puts a pink outline on a layer and the keys walk the layer tree from it, as Accessibility at Figma says (#1836); scrubbing a field faster or slower by the pointer's height, with a notice of the speed, as the help center's Scrub fields says (#1837); component rows in the Layers panel at AA contrast in the theme's component tint, with the rows inside a selected component in a tone of its row (#1903); Cmd/Ctrl-click on a padding field sets all four sides with the value typed, a documented auto layout shortcut; a fill per region of a vector: with regions selected in edit mode, the Fill section and the fill commands edit those regions' own fills, as Edit vector layers says (#1875); the Fill section of a text whose characters were coloured differently while editing shows mixed content, characters that all share fills the layer doesn't have show those, and a layer-level fill edit reaches every character (#1856); a number field scrubs when dragged with Alt held, as the help center's scrub section says, not only by its label; reuse visible layer selection roots (M8); ; with a shape or frame tool chosen and nothing selected, the arrows show a placement crosshair in the middle of the view and move it, and Enter places there, as Accessibility at Figma says (#1839); text direction per paragraph: Text ▸ Text direction forces a paragraph left to right or right to left, as Add right-to-left text says (#1830), with `text.direction`, `node.set textDirection`, the Type settings control once a right-to-left script is in the text, inspect, the CSS `direction` and the `.fig` lines' `sourceDirectionality`; the boolean operation menu in the Design panel leads each entry with an original icon drawn in code, a filled preview of the result (#2003); a press on the open gradient's handles or stops on the canvas keeps the colour picker open through the drag, as its own control (#1852); a click with the Bend tool on a sharp point curves it, its handles along the line between its neighbours, as Edit vector layers says (#1875); wrap style: Auto, Balance and Pretty on a text layer decide where its lines break, as Explore text properties says (#1827), with the Type settings control, `text.wrapStyle`, `node.set wrapStyle`, inspect and the CSS `text-wrap`; Backspace or Delete at the start of a list item keeps the item's indentation level, as the lists article says; max lines on auto-width text keep it auto width, hugging that many lines, as the text properties article says; superscript and subscript are synthesised where the font has no glyphs for them, from the standard glyphs shrunk and shifted by the font's OS/2 metrics, and a run mixing available and unavailable glyphs is synthesised whole, as Explore text properties says (#1828); Alt+Enter while editing text opens the link at the caret, as the accessibility page documents; Minimize, by its shortcut or the button by the file name, collapses the navigation bar and both sidebars as the help center says, with the right sidebar back while something is selected (#1835); the interface size keys of the help center's accessibility page: Cmd/Ctrl+Shift+Alt with =, - and 0 step the interface through the Preferences sizes and back to the system's size; Cmd/Ctrl+Alt+arrows rotate the selection a degree at a time, 15 with Shift, as the help center's accessibility page says; they resized before; the Layers panel answers Ctrl+1 as well as Alt+1 on Windows and Linux, the two keys the help center gives it; 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 keyboard's Menu key opens the context menu, as Shift+F10 does; the eyedropper with Cmd/Ctrl+Shift makes a colour style or variable of what it picks; sidebar number and text fields keep their text vertically centered when focused, including typography spacing; 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); 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); Preferences ▸ Scroll wheel zoom: a mouse wheel zooms the canvas about the pointer and Cmd/Ctrl+wheel scrolls (#1390); boolean operations refuse input past their caps, and a boolean group past them draws without its result (#1104); the selection and hover outlines of rounded rectangles and frames follow their corners (#1506); colour picker review fixes for text undo, fitted sidebars, moving controls and gradient variables; Corner smoothing: an original icon and the shared number-field drag gesture, preserving fractional baselines; guides snap to layers when dragged; Crop image: Object ▸ Crop image, the right-click menu and the image fill row enter crop mode (`image.crop`, #1464); the Design panel's sections on one grid — 16 / 8 margins, 88 + 8 + 88 + 8 + 24 columns, 24 pt rows, 4 pt between a row's buttons (#858); the toolbar on one 32 pt grid, without its Resources button (#1210); colour picker LCH and OKLCH models; an XML (Android Vector Drawable) export format; Context menus: the Menu key reaches egui 0.37 but is unbound (row done → partial); the Text on a path tool; board tool keys pinned; community fixes: the text box by dragging, the font picker keys, the pen path on leaving Design, a still canvas in vector edit mode, a scrolling pages list, colour emoji, readable new text in frames, system theme on first run; the Small caps sample in Type settings drawn from capitals; recent files as cards; vector edit mode: hovering, hatching, selecting and dragging filled regions; home screen: Templates tab, first-run templates and Getting started tips; number fields: scrub rates, arrow steps, arithmetic with brackets, relative edits of mixed values; outline mode's hidden layers and object bounds; Hide when publishing; cursors per tool and modifier; panel widths; dark pages for files made in the dark theme; drag threshold and double-clicks into text in groups; rotation origin on Alt+R and placing with Enter: no documented shortcut missing; keyboard shortcut parity suite and bindings; cursor chat and spotlight in live sessions; layers and assets panels behaviour suite and fixes; vector multi-edit and the vector edit tail; canvas navigation, guides and grids behaviour suite and fixes; shapes and vector behaviour suite and fixes; paint and effects behaviour suite and fixes; frames, groups, sections and masks behaviour suite and fixes; layers panel keyboard: F2 rename, Shift+F10 context menu, F8 box selection; selection and transform behaviour suite and fixes; Display P3: gamut warning and soft-proof (true P3 blocked upstream); several windows; boolean hit testing on the result, group drags, frame outlines and slices; outlines for the selection, mask outlines; arc fields, live boolean editing, shape builder on strokes, one-sided widths; fields select their text on focus; Typography spacing icons support scrubbing (#373); CSS colour names in hex fields; a rename selects the whole name, so typing replaces it; Escape or Enter after a pen path stays on the same vector (#760); IME composition kept on through idle frames of a text edit, candidates at the caret (#747); Selection colors for mixed selections and smart-selection spacing (#753); submenus with a hover delay and a safe triangle; the Actions palette's tabs, ranked search, highlight and recents; menu items that ask for a value; editor fixes from the community batches) · **Target:** Figma Design UI3 (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-10 · **Change:** minor (the main menu and its submenus stay inside the window, moving up to fit and scrolling when taller (#2217); the left rail's and tab strip's icons are larger, 20 pt (#553); pick select: Tab while the keyboard selection box shows (or the chord again) puts a pink outline on a layer and the keys walk the layer tree from it, as Accessibility at Figma says (#1836); scrubbing a field faster or slower by the pointer's height, with a notice of the speed, as the help center's Scrub fields says (#1837); component rows in the Layers panel at AA contrast in the theme's component tint, with the rows inside a selected component in a tone of its row (#1903); Cmd/Ctrl-click on a padding field sets all four sides with the value typed, a documented auto layout shortcut; a fill per region of a vector: with regions selected in edit mode, the Fill section and the fill commands edit those regions' own fills, as Edit vector layers says (#1875); the Fill section of a text whose characters were coloured differently while editing shows mixed content, characters that all share fills the layer doesn't have show those, and a layer-level fill edit reaches every character (#1856); a number field scrubs when dragged with Alt held, as the help center's scrub section says, not only by its label; reuse visible layer selection roots (M8); ; with a shape or frame tool chosen and nothing selected, the arrows show a placement crosshair in the middle of the view and move it, and Enter places there, as Accessibility at Figma says (#1839); text direction per paragraph: Text ▸ Text direction forces a paragraph left to right or right to left, as Add right-to-left text says (#1830), with `text.direction`, `node.set textDirection`, the Type settings control once a right-to-left script is in the text, inspect, the CSS `direction` and the `.fig` lines' `sourceDirectionality`; the boolean operation menu in the Design panel leads each entry with an original icon drawn in code, a filled preview of the result (#2003); a press on the open gradient's handles or stops on the canvas keeps the colour picker open through the drag, as its own control (#1852); a click with the Bend tool on a sharp point curves it, its handles along the line between its neighbours, as Edit vector layers says (#1875); wrap style: Auto, Balance and Pretty on a text layer decide where its lines break, as Explore text properties says (#1827), with the Type settings control, `text.wrapStyle`, `node.set wrapStyle`, inspect and the CSS `text-wrap`; Backspace or Delete at the start of a list item keeps the item's indentation level, as the lists article says; max lines on auto-width text keep it auto width, hugging that many lines, as the text properties article says; superscript and subscript are synthesised where the font has no glyphs for them, from the standard glyphs shrunk and shifted by the font's OS/2 metrics, and a run mixing available and unavailable glyphs is synthesised whole, as Explore text properties says (#1828); Alt+Enter while editing text opens the link at the caret, as the accessibility page documents; Minimize, by its shortcut or the button by the file name, collapses the navigation bar and both sidebars as the help center says, with the right sidebar back while something is selected (#1835); the interface size keys of the help center's accessibility page: Cmd/Ctrl+Shift+Alt with =, - and 0 step the interface through the Preferences sizes and back to the system's size; Cmd/Ctrl+Alt+arrows rotate the selection a degree at a time, 15 with Shift, as the help center's accessibility page says; they resized before; the Layers panel answers Ctrl+1 as well as Alt+1 on Windows and Linux, the two keys the help center gives it; 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 keyboard's Menu key opens the context menu, as Shift+F10 does; the eyedropper with Cmd/Ctrl+Shift makes a colour style or variable of what it picks; sidebar number and text fields keep their text vertically centered when focused, including typography spacing; 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); 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); Preferences ▸ Scroll wheel zoom: a mouse wheel zooms the canvas about the pointer and Cmd/Ctrl+wheel scrolls (#1390); boolean operations refuse input past their caps, and a boolean group past them draws without its result (#1104); the selection and hover outlines of rounded rectangles and frames follow their corners (#1506); colour picker review fixes for text undo, fitted sidebars, moving controls and gradient variables; Corner smoothing: an original icon and the shared number-field drag gesture, preserving fractional baselines; guides snap to layers when dragged; Crop image: Object ▸ Crop image, the right-click menu and the image fill row enter crop mode (`image.crop`, #1464); the Design panel's sections on one grid — 16 / 8 margins, 88 + 8 + 88 + 8 + 24 columns, 24 pt rows, 4 pt between a row's buttons (#858); the toolbar on one 32 pt grid, without its Resources button (#1210); colour picker LCH and OKLCH models; an XML (Android Vector Drawable) export format; Context menus: the Menu key reaches egui 0.37 but is unbound (row done → partial); the Text on a path tool; board tool keys pinned; community fixes: the text box by dragging, the font picker keys, the pen path on leaving Design, a still canvas in vector edit mode, a scrolling pages list, colour emoji, readable new text in frames, system theme on first run; the Small caps sample in Type settings drawn from capitals; recent files as cards; vector edit mode: hovering, hatching, selecting and dragging filled regions; home screen: Templates tab, first-run templates and Getting started tips; number fields: scrub rates, arrow steps, arithmetic with brackets, relative edits of mixed values; outline mode's hidden layers and object bounds; Hide when publishing; cursors per tool and modifier; panel widths; dark pages for files made in the dark theme; drag threshold and double-clicks into text in groups; rotation origin on Alt+R and placing with Enter: no documented shortcut missing; keyboard shortcut parity suite and bindings; cursor chat and spotlight in live sessions; layers and assets panels behaviour suite and fixes; vector multi-edit and the vector edit tail; canvas navigation, guides and grids behaviour suite and fixes; shapes and vector behaviour suite and fixes; paint and effects behaviour suite and fixes; frames, groups, sections and masks behaviour suite and fixes; layers panel keyboard: F2 rename, Shift+F10 context menu, F8 box selection; selection and transform behaviour suite and fixes; Display P3: gamut warning and soft-proof (true P3 blocked upstream); several windows; boolean hit testing on the result, group drags, frame outlines and slices; outlines for the selection, mask outlines; arc fields, live boolean editing, shape builder on strokes, one-sided widths; fields select their text on focus; Typography spacing icons support scrubbing (#373); CSS colour names in hex fields; a rename selects the whole name, so typing replaces it; Escape or Enter after a pen path stays on the same vector (#760); IME composition kept on through idle frames of a text edit, candidates at the caret (#747); Selection colors for mixed selections and smart-selection spacing (#753); submenus with a hover delay and a safe triangle; the Actions palette's tabs, ranked search, highlight and recents; menu items that ask for a value; editor fixes from the community batches) · **Target:** Figma Design UI3 (desktop app 126.10.7) Fine canvas control is what Figma users feel first: handles, snapping, nudging, modifier keys, drag behaviour, numeric precision. This checklist covers the tools, gestures and panels. Status: @@ -25,7 +25,7 @@ interaction feel not yet compared. | Actions palette (Cmd+K, Cmd+/) | done | tabs: All (every command, grouped by menu, or Other; a command that needs parameters only through its menu item, and none twice under one label, #1574), Assets (components and styles) and Plugins & widgets; results ranked prefix first, then shortest, at most 60 rows; Up/Down move a highlight and Enter runs it; Recents list what was run from the palette (matching translated labels); one open/toggle path from every entry point (`palette_tests`). Ranking and the Assets results not compared with Figma's | | Context menus | done | canvas and layers; submenus as in the main menu below, and a right-click in a new spot starts a fresh menu (Select layer closed); Shift+F10 or the keyboard's Menu key opens them from the keyboard (at the focused layer row or below the canvas selection) and the menu takes the keyboard (`layers_keyboard_tests`) | | Home screen: Recents, Online and Templates | done (ours) | The sidebar switches between the three (`ui.set {homeSection}`). Online: your online files (see the collaboration checklist). Recents: new file, open, join with a code, open files, recent files (cards with the picture each file carries on its page colour, the file's icon, name and "Edited ... ago" or "File not found", full path on hover; or a Name, Last modified and Created table with sortable headers; sorted by name, creation or last change either way; grid or list and the sort kept in the preferences, `ui.set {homeRecentsView, homeRecentsSort, homeRecentsOrder}`; a click selects, a double-click or Enter opens, arrow keys move the selection; Open, Show in folder and Remove from recents on right-click), a Getting started card (six tips with their shortcuts from the keymap; its close button is remembered in the preferences and Help ▸ Getting started brings it back) and, while there are no recent files, four templates to start from. Templates: the eight starter templates as cards (thumbnail rendered from the document, cached per theme; name, description, kind and size), a search field and a kind filter, an empty state; Tab reaches every card and Enter opens it; cards and tabs are named for screen readers. A first run opens here. No Community files or drafts folder | -| Main menu from the logo | done | generated from `catalog.rs`; popups sized to content. Submenus open after 0.15 s on their row (a click or the keyboard opens one at once) and close at once when another row is hovered; while the pointer heads for an open submenu inside the triangle to its near edge, the rows it crosses don't take over, and resting 0.3 s on one hands over; closing the menu, however it closes, clears which submenus were open, so it reopens with none (`menu_aim_tests`, 10 tests; timings tuned by feel, not measured against Figma). Menu and palette items that need a value ask for it first: Create link, Offset path and Move to page in a dialog of the shared controls, the language, user name, server and nudge items in Preferences, Open recent on the home screen's Recents; File ▸ Rename edits the file name in place | +| Main menu from the logo | done | generated from `catalog.rs`; popups sized to content. Submenus open after 0.15 s on their row (a click or the keyboard opens one at once) and close at once when another row is hovered; while the pointer heads for an open submenu inside the triangle to its near edge, the rows it crosses don't take over, and resting 0.3 s on one hands over; closing the menu, however it closes, clears which submenus were open, so it reopens with none (`menu_aim_tests`, 10 tests; timings tuned by feel, not measured against Figma). A menu or submenu that would run past the window's bottom moves up to fit (never above the top), and one taller than the window scrolls with the wheel, the keyboard's focus kept in view; the context menu's submenus share this (#2217, `menu_overflow_tests`). Menu and palette items that need a value ask for it first: Create link, Offset path and Move to page in a dialog of the shared controls, the language, user name, server and nudge items in Preferences, Open recent on the home screen's Recents; File ▸ Rename edits the file name in place | | Keyboard shortcuts panel | done | closes when the home screen shows (#548); docked, tabbed by group like the documentation, searchable, per-platform keycaps; held keys, gestures and presentation keys listed beside the bindings; a label too long for its column ends with "…" and shows in full on hover | | Several windows | partial | File ▸ New window, Open in new window on a tab, a tab dragged off the strip; screen-reader tree in the main window only; positions not restored | | Multiplayer avatars, Share button | missing | waits for multiplayer | @@ -187,6 +187,7 @@ in the table. `crates/ui-egui/src/shortcut_keys_tests.rs` drives the keys a look | Date | Change | Summary | |---|---|---| +| 2026-11-10 | patch | #2217: the main menu's submenus (Object, say) ran past the window's bottom, behind the taskbar, with the lowest commands out of reach, because submenus were not constrained to the window (to keep them beside their row). Every menu panel now scrolls when taller than the window less 8 pt margins, and a submenu is held within the window's height (moved up, never above the top) while keeping its place beside its row, so menu-aim is unchanged. Tests: `menu_overflow_tests.rs`. Numbers unchanged. | | 2026-11-02 | patch | Shortcuts: a Cmd/Ctrl-click on a padding field (the horizontal or vertical pair, or a side with Individual padding open) makes the value typed go to all four sides, in one undo step (Guide to auto layout, Keyboard shortcut guide); a plain click still edits that axis or side alone. A documented gesture row: 134 documented, 133 bound. Test: `padding_individual_tests` | | 2026-11-01 | patch | Number fields: dragging the field itself with Alt held scrubs it ("You can also hover the input field itself and hold down the modifier key: Mac: ⌥ Option Windows: Alt", Adjust alignment, rotation, position, and dimensions), with the resize cursor and the label's rates (Alt is the enabler there, so it isn't the fine rate); a click with Alt doesn't open the editor. Found by a documentation audit of the ui-parity rows. Test: `field_tests::alt_held_over_a_field_scrubs_it`. Counts unchanged | | 2026-11-02 | patch | M6, #1839: with a shape or frame tool chosen and nothing selected, the arrows show a placement crosshair in the middle of the view and move it by the nudge amounts (`tool.crosshair`), Enter places the object there (`tool.place`), Escape or a tool change takes it away; the canvas draws the crosshair and `ui.inspect` reports it (`tool.crosshair`), the Keyboard shortcuts panel lists the gesture ("Use the arrow keys to activate the crosshair cursor...", Accessibility at Figma). The board Shapes tool places on it too (its 160 px shape centred, as the tool centres a press), and the view pans by the overshoot when the crosshair is nudged past its edge. Tests: `place_crosshair_tests`, `shortcut_keys_tests::arrows_show_and_move_the_placement_crosshair_with_a_shape_tool`. | From 7bf098d75d187416633d9ebcceb9eb83fbb10df8 Mon Sep 17 00:00:00 2001 From: rumangerst Date: Wed, 11 Nov 2026 15:37:20 +0100 Subject: [PATCH 066/101] fix(ui): paste uses the event's clipboard text instead of re-reading it (#2021) (#2243) The paste handler read the system clipboard synchronously (2 s timeout) even though the paste event already carries that text, and discarded the read's result. On the desktop, the clipboard bridge delivers `event_text` that it read while the window thread was free; re-reading from the paste handler blocks that same window thread - and when the app itself owns the clipboard (a self-paste), its own data source can only be served by that very thread, so every self-paste froze the window for the full 2 s read timeout on Linux/Wayland. Prefer the event's text and only fall back to the synchronous read when the platform handed over none (chords, image-only clipboard, context-menu paste). A regression test pins that a paste event carrying text never triggers the synchronous read. --- crates/ui-egui/src/menus/clipboard.rs | 14 +++++-- crates/ui-egui/src/web_clipboard_tests.rs | 49 +++++++++++++++++++++++ 2 files changed, 60 insertions(+), 3 deletions(-) diff --git a/crates/ui-egui/src/menus/clipboard.rs b/crates/ui-egui/src/menus/clipboard.rs index bae7aaca9..bd7020150 100644 --- a/crates/ui-egui/src/menus/clipboard.rs +++ b/crates/ui-egui/src/menus/clipboard.rs @@ -7,8 +7,8 @@ use crate::i18n::trf; /// Paste: the system clipboard wins when it holds something newer than our own copy (layers copied /// from another design app, an image, SVG or text from another app); otherwise our copied layers. /// `event_text` is the text the platform handed over with the paste event (the browser has no -/// other way to read it). `at`: the page point to paste at (Paste here); `None` pastes in the -/// middle of the view. +/// other way to read it; the desktop's clipboard bridge has already read it). `at`: the page +/// point to paste at (Paste here); `None` pastes in the middle of the view. /// In Dev Mode only a comment's link pastes (it opens the thread); everything else would edit. pub fn paste(app: &mut FigApp, event_text: Option<&str>, at: Option<(f64, f64)>) { // A gesture injected through the control channel pastes only our own copied layers: it must not @@ -47,7 +47,15 @@ pub fn paste(app: &mut FigApp, event_text: Option<&str>, at: Option<(f64, f64)>) } return; } - let sys_text = app.services.clipboard_get_text().or_else(|| event_text.map(str::to_string)).filter(|t| !t.is_empty()); + // The text the platform handed over with the paste event is the system clipboard's text: the + // browser delivers it, and the desktop's async clipboard bridge read it while the window + // thread was free to serve the transfer. Never re-read the clipboard synchronously for it — + // on the desktop that read blocks the window thread for the read timeout, and when this app + // itself owns the clipboard (a self-paste) its own source can only be served by that very + // thread, so the read waits the full timeout and the window freezes for seconds (#2021). + // A paste the platform didn't hand text over (a chord, an image, the menu) reads it, as before. + let sys_text = + if let Some(t) = event_text { (!t.is_empty()).then(|| t.to_string()) } else { app.services.clipboard_get_text().filter(|t| !t.is_empty()) }; // The text matching `last_copy` means the system clipboard still holds what we mirrored only // while the engine clipboard is the one we mirrored. A control-channel copy changes the engine // clipboard without writing the system clipboard, so its generation no longer matches and the diff --git a/crates/ui-egui/src/web_clipboard_tests.rs b/crates/ui-egui/src/web_clipboard_tests.rs index bda57373b..30d7e2b85 100644 --- a/crates/ui-egui/src/web_clipboard_tests.rs +++ b/crates/ui-egui/src/web_clipboard_tests.rs @@ -3,6 +3,9 @@ //! whatever the system clipboard has. A copy that never reached the clipboard pasted the text that //! was there before as a text layer instead of the copied layers. +use std::sync::Arc; +use std::sync::atomic::{AtomicUsize, Ordering}; + use egui::{Event, Key, Modifiers, OutputCommand, Pos2, RawInput, Rect, vec2}; use figcraft_doc::NodeKind; use figcraft_engine::Session; @@ -223,3 +226,49 @@ fn a_mismatched_image_buffer_is_dropped() { assert!(out.platform_output.commands.is_empty(), "{w}x{h}"); } } + +/// The system clipboard's text read, counted so a test can assert when it ran. The desktop's +/// arboard read blocks the window thread up to `CLIPBOARD_TIMEOUT`; against the app's own Wayland +/// source (a self-paste) it waits the full timeout — the whole UI freezes for seconds (#2021) — +/// and its result is discarded in favour of the paste event's text. A paste whose platform event +/// already carries the clipboard text must never perform that synchronous re-read. +struct CountingReads { + /// How often the synchronous text read was asked for. + reads: Arc, +} + +impl Services for CountingReads { + fn clipboard_get_text(&mut self) -> Option { + self.reads.fetch_add(1, Ordering::Relaxed); + None + } +} + +#[test] +fn a_paste_event_its_own_text_never_triggers_the_synchronous_text_read() { + // The platform (the desktop's async clipboard bridge, or the browser) already read the + // clipboard and handed the text with the paste event. + let reads = Arc::new(AtomicUsize::new(0)); + let mut s = Session::new(); + s.execute("shape.rectangle", &json!({"x": 10, "y": 10, "width": 100, "height": 50})).unwrap(); + let mut p = Page { + ctx: egui::Context::default(), + app: FigApp::new(s, Box::new(CountingReads { reads: reads.clone() })), + time: 0.0, + clipboard: String::new(), + }; + for _ in 0..3 { + p.frame(vec![]); + } + + // The desktop delivers the copied layers' SVG as the paste event's text. + let text = ""; + p.frame(vec![Page::key(Key::V, true), Event::Paste(text.to_string())]); + p.frame(vec![Page::key(Key::V, false)]); + assert_eq!(reads.load(Ordering::Relaxed), 0, "the text came with the paste event: no blocking re-read of the system clipboard"); + + // Even a second paste must not re-read: the clipboard still holds the pasted text. + p.frame(vec![Page::key(Key::V, true), Event::Paste(text.to_string())]); + p.frame(vec![Page::key(Key::V, false)]); + assert_eq!(reads.load(Ordering::Relaxed), 0, "still the event's text: no blocking re-read"); +} From b8f05d1948635fc9e416533d02ca269be99d27dd Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Wed, 11 Nov 2026 09:58:57 -0500 Subject: [PATCH 067/101] M4: a typed number and full stop start a numbered list at that number, as measured in Figma Typing `5. ` at the start of a plain paragraph starts a numbered list whose first item reads 5 (Figma has no start-number field); the next item goes on with 6. Digits only, 1 to 9999; `0. `, `12a. ` and `2)` stay text (not measured), `1)` works as before. The measured restart rows (plain paragraph, bullet item) are no longer marked silent. Co-Authored-By: Claude Sonnet 5.5 Model-Effort: Opus 5.5 drove; Opus 5.5 briefed; Sonnet 5.5 wrote at medium --- crates/engine/src/canvas/textedit.rs | 28 +++++++++++++++++++----- crates/engine/src/text_tail_tests.rs | 32 +++++++++++++++++++++++++++- crates/text/src/tail_tests.rs | 12 +++++++++-- docs/target-app-parity.md | 11 +++++----- 4 files changed, 69 insertions(+), 14 deletions(-) diff --git a/crates/engine/src/canvas/textedit.rs b/crates/engine/src/canvas/textedit.rs index 7191f15dd..0f82330af 100644 --- a/crates/engine/src/canvas/textedit.rs +++ b/crates/engine/src/canvas/textedit.rs @@ -284,20 +284,35 @@ fn insert_model(s: &mut Session, text: &str, ime_commit: bool) -> Result. " or "1) " typed at the start of a plain paragraph starts a list + // (the creation characters of Create bulleted and numbered lists). As measured in Figma + // (2026-11-11), a typed "5. " starts the numbered list at 5 (there is no start-number + // field). "0. " and a bracket after a number other than 1 are not measured: plain text. if text == " " && a == b && t.para_list(t.para_of(a)).list == ListStyle::None { let chars: Vec = t.characters.chars().collect(); let start = line_start(&chars, a); let typed: String = chars.get(start..a).unwrap_or(&[]).iter().collect(); + let mut first = 1_u32; let list = match typed.as_str() { "-" | "*" => ListStyle::Bulleted, - "1." | "1)" => ListStyle::Numbered, - _ => ListStyle::None, + "1)" => ListStyle::Numbered, + _ => match typed.strip_suffix('.').filter(|d| !d.is_empty() && d.bytes().all(|b| b.is_ascii_digit())) { + Some(d) => match d.parse::() { + Ok(n) if (1..=MAX_TYPED_LIST_START).contains(&n) => { + first = n; + ListStyle::Numbered + } + _ => ListStyle::None, + }, + None => ListStyle::None, + }, }; if list != ListStyle::None { t.replace_range(start, a, ""); - t.set_para_lists(start, start, |pl| pl.list = list); + t.set_para_lists(start, start, |pl| { + pl.list = list; + pl.start_offset = first - 1; + }); (te.caret, te.anchor) = (start, start); outcome = ImeInsertion::Transformed; return; @@ -310,6 +325,9 @@ fn insert_model(s: &mut Session, text: &str, ime_commit: bool) -> Result **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-06 · **Change:** minor (justified Chinese, Japanese and Korean text, written without spaces, spreads each line's room between its characters so its right edge aligns (#1970); joining the two ends of a path broken open by a deleted point closes it again, so its fill and selection outline follow the new segment and its corner radius instead of a straight line across the gap (#1951); glass's docs say which centre splay bends away from and where a shape gets no core; glass bends towards its core, rounded rectangles 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, measured against the reference tool; bulleted lists use the same bullet at every level of indentation, as the help center says, instead of a white bullet and a square at the deeper levels; typing `1)` and a space at the start of a paragraph starts a numbered list, as `1.` does, both being the help center's creation characters; a link on text is underlined by default, as the help center says, and Underline takes the underline off while the link stays; a Dash cap setting (none, round or square) on Dash and Custom strokes, drawn on both ends of every dash; gap 6: widgets draw lines and SVG pictures (plugin API 6); gap 6: a widget opens its plugin's panel (plugin API 5), whose callbacks redraw it; the browser build uses the fonts installed on the computer once asked, each read when text uses it (#1051); plugin widgets have hover styles: a layer's `hover` fill, stroke, opacity or text colour shows while the pointer is over it (gap 6); Thai, Lao, Khmer and Burmese lines break between words (#1219); MCP and control calls name their document (#998); shadows of images with transparent pixels follow their alpha (#1289); Arabic draft catalog; truncated text fills its last line before the ellipsis and keeps truncating when resized; auto-height text with max lines (#1375, #1376, #1377), numbers unchanged; 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; `.sketch` import, best effort: import/export breadth 86% → 87%, file formats 60% → 61%, headline numbers unchanged; Canvas & navigation's remaining work no longer lists outline mode's Include hidden layers and Include object bounds; boards: area 22 (weight 0, outside the weighted sum); 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, iteration marks 〱–〵 and the halfwidth parentheses; Turkish reviewed, Czech and Indonesian drafts, the Japanese draft completed; reviewed Russian catalog and integer plurals; vector edit mode regions: hover hatch, selection and drag; plugin log byte/count limits (#191); core editor leftovers: component playground, auto gap handles, variables inside styles, inner shadows and background blur on groups, command-made text readable on dark pages, a one-step frame/group convert, delays on mouse triggers and manual overlay offsets, wrapped-line alignment; starter templates, a Templates tab and Getting started tips on the home screen: essentials ~57% → ~59%; everyday editing partials: number fields, outline options, Hide when publishing, cursors, panel widths, dark pages, numbers unchanged but menu breadth 211/211; text box sizes measured against documents re-saved by other software: whole-pixel line heights, advances on a 1024-per-em grid, letter spacing between glyphs only, numbers unchanged; .fig export checked by opening written files in other software, numbers unchanged; a public figcraft-server: open hosting, owner tokens, per-address limits, idle expiry, moderation, install.sh; 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; headline percentages recomputed from the area table: feature breadth ~84%, core ~94%, mainstream ~50%; text lists, hanging punctuation and decoration styles; comments and version history behaviour suite and fixes; canvas navigation, guides and grids behaviour suite and fixes; export and inspect behaviour suite and fixes; .fig import: editable vector networks and more layer kinds; shapes and vector behaviour suite and fixes; paint and effects behaviour suite and fixes; frames, groups, sections and masks behaviour suite and fixes; styles and variables behaviour suite and fixes; prototyping behaviour suite and fixes; components behaviour suite and fixes; embedded image colour profiles; layers panel keyboard: F2 rename, Shift+F10 context menu, keyboard box selection, 10k-layer QA; per-side stroke weight variables; text behaviour suite: CJK line breaking, metrics, vertical trim; selection and transform behaviour suite and fixes; `.fig` import, best effort; auto layout behaviour suite and fixes; 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; feature breadth ~80%; ready ~49%; last major: full re-measure against Figma desktop 126.10.7; rows for the community batches: Selection colors, smart-selection spacing and a Present tab (#753), `.fig` import fidelity, paste from another design app, a `.fig` copy from Save as; control requests while the window is minimised (#720); catalog counts re-measured; automation roots (#715); number variables in the text content picker (#629); frames and sections convert into each other (#719)) · **Target:** Figma Design (desktop app 126.10.7, macOS) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-11 · **Change:** minor (a typed number and a full stop at the start of a paragraph starts a numbered list at that number, as measured in Figma 2026-11-11; justified Chinese, Japanese and Korean text, written without spaces, spreads each line's room between its characters so its right edge aligns (#1970); joining the two ends of a path broken open by a deleted point closes it again, so its fill and selection outline follow the new segment and its corner radius instead of a straight line across the gap (#1951); glass's docs say which centre splay bends away from and where a shape gets no core; glass bends towards its core, rounded rectangles 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, measured against the reference tool; bulleted lists use the same bullet at every level of indentation, as the help center says, instead of a white bullet and a square at the deeper levels; typing `1)` and a space at the start of a paragraph starts a numbered list, as `1.` does, both being the help center's creation characters; a link on text is underlined by default, as the help center says, and Underline takes the underline off while the link stays; a Dash cap setting (none, round or square) on Dash and Custom strokes, drawn on both ends of every dash; gap 6: widgets draw lines and SVG pictures (plugin API 6); gap 6: a widget opens its plugin's panel (plugin API 5), whose callbacks redraw it; the browser build uses the fonts installed on the computer once asked, each read when text uses it (#1051); plugin widgets have hover styles: a layer's `hover` fill, stroke, opacity or text colour shows while the pointer is over it (gap 6); Thai, Lao, Khmer and Burmese lines break between words (#1219); MCP and control calls name their document (#998); shadows of images with transparent pixels follow their alpha (#1289); Arabic draft catalog; truncated text fills its last line before the ellipsis and keeps truncating when resized; auto-height text with max lines (#1375, #1376, #1377), numbers unchanged; 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; `.sketch` import, best effort: import/export breadth 86% → 87%, file formats 60% → 61%, headline numbers unchanged; Canvas & navigation's remaining work no longer lists outline mode's Include hidden layers and Include object bounds; boards: area 22 (weight 0, outside the weighted sum); 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, iteration marks 〱–〵 and the halfwidth parentheses; Turkish reviewed, Czech and Indonesian drafts, the Japanese draft completed; reviewed Russian catalog and integer plurals; vector edit mode regions: hover hatch, selection and drag; plugin log byte/count limits (#191); core editor leftovers: component playground, auto gap handles, variables inside styles, inner shadows and background blur on groups, command-made text readable on dark pages, a one-step frame/group convert, delays on mouse triggers and manual overlay offsets, wrapped-line alignment; starter templates, a Templates tab and Getting started tips on the home screen: essentials ~57% → ~59%; everyday editing partials: number fields, outline options, Hide when publishing, cursors, panel widths, dark pages, numbers unchanged but menu breadth 211/211; text box sizes measured against documents re-saved by other software: whole-pixel line heights, advances on a 1024-per-em grid, letter spacing between glyphs only, numbers unchanged; .fig export checked by opening written files in other software, numbers unchanged; a public figcraft-server: open hosting, owner tokens, per-address limits, idle expiry, moderation, install.sh; 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; headline percentages recomputed from the area table: feature breadth ~84%, core ~94%, mainstream ~50%; text lists, hanging punctuation and decoration styles; comments and version history behaviour suite and fixes; canvas navigation, guides and grids behaviour suite and fixes; export and inspect behaviour suite and fixes; .fig import: editable vector networks and more layer kinds; shapes and vector behaviour suite and fixes; paint and effects behaviour suite and fixes; frames, groups, sections and masks behaviour suite and fixes; styles and variables behaviour suite and fixes; prototyping behaviour suite and fixes; components behaviour suite and fixes; embedded image colour profiles; layers panel keyboard: F2 rename, Shift+F10 context menu, keyboard box selection, 10k-layer QA; per-side stroke weight variables; text behaviour suite: CJK line breaking, metrics, vertical trim; selection and transform behaviour suite and fixes; `.fig` import, best effort; auto layout behaviour suite and fixes; 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; feature breadth ~80%; ready ~49%; last major: full re-measure against Figma desktop 126.10.7; rows for the community batches: Selection colors, smart-selection spacing and a Present tab (#753), `.fig` import fidelity, paste from another design app, a `.fig` copy from Save as; control requests while the window is minimised (#720); catalog counts re-measured; automation roots (#715); number variables in the text content picker (#629); frames and sections convert into each other (#719)) · **Target:** Figma Design (desktop app 126.10.7, macOS) The authoritative assessment of how close FigCraft is to Figma Design. [`ROADMAP.md`](../ROADMAP.md) summarizes it; [`gaps.md`](gaps.md) is the ranked work list; the measured menu checklist is @@ -303,13 +303,11 @@ Hours in this narrative are the builders' estimates; the tables above supersede Backspace by grapheme cluster; double-click and word moves by script run; IME composition with CJK; vertical trim (cap height to baseline). The tail suite (`crates/text/src/tail_tests.rs`, `crates/engine/src/text_tail_tests.rs`): lists per paragraph, nested up to 8 levels with Tab and - Shift+Tab (1. a. i. and • ◦ ▪ per level, counts restarting after plain paragraphs), Enter on an - empty item and Backspace at an item's start stepping out, `- `/`* `/`1. ` starting a list; list + Shift+Tab (1. a. i. and • ◦ ▪ per level, counts restarting after plain paragraphs and bullet items, as measured in Figma), Enter on an + empty item and Backspace at an item's start stepping out, `- `/`* `/`N. ` starting a list (a typed `5. ` starts the numbering at 5, as measured in Figma); list spacing between items; hanging lists and hanging punctuation; decoration style (solid, dotted, wavy), thickness, underline offset, skip ink and colour, with inspect, CSS and the REST import. - *Left:* visual QA; hanging punctuation in right-to-left paragraphs and centred text, list - numbering that continues across a plain paragraph and a list's own start number (documentation - silent); decoration colour in SVG exports (drawn with the text's fill, like run fills); Korean + *Left:* visual QA; hanging punctuation in right-to-left paragraphs and centred text; decoration colour in SVG exports (drawn with the text's fill, like run fills); Korean keeps breaking by syllable and Han runs aren't split by a dictionary (documentation silent). 0.5 h. 3. **Auto layout and sections depth**: *landed:* on-canvas padding/gap handles (also wrapped-row and grid column/row gaps, grid tracks outlined), min/max width/height (UI, Hug/Fill/Fixed, @@ -652,6 +650,7 @@ Carried over from the ROADMAP's "Shipped so far" (2026-10-10). The test count th | Date | Change | Summary | |---|---|---| +| 2026-11-11 | patch | M4: typing a number, a full stop and a space at the start of a plain paragraph starts a numbered list at that number (`5. ` then "x", Enter, "y" reads 5. then 6.), as measured in Figma web on 2026-11-11 (it has no start-number field: the start comes only from the typed number); before, only `1. ` and `1)` started a list. `0. `, `12a. ` and a bracket after a number other than 1 stay text (not measured), and the number is capped at 9999. Also measured: a plain paragraph or a bullet item between numbered items restarts the count at 1, and an indented sub-item does not break the outer count; those rows were pinned as silent. Tests: `text_tail_tests::typed_list_starts`, `typed_number_starts_the_list_there`, `tail_tests` restart rows. Numbers unchanged | | 2026-11-03 | minor | Traditional Chinese (Taiwan) (`zh-Hant`) draft catalog: 1,975 UI strings, 641 command labels and 31 menu wordings, clean-room from the English source; zh-TW, zh-HK, zh-MO and zh-Hant read it, explicit Hans stays Simplified; Noto Sans CJK TC then Taiwan system faces; no bundled font; native review pending. Numbers unchanged | | 2026-11-04 | patch | M4, #1970: justified Chinese, Japanese and Korean text, written without spaces between words, aligns its right edge: the room on each line but a paragraph's last goes between its characters, each a word of its own as for line breaking ("Justify aligns the first word in each line of text to the left-most edge, and the last to the right-most edge"), wherever a line could break there, so none opens before a full stop or closing bracket, nor after an opening one. Latin text widens its spaces as before; mixed text widens both. A gap is reordered with the line's runs as a space of no width would be, so one beside a Hebrew word in Chinese text, or beside a Chinese word within that Hebrew, opens beside the word, not inside it. `figcraft_text::breaks::justify_between`, beside `break_between`, says where. Evidence: `tests::justified_ideographs_spread_the_room_between_characters` (fails on main). | | 2026-11-04 | patch | M8, #1951 (#1506 again): a path broken open by deleting a point (Delete, not Shift+Delete) is filled closed by a straight line across the gap, as an open path's fill is; joining its two ends again (the pen onto the other end, Connect, ⌘J) left the loop without the new segment, so once the points were rounded the fill and the selection outline ran straight across while the stroke followed the segment and its arcs. Joining now closes the loop through the new segment ("Click to close the path."; "You can use the Paint tool to add fills to any closed regions of a vector network."): `ops::connect` puts it into the loop whose segments are the chain between the ends, at the gap and in the loop's own order, so a hole keeps its winding whichever end was clicked first; a loop listed out of walking order is left as it was. Evidence: `vectoredit::tests::a_rounded_chamfer_made_other_ways_fills_along_its_arcs` (fails on main: the loop kept 4 of 5 segments), `a_rounded_chamfer_cut_in_the_editor_fills_along_its_arcs` (Shift+Delete, with and without a region fill), `doc::tests::a_chamfered_rectangles_rounded_fill_is_cut_at_every_point` (fill, region path and stroke agree for every loop order and segment direction of a chamfered rectangle). | From 4d3fe2aa1ac041df7fa4d785beb8429d66678ed8 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Wed, 11 Nov 2026 15:59:59 +0000 Subject: [PATCH 068/101] svg import: cap attributes per element, map span offsets to characters once --- crates/svg/src/import.rs | 35 ++++++++++++++++++++++---- crates/svg/src/import/budget.rs | 2 +- crates/svg/src/import/hostile_tests.rs | 12 +++++++++ crates/svg/src/import/text.rs | 12 ++++++--- crates/svg/src/import/text_tests.rs | 8 ++++++ 5 files changed, 60 insertions(+), 9 deletions(-) diff --git a/crates/svg/src/import.rs b/crates/svg/src/import.rs index 1ac8a78bf..f77b10bfa 100644 --- a/crates/svg/src/import.rs +++ b/crates/svg/src/import.rs @@ -704,13 +704,28 @@ fn simple_hash(b: &[u8]) -> String { /// Deepest element nesting the parser is given: deeper documents would exhaust the stack. const MAX_NESTING: usize = 512; +/// The most attributes one element may have. The XML parser checks each attribute against the +/// earlier ones, so a huge count is quadratic work; real elements have a few dozen at most. +const MAX_ATTRIBUTES: usize = 4096; + /// How deep elements nest in `data`: a scan of its tags (comments, CDATA, declarations and quoted /// attribute values skipped) that stops once past `limit`. pub(crate) fn nesting(data: &[u8], limit: usize) -> usize { + scan(data, limit).0 +} + +/// Whether an element of `data` has more than [`MAX_ATTRIBUTES`] attributes (counted as quoted +/// values, before the parser sees them). +pub(crate) fn too_wide(data: &[u8]) -> bool { + scan(data, usize::MAX).1 > MAX_ATTRIBUTES +} + +/// [`nesting`] and the most attribute values on one element; stops once either is past its limit. +fn scan(data: &[u8], limit: usize) -> (usize, usize) { let find = |from: usize, pat: &[u8]| -> usize { data.get(from..).and_then(|r| r.windows(pat.len()).position(|w| w == pat)).map_or(data.len(), |p| from + p + pat.len()) }; - let (mut depth, mut max, mut i) = (0usize, 0usize, 0usize); + let (mut depth, mut max, mut i, mut widest) = (0usize, 0usize, 0usize, 0usize); while let Some(off) = data.get(i..).and_then(|r| r.iter().position(|b| *b == b'<')) { i += off; let rest = data.get(i..).unwrap_or(&[]); @@ -725,12 +740,15 @@ pub(crate) fn nesting(data: &[u8], limit: usize) -> usize { i = find(i + 2, b">"); } else { // A start tag: to its `>` outside quotes; `/>` closes it. - let (mut quote, mut j, mut closed) = (None, i + 1, false); + let (mut quote, mut j, mut closed, mut attrs) = (None, i + 1, false, 0usize); while let Some(&c) = data.get(j) { match quote { Some(q) if c == q => quote = None, Some(_) => {} - None if c == b'"' || c == b'\'' => quote = Some(c), + None if c == b'"' || c == b'\'' => { + quote = Some(c); + attrs += 1; + } None if c == b'>' => { closed = data.get(j.wrapping_sub(1)) == Some(&b'/'); break; @@ -739,17 +757,21 @@ pub(crate) fn nesting(data: &[u8], limit: usize) -> usize { } j += 1; } + widest = widest.max(attrs); + if widest > MAX_ATTRIBUTES { + return (max, widest); + } if !closed { depth += 1; max = max.max(depth); if max > limit { - return max; + return (max, widest); } } i = j + 1; } } - max + (max, widest) } /// Whether `data` nests elements more than [`MAX_NESTING`] deep: the byte scan first, then the @@ -883,6 +905,9 @@ fn import_within( ) -> Result { // SVGZ is unpacked here, within a budget, so every check below sees the real document. let data = budget::document(data, &limits).map_err(ImportError)?; + if too_wide(&data) { + return Err(ImportError(format!("an element has more than {MAX_ATTRIBUTES} attributes"))); + } if too_deep(&data) { return Err(ImportError(format!("elements nested more than {MAX_NESTING} deep"))); } diff --git a/crates/svg/src/import/budget.rs b/crates/svg/src/import/budget.rs index 7de080af4..c50266dc0 100644 --- a/crates/svg/src/import/budget.rs +++ b/crates/svg/src/import/budget.rs @@ -87,7 +87,7 @@ fn embedded(used: &Used, limits: &Limits, data: &[u8], opts: &Options) -> Option } }; used.bytes.fetch_add(plain.len(), Ordering::Relaxed); - if super::too_deep(&plain) { + if super::too_wide(&plain) || super::too_deep(&plain) { return None; } used.depth.fetch_add(1, Ordering::Relaxed); diff --git a/crates/svg/src/import/hostile_tests.rs b/crates/svg/src/import/hostile_tests.rs index 0af1297d0..16731407c 100644 --- a/crates/svg/src/import/hostile_tests.rs +++ b/crates/svg/src/import/hostile_tests.rs @@ -181,3 +181,15 @@ fn entity_expansion_cannot_bypass_the_nesting_limit() { let err = import_svg(&mut d, data.as_bytes(), p, 0.0, 0.0, "x").err().map(|e| e.to_string()).unwrap_or_default(); assert!(err.contains("nested more than 512 deep"), "{err:?}"); } + +#[test] +fn an_element_with_thousands_of_attributes_is_refused_before_parsing() { + use super::too_wide; + let many = |n: usize| (0..n).map(|i| format!(" a{i}=\"1\"")).collect::(); + assert!(!too_wide(format!("", many(4096)).as_bytes())); + assert!(too_wide(format!("", many(4097)).as_bytes())); + assert!(!too_wide(format!("{}", "".repeat(10_000)).as_bytes()), "per element, not per file"); + let mut d = Document::new("t"); + let p = d.first_page().unwrap(); + assert!(import_svg(&mut d, &svg(&format!("", many(100_000))), p, 0.0, 0.0, "x").is_err()); +} diff --git a/crates/svg/src/import/text.rs b/crates/svg/src/import/text.rs index cee54bbd8..7ed8d018f 100644 --- a/crates/svg/src/import/text.rs +++ b/crates/svg/src/import/text.rs @@ -195,7 +195,7 @@ pub(crate) fn text(cx: &mut Ctx, t: &usvg::Text, parent: NodeId, base: Affine, d let x = chunk.x().map_or(pen_x, f64::from) + d(t.dx()); let y = chunk.y().map_or(pen_y, f64::from) + d(t.dy()); char_at += count; - let ci = |b: usize| text.get(..b).map_or(count, |p| p.chars().count()); + let ci = char_index(text); let spans: Vec<_> = chunk.spans().iter().map(|sp| (ci(sp.start()), ci(sp.end()), sp, span_style(sp, s, fonts))).collect(); if spans.is_empty() { continue; @@ -229,6 +229,13 @@ pub(crate) fn text(cx: &mut Ctx, t: &usvg::Text, parent: NodeId, base: Affine, d } } +/// The characters of `text` before a byte offset (all of them for an offset that is past the end +/// or inside a character), by a search in a table built once: many spans don't rescan the prefix. +fn char_index(text: &str) -> impl Fn(usize) -> usize + '_ { + let starts: Vec = text.char_indices().map(|(i, _)| i).collect(); + move |b| if text.is_char_boundary(b) { starts.partition_point(|s| *s < b) } else { starts.len() } +} + /// The text of `lines` (one per line, stacked at their pitch; `s`: their scale): characters, the /// first span's style and a run per span, fills still to come. fn text_data(lines: &[Line], s: f64) -> TextData { @@ -262,8 +269,7 @@ fn on_path(cx: &mut Ctx, t: &usvg::Text, world: Affine, parent: NodeId) -> bool let Some(len) = figcraft_geom::measure::polylines(&path).and_then(|l| l.first().map(|l| l.length())).filter(|l| *l > 1e-9) else { return false }; let fonts = cx.fonts.get_or_insert_with(Fonts::load); let text = chunk.text(); - let count = text.chars().count(); - let ci = |b: usize| text.get(..b).map_or(count, |p| p.chars().count()); + let ci = char_index(text); let spans: Vec<_> = chunk.spans().iter().map(|sp| (ci(sp.start()), ci(sp.end()), sp, span_style(sp, 1.0, fonts))).collect(); let line = Line { x: 0.0, y: 0.0, anchor: chunk.anchor(), text: text.to_string(), spans }; let mut td = text_data(std::slice::from_ref(&line), 1.0); diff --git a/crates/svg/src/import/text_tests.rs b/crates/svg/src/import/text_tests.rs index f267b2947..94c6ae5b2 100644 --- a/crates/svg/src/import/text_tests.rs +++ b/crates/svg/src/import/text_tests.rs @@ -30,3 +30,11 @@ fn css_system_font_names_keep_their_name_where_the_system_font_is() { assert_eq!(family(&named(&["-apple-system", "BlinkMacSystemFont", "system-ui", "sans-serif"]), &elsewhere), "Inter"); assert_eq!(family(&named(&["-apple-system"]), &elsewhere), "-apple-system", "nothing installed: the first name it gives"); } + +#[test] +fn char_index_counts_the_characters_before_a_byte_offset() { + let t = "aé😀b"; + let ci = super::char_index(t); + assert_eq!([ci(0), ci(1), ci(3), ci(7), ci(8)], [0, 1, 2, 3, 4]); + assert_eq!([ci(2), ci(4), ci(99)], [4, 4, 4], "inside a character or past the end: all of them"); +} From 1935c3eac22b9c4dc62e278ef56fd0f036001c5e Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Wed, 11 Nov 2026 16:03:10 +0000 Subject: [PATCH 069/101] layout: bound the snap lines a frame's grids generate --- crates/layout/src/depth_tests.rs | 12 ++++++++++++ crates/layout/src/lib.rs | 7 +++++++ 2 files changed, 19 insertions(+) diff --git a/crates/layout/src/depth_tests.rs b/crates/layout/src/depth_tests.rs index f8b597a34..b533c7e42 100644 --- a/crates/layout/src/depth_tests.rs +++ b/crates/layout/src/depth_tests.rs @@ -93,3 +93,15 @@ fn deeply_nested_fill_frames_lay_out_without_running_out_of_stack() { assert_eq!(width(&d, chain[DEEP - 1]), 10.0, "past the nesting the layout follows, layers stay"); }); } + +#[test] +fn snap_lines_are_bounded_across_a_frames_grids() { + use figcraft_doc::{Document, GridKind, LayoutGrid, NodeKind}; + let mut d = Document::new("t"); + let p = d.first_page().unwrap(); + let f = d.create(p, NodeKind::Frame, "F", 0.0, 0.0, 4000.0, 4000.0).unwrap(); + d.get_mut(f).unwrap().grids = vec![LayoutGrid { kind: GridKind::Grid, size: 1.0, visible: true, ..LayoutGrid::default() }; 1000]; + let (xs, ys) = crate::grid_snap_lines(&d, f); + assert!(xs.len() + ys.len() < 250_000, "{}", xs.len() + ys.len()); + assert!(xs.len() > 4000 && ys.len() > 4000, "the first grids still give their lines"); +} diff --git a/crates/layout/src/lib.rs b/crates/layout/src/lib.rs index 880c6dad7..04abbc39a 100644 --- a/crates/layout/src/lib.rs +++ b/crates/layout/src/lib.rs @@ -1159,6 +1159,9 @@ pub fn grid_snap_lines(doc: &Document, frame: NodeId) -> (Vec, Vec) { grid_snap_lines_in(doc, frame, doc.world_transform(frame)) } +/// The most snap coordinates a frame's grids give together (a few dozen grids' worth of lines). +const MAX_SNAP_LINES: usize = 200_000; + /// [`grid_snap_lines`] mapped from the frame's coordinates by `xf` (the frame's world transform /// for page lines). pub fn grid_snap_lines_in(doc: &Document, frame: NodeId, xf: Affine) -> (Vec, Vec) { @@ -1166,6 +1169,10 @@ pub fn grid_snap_lines_in(doc: &Document, frame: NodeId, xf: Affine) -> (Vec= MAX_SNAP_LINES { + break; + } for r in grid_lines(g, f.width, f.height) { let a = xf * Point::new(r.x0, r.y0); let b = xf * Point::new(r.x1, r.y1); From 9aaf7114e09268b8893d3ba01a8790e94f674577 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Wed, 11 Nov 2026 16:37:35 +0000 Subject: [PATCH 070/101] widgets: bound the decoded pixels of a widget's images, read from their headers --- crates/engine/src/extensions/widgets.rs | 48 +++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 3 deletions(-) diff --git a/crates/engine/src/extensions/widgets.rs b/crates/engine/src/extensions/widgets.rs index 13c6088c4..efdd21414 100644 --- a/crates/engine/src/extensions/widgets.rs +++ b/crates/engine/src/extensions/widgets.rs @@ -41,6 +41,8 @@ const FIELD: &str = "figcraft.widget.field"; const HOVER: &str = "figcraft.widget.hover"; /// Images in a widget are at most this many pixels on a side. const MAX_IMAGE_SIDE: u32 = 4096; +/// All images of one widget together are at most this many pixels once decoded (four of the largest). +const MAX_IMAGES_PIXELS: u64 = 4 * 4096 * 4096; /// Whether `n` is a widget's own layer. pub fn is_widget(n: &Node) -> bool { @@ -259,8 +261,9 @@ fn build(s: &mut Session, plugin: &str, w: NodeId, r: &WidgetRender) -> Result<( _ => n.plugin_data.remove(MENU), }; set_hover(n, r.root.hover.as_ref()); + let mut pixels = 0; for c in &r.root.children { - add(doc, w, c, cmd)?; + add(doc, w, c, cmd, &mut pixels)?; } // An SVG brings as many layers as it describes. if doc.subtree(w).len() > MAX_NODES { @@ -271,7 +274,7 @@ fn build(s: &mut Session, plugin: &str, w: NodeId, r: &WidgetRender) -> Result<( } /// Add layer `d` (and what it holds) inside `parent`, locked. -fn add(doc: &mut Document, parent: NodeId, d: &WidgetNode, cmd: &str) -> Result<()> { +fn add(doc: &mut Document, parent: NodeId, d: &WidgetNode, cmd: &str, pixels: &mut u64) -> Result<()> { let (kind, name) = match d.kind { WidgetKind::Frame => (NodeKind::Frame, "Frame"), WidgetKind::Text => (NodeKind::Text(TextData { characters: d.text.clone(), ..TextData::default() }), "Text"), @@ -292,6 +295,16 @@ fn add(doc: &mut Document, parent: NodeId, d: &WidgetNode, cmd: &str) -> Result< if bytes.len() > MAX_IMAGE_BYTES { return Err(bad(cmd, format!("an image is larger than {} KB", MAX_IMAGE_BYTES / 1024))); } + // From the header, before anything is decoded: a small file can hold billions of pixels. + if let Some((w, h)) = figcraft_render::images::dimensions(&bytes) { + if w > MAX_IMAGE_SIDE || h > MAX_IMAGE_SIDE { + return Err(bad(cmd, format!("an image is larger than {MAX_IMAGE_SIDE} pixels on a side"))); + } + *pixels += u64::from(w) * u64::from(h); + if *pixels > MAX_IMAGES_PIXELS { + return Err(bad(cmd, format!("the images are larger than {MAX_IMAGES_PIXELS} pixels together"))); + } + } let (hash, iw, ih) = crate::cmd::create::add_readable_image(doc, bytes).map_err(|e| bad(cmd, e))?; if iw > MAX_IMAGE_SIDE || ih > MAX_IMAGE_SIDE { return Err(bad(cmd, format!("an image is larger than {MAX_IMAGE_SIDE} pixels on a side"))); @@ -302,7 +315,7 @@ fn add(doc: &mut Document, parent: NodeId, d: &WidgetNode, cmd: &str) -> Result< } doc.insert(n, parent, None)?; crate::cmd::props::apply(cmd, doc, id, &props(d, false))?; - d.children.iter().try_for_each(|c| add(doc, id, c, cmd)) + d.children.iter().try_for_each(|c| add(doc, id, c, cmd, pixels)) } /// Add SVG layer `d` inside `parent`: a frame of the picture's own size holding its layers, locked @@ -604,3 +617,32 @@ pub fn specs() -> Vec { spec!("widget.list", "List widgets", "{} → {widgets: [{id, plugin, name, page, state, targets, fields, menu}]}", false, list), ] } + +#[cfg(test)] +mod pixel_budget_tests { + use super::*; + use base64::Engine as _; + + /// A `side` x `side` blank PNG (a few KB however many pixels). + fn png(side: u32) -> String { + let pix = figcraft_render::Pixmap::new(side, side).unwrap(); + base64::engine::general_purpose::STANDARD.encode(figcraft_render::encode_png(&pix).unwrap()) + } + + #[test] + fn images_of_a_widget_share_a_decoded_pixel_budget() { + let mut doc = Document::new("t"); + let page = doc.first_page().unwrap(); + let data = png(4096); + let image = |i: usize| serde_json::from_value::(json!({"type": "image", "name": format!("I{i}"), "data": data})).unwrap(); + let mut pixels = 0; + for i in 0..4 { + add(&mut doc, page, &image(i), "widget.insert", &mut pixels).unwrap(); + } + let err = add(&mut doc, page, &image(4), "widget.insert", &mut pixels).unwrap_err().to_string(); + assert!(err.contains("together"), "{err}"); + // A header past the side limit is refused before it is decoded. + let wide = serde_json::from_value::(json!({"type": "image", "data": png(4097)})).unwrap(); + assert!(add(&mut doc, page, &wide, "widget.insert", &mut 0).unwrap_err().to_string().contains("pixels on a side")); + } +} From a40c76ab68a1d9856a6a79d26e01603643da885d Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Wed, 11 Nov 2026 16:48:03 +0000 Subject: [PATCH 071/101] collab-net: cut a host's peer names and colours where the guest keeps them --- crates/collab-net/src/client_cap_tests.rs | 14 ++++++++++++++ crates/collab-net/src/join.rs | 21 +++++++++++++++++---- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/crates/collab-net/src/client_cap_tests.rs b/crates/collab-net/src/client_cap_tests.rs index 920d53483..73f181774 100644 --- a/crates/collab-net/src/client_cap_tests.rs +++ b/crates/collab-net/src/client_cap_tests.rs @@ -59,3 +59,17 @@ fn joins_past_the_cap_are_left_out_until_someone_leaves() { send(joined(over)); assert!(matches!(inbox.drain().as_slice(), [Event::PeerLeft(7), Event::PeerJoined(p)] if p.client_id == over)); } + +#[test] +fn a_hosts_long_names_and_colours_are_cut_where_they_are_kept() { + let inbox = inbox(); + let cfg = GuestConfig::new(Invite::new("127.0.0.1:47900", "0123456789abcdef", "AbCdEfGhIjKlMnOpQrStUv"), "Ada".into()); + let resume = Mutex::new(None); + let mut seen = Seen::default(); + let long = "x".repeat(100_000); + take(ServerMsg::PeerJoined(Peer { client_id: 1, name: long.clone(), color: long }), &cfg, &inbox, &mut seen, &resume, &|| {}); + match inbox.drain().as_slice() { + [Event::PeerJoined(p)] => assert!(p.name.chars().count() <= 256 && p.color.chars().count() <= 32), + other => panic!("{other:?}"), + } +} diff --git a/crates/collab-net/src/join.rs b/crates/collab-net/src/join.rs index 8aacff711..5982ed6e8 100644 --- a/crates/collab-net/src/join.rs +++ b/crates/collab-net/src/join.rs @@ -226,6 +226,19 @@ pub(crate) struct Seen { peers: Vec, } +/// `p` with its name and colour cut to what the UI shows: the host is untrusted, and the roster is +/// copied whenever someone's identity is updated. +fn bounded(mut p: Peer) -> Peer { + p.name = p.name.chars().take(MAX_PEER_NAME).collect(); + p.color = p.color.chars().take(MAX_COLOR).collect(); + p +} + +/// The most characters of a colour (`#rrggbb` and a few spellings more) kept for someone. +const MAX_COLOR: usize = 32; +/// The most characters of a name kept for someone. +const MAX_PEER_NAME: usize = 256; + /// What taking in one message from the host means for the connection. pub(crate) enum Taken { Continue, @@ -251,7 +264,7 @@ pub(crate) fn take(mut m: ServerMsg, cfg: &GuestConfig, inbox: &Inbox, seen: &mu *r = Some(Resume { session, client_id, seq, secret }); } // The sync client opens the document (and fills in its name and pages). - let peers: Vec = peers.iter().take(MAX_PEERS).cloned().collect(); + let peers: Vec = peers.iter().take(MAX_PEERS).cloned().map(bounded).collect(); let inv = &cfg.invite; let info = SessionInfo { role: Role::Guest, @@ -274,14 +287,14 @@ pub(crate) fn take(mut m: ServerMsg, cfg: &GuestConfig, inbox: &Inbox, seen: &mu inbox.push(Event::Sync(m)); return Taken::Welcomed; } - ServerMsg::PeerJoined(p) => match seen.info.as_mut() { + ServerMsg::PeerJoined(p) => match (seen.info.as_mut(), bounded(p)) { // The host tells you how you are shown. - Some(info) if p.client_id == info.me => { + (Some(info), p) if p.client_id == info.me => { info.name = p.name; info.color = p.color; inbox.push(Event::Welcome { info: info.clone(), peers: seen.peers.clone() }); } - _ => { + (_, p) => { match seen.peers.iter().position(|q| q.client_id == p.client_id) { Some(i) => { seen.peers.remove(i); From 8415de0bad4372c03465f592205cadc24fd04c8b Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Wed, 11 Nov 2026 12:11:16 -0500 Subject: [PATCH 072/101] ci: run Harden-Runner on every job (#2258) Adds step-security/harden-runner (audit, pinned to v2.22.4 like craft-common-actions) as the first step of each job that did not have it, so every workflow in the org's public repos reports its egress to StepSecurity. Audit, not block: block-mode allow lists come from each job's observed traffic. --- .github/workflows/packaging-lint.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/packaging-lint.yml b/.github/workflows/packaging-lint.yml index da85536c4..0a91cc050 100644 --- a/.github/workflows/packaging-lint.yml +++ b/.github/workflows/packaging-lint.yml @@ -29,6 +29,10 @@ jobs: name: Windows installation policy (no app build) runs-on: windows-latest steps: + - name: Harden runner + uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4 + with: + egress-policy: audit - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false From 2f8dd85f4284c9b1ba0007d401d76200551c209e Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Wed, 11 Nov 2026 17:43:55 +0000 Subject: [PATCH 073/101] load: share one layer allowance across Penpot raw SVGs, sum font-run coverage once --- crates/engine/src/cmd/file/load.rs | 111 +++++++++++++++++++++++------ 1 file changed, 91 insertions(+), 20 deletions(-) diff --git a/crates/engine/src/cmd/file/load.rs b/crates/engine/src/cmd/file/load.rs index 3e917d5dd..77dd68198 100644 --- a/crates/engine/src/cmd/file/load.rs +++ b/crates/engine/src/cmd/file/load.rs @@ -399,11 +399,19 @@ pub(crate) fn load_fig(bytes: &[u8], name: &str) -> Option) { + expand_penpot_raw_svgs_within(doc, notes, MAX_PENPOT_SVG_LAYERS); +} + +/// [`expand_penpot_raw_svgs`] with at most `room` layers made in all. +fn expand_penpot_raw_svgs_within(doc: &mut Document, notes: &mut Vec, mut room: usize) { let layers = doc .nodes() .filter_map(|node| { @@ -413,12 +421,25 @@ fn expand_penpot_raw_svgs(doc: &mut Document, notes: &mut Vec) { }) .collect::>(); let mut ok_count = 0usize; + // The SVG importer caps its own layers per file; `room` is the cap over all of a file's placeholders. for (id, name, width, height, xml, empty) in layers { + if room == 0 { + if let Some(n) = doc.node_mut(id) { + n.plugin_data.insert("penpot.svgRawStatus".into(), "not-expanded".into()); + } + if notes.len() < 100 { + notes.push(format!("Penpot SVG '{name}': not converted, the file's SVG layers are over the limit; the original markup is preserved")); + } + continue; + } if !empty { notes.push(format!("Penpot SVG '{name}': has separate child layers; the original tree was preserved to prevent duplicate rendering")); continue; } - match figcraft_svg::import_svg_with_notes(doc, xml.as_bytes(), id, 0.0, 0.0, &name) { + let before = doc.node_count(); + let imported = figcraft_svg::import_svg_with_notes(doc, xml.as_bytes(), id, 0.0, 0.0, &name); + room = room.saturating_sub(doc.node_count().saturating_sub(before)); + match imported { Ok(imported) => { // An SVG can be syntactically valid yet contain no supported drawable // elements. Do not claim success or leave an empty extra frame. @@ -470,6 +491,28 @@ fn expand_penpot_raw_svgs(doc: &mut Document, notes: &mut Vec) { } } +/// Whether some of the first `len` characters are in none of `runs`. Where runs start and stop +/// covering is summed once, so runs overlapping any number of times cost no more than their count. +fn has_uncovered(len: usize, runs: &[figcraft_doc::StyleRun]) -> bool { + let mut change = vec![0i64; len + 1]; + for run in runs { + let (start, end) = (run.start.min(len), run.end.min(len)); + if start < end { + if let Some(c) = change.get_mut(start) { + *c += 1; + } + if let Some(c) = change.get_mut(end) { + *c -= 1; + } + } + } + let mut open = 0i64; + change.iter().take(len).any(|c| { + open += c; + open <= 0 + }) +} + /// Non-destructive font diagnostic for the action palette, CLI and control API. /// Includes styled runs, not just the default typeface of each text layer. pub(super) fn font_report(doc: &Document) -> Value { @@ -485,21 +528,15 @@ fn font_report_with_families(doc: &Document, installed: &[String]) -> Value { if text.characters.is_empty() { continue; } - let mut covered = vec![false; text.characters.chars().count().min(100_000)]; + let len = text.characters.chars().count().min(100_000); let mut used = BTreeSet::new(); for run in &text.runs { - let start = run.start.min(covered.len()); - let end = run.end.min(covered.len()); - if start < end { - if !run.style.font_family.trim().is_empty() { - used.insert(run.style.font_family.clone()); - } - for entry in covered.iter_mut().take(end).skip(start) { - *entry = true; - } + if run.start.min(len) < run.end.min(len) && !run.style.font_family.trim().is_empty() { + used.insert(run.style.font_family.clone()); } } - if covered.iter().any(|entry| !entry) { + let uncovered = has_uncovered(len, &text.runs); + if uncovered { used.insert(text.style.font_family.clone()); } for family in used { @@ -599,19 +636,14 @@ fn missing_penpot_font_warnings(doc: &Document, families: &[String]) -> Vec"#; + let ids: Vec = (0..2) + .map(|i| { + let id = doc.create(page, NodeKind::Frame, &format!("S{i}"), 0.0, 0.0, 10.0, 10.0).unwrap(); + let layer = doc.node_mut(id).unwrap(); + layer.plugin_data.insert("penpot.svgRawXml".into(), svg.into()); + layer.plugin_data.insert("penpot.svgRawStatus".into(), "pending".into()); + id + }) + .collect(); + let mut warnings = Vec::new(); + expand_penpot_raw_svgs_within(&mut doc, &mut warnings, 1); + let status = |i: usize| doc.node(ids[i]).unwrap().plugin_data.get("penpot.svgRawStatus").cloned(); + assert_eq!(status(0).as_deref(), Some("expanded"), "the first uses the allowance"); + assert_eq!(status(1).as_deref(), Some("not-expanded")); + assert!(doc.node(ids[1]).unwrap().children.is_empty()); + assert!(warnings.iter().any(|w| w.contains("over the limit")), "{warnings:?}"); + } + + #[test] + fn many_overlapping_style_runs_are_summed_once() { + use figcraft_doc::StyleRun; + let mut doc = Document::new("Runs"); + let page = doc.first_page().unwrap(); + let mut t = TextData::new("x".repeat(100_000)); + t.style.font_family = "Unused Base".into(); + let mut run = t.style.clone(); + run.font_family = "Run Font".into(); + t.runs = (0..50_000).map(|_| StyleRun { start: 0, end: 100_000, style: run.clone() }).collect(); + doc.create(page, NodeKind::Text(t), "Long", 0.0, 0.0, 100.0, 30.0).unwrap(); + let report = font_report_with_families(&doc, &[]); + assert_eq!(report["fonts"].as_array().map(Vec::len), Some(1), "{report}"); + assert_eq!(report["fonts"][0]["family"], "Run Font"); + } + #[test] fn expands_inline_svg_into_editable_shapes_without_discarding_source() { let mut doc = Document::new("SVG fixture"); From 2446e8718b116144ac5e3b47cd09db8c5a02a40a Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Wed, 11 Nov 2026 12:44:16 -0500 Subject: [PATCH 074/101] Updates: take craft-update from craft-libs main at 6e03f65bf --- Cargo.lock | 3 ++- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8ca91ac04..73d4d60fb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1134,7 +1134,7 @@ dependencies = [ [[package]] name = "craft-update" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=1b34eba41e62138fc2438d2734523b302840b45d#1b34eba41e62138fc2438d2734523b302840b45d" +source = "git+https://github.com/storytold/craft-libs?rev=6e03f65bf45181db77ba6229716e6624db9eb25b#6e03f65bf45181db77ba6229716e6624db9eb25b" dependencies = [ "chrono", "dunce", @@ -1144,6 +1144,7 @@ dependencies = [ "image", "log", "plist", + "rustix 1.1.5", "semver", "serde", "serde_json", diff --git a/Cargo.toml b/Cargo.toml index af0dcaa8b..21833c3ec 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,7 +43,7 @@ craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-l # pull a second egui family version). craft-window = { git = "https://github.com/storytold/craft-libs", rev = "e11f9d9aebea5f6b8e74643c1ea1ed172ba5f545" } # craft-update: app-specific pretend versions apply to startup and manual checks. -craft-update = { git = "https://github.com/storytold/craft-libs", version = "=0.1.0", rev = "1b34eba41e62138fc2438d2734523b302840b45d", features = ["egui"] } +craft-update = { git = "https://github.com/storytold/craft-libs", version = "=0.1.0", rev = "6e03f65bf45181db77ba6229716e6624db9eb25b", features = ["egui"] } # The suite's font store: exact lookup of a missing font in the pinned Google Fonts and Noto # indexes, and checksum-verified installs into the one folder every Craft app reads (craft-libs). craft-font-store = { git = "https://github.com/storytold/craft-libs", rev = "e11f9d9aebea5f6b8e74643c1ea1ed172ba5f545" } From a8e34e75a8e15b27e5654f417081f0b546d5b76b Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Wed, 11 Nov 2026 18:38:59 +0000 Subject: [PATCH 075/101] components: work out each main's layer paths once while linking imported instances --- crates/engine/src/assets/components.rs | 2 +- crates/engine/src/assets/components/rebase.rs | 22 +++++++++++++++++-- crates/engine/src/cmd/file/load.rs | 4 +++- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/crates/engine/src/assets/components.rs b/crates/engine/src/assets/components.rs index 7ddb22427..cb273fc51 100644 --- a/crates/engine/src/assets/components.rs +++ b/crates/engine/src/assets/components.rs @@ -60,7 +60,7 @@ pub use patch::sync_after_edit; pub(crate) use patch::{FULL_REBUILD, PATCHED}; #[cfg(test)] use rebase::RebaseSources; -pub use rebase::rebase_instance; +pub use rebase::{MainPaths, rebase_instance, rebase_instance_with}; pub use sync::keep_text_overrides; pub use variants::{default_variant, exposed_copies, find_variant, mirror_issues, variant_conflicts, variant_name, variant_options, variant_props}; diff --git a/crates/engine/src/assets/components/rebase.rs b/crates/engine/src/assets/components/rebase.rs index ea9cb6f3e..aa782cb20 100644 --- a/crates/engine/src/assets/components/rebase.rs +++ b/crates/engine/src/assets/components/rebase.rs @@ -165,10 +165,28 @@ impl<'a> RebaseSources<'a> { /// values (after detaching an outer instance, restoring a main, or copying a nested instance out): /// the look is kept exactly. Values a component property sets aren't overrides. pub fn rebase_instance(doc: &mut Document, inst: NodeId) { + rebase_instance_with(doc, inst, &mut MainPaths::new()); +} + +/// The layers of mains by path, kept across several [`rebase_instance_with`] calls. Rebasing only +/// writes instances' `source` and `overrides`, never a main's layers or names, so a main's paths +/// stay right for as long as the caller changes nothing else. +pub type MainPaths = BTreeMap>>; + +/// [`rebase_instance`], taking each main's path map from `mains` (and adding it there). +pub fn rebase_instance_with(doc: &mut Document, inst: NodeId, mains: &mut MainPaths) { let Some(NodeKind::Instance { component, .. }) = doc.node(inst).map(|n| n.kind.clone()) else { return }; let mine = path_map(doc, inst, true); - let theirs: BTreeMap = - if doc.contains(component) { path_map(doc, component, false).into_iter().map(|(k, v)| (v, k)).collect() } else { BTreeMap::new() }; + let theirs = mains + .entry(component) + .or_insert_with(|| { + std::rc::Rc::new(if doc.contains(component) { + path_map(doc, component, false).into_iter().map(|(k, v)| (v, k)).collect() + } else { + BTreeMap::new() + }) + }) + .clone(); let value_groups = |a: &Node, b: &Node| -> Vec { diff_groups(a, b).into_iter().filter(|g| !matches!(*g, "size" | "position")).map(str::to_string).collect() }; diff --git a/crates/engine/src/cmd/file/load.rs b/crates/engine/src/cmd/file/load.rs index 3e917d5dd..d03921653 100644 --- a/crates/engine/src/cmd/file/load.rs +++ b/crates/engine/src/cmd/file/load.rs @@ -652,8 +652,10 @@ fn link_instances(doc: &mut Document) { let mut insts: Vec<(usize, NodeId)> = doc.nodes().filter(|n| matches!(n.kind, NodeKind::Instance { .. })).map(|n| (doc.ancestors(n.id).len(), n.id)).collect(); insts.sort_by_key(|a| std::cmp::Reverse(a.0)); + // Rebasing leaves the mains alone, so each main's layer paths are worked out once. + let mut mains = crate::components::MainPaths::new(); for (_, i) in insts { - crate::components::rebase_instance(doc, i); + crate::components::rebase_instance_with(doc, i, &mut mains); } } From 70ed6c1636b1560f8f17d8471f1c2661d06130b7 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Wed, 11 Nov 2026 18:53:53 +0000 Subject: [PATCH 076/101] svg import: budget attribute work over the whole file and DTD, map span offsets in one pass --- crates/svg/src/import.rs | 42 ++++++++++++++++++++------ crates/svg/src/import/hostile_tests.rs | 12 ++++++++ crates/svg/src/import/text.rs | 33 +++++++++++++++----- crates/svg/src/import/text_tests.rs | 2 +- 4 files changed, 71 insertions(+), 18 deletions(-) diff --git a/crates/svg/src/import.rs b/crates/svg/src/import.rs index f77b10bfa..fbdb9b2c1 100644 --- a/crates/svg/src/import.rs +++ b/crates/svg/src/import.rs @@ -714,18 +714,26 @@ pub(crate) fn nesting(data: &[u8], limit: usize) -> usize { scan(data, limit).0 } -/// Whether an element of `data` has more than [`MAX_ATTRIBUTES`] attributes (counted as quoted -/// values, before the parser sees them). +/// The most the parser's duplicate-attribute checks may cost over a whole document, as the sum of +/// each element's attribute count squared (a real file with 100,000 elements of 20 attributes is +/// 40 million). +const MAX_ATTRIBUTE_WORK: usize = 1 << 28; + +/// Whether an element of `data` has more than [`MAX_ATTRIBUTES`] attributes, or all of them cost +/// more than [`MAX_ATTRIBUTE_WORK`] (counted as quoted values, before the parser sees them; the +/// declarations of a DTD count as one element, as entities can hold elements). pub(crate) fn too_wide(data: &[u8]) -> bool { - scan(data, usize::MAX).1 > MAX_ATTRIBUTES + let (_, widest, work) = scan(data, usize::MAX); + widest > MAX_ATTRIBUTES || work > MAX_ATTRIBUTE_WORK } -/// [`nesting`] and the most attribute values on one element; stops once either is past its limit. -fn scan(data: &[u8], limit: usize) -> (usize, usize) { +/// [`nesting`], the most attribute values on one element and the attribute work (see +/// [`MAX_ATTRIBUTE_WORK`]); stops once any is past its limit. +fn scan(data: &[u8], limit: usize) -> (usize, usize, usize) { let find = |from: usize, pat: &[u8]| -> usize { data.get(from..).and_then(|r| r.windows(pat.len()).position(|w| w == pat)).map_or(data.len(), |p| from + p + pat.len()) }; - let (mut depth, mut max, mut i, mut widest) = (0usize, 0usize, 0usize, 0usize); + let (mut depth, mut max, mut i, mut widest, mut work) = (0usize, 0usize, 0usize, 0usize, 0usize); while let Some(off) = data.get(i..).and_then(|r| r.iter().position(|b| *b == b'<')) { i += off; let rest = data.get(i..).unwrap_or(&[]); @@ -733,6 +741,19 @@ fn scan(data: &[u8], limit: usize) -> (usize, usize) { i = find(i + 4, b"-->"); } else if rest.starts_with(b""); + } else if rest.starts_with(b"` closing its subset (the first `>` when it has none). + let end = match (rest.iter().position(|b| *b == b'['), rest.iter().position(|b| *b == b'>')) { + (Some(o), Some(g)) if o < g => find(i, b"]>"), + _ => find(i, b">"), + }; + let quotes = data.get(i..end).unwrap_or(&[]).iter().filter(|b| matches!(**b, b'"' | b'\'')).count(); + widest = widest.max(quotes / 2); + work = work.saturating_add((quotes / 2).saturating_mul(quotes / 2)); + if widest > MAX_ATTRIBUTES || work > MAX_ATTRIBUTE_WORK { + return (max, widest, work); + } + i = end; } else if rest.starts_with(b""); } else if rest.starts_with(b" (usize, usize) { j += 1; } widest = widest.max(attrs); - if widest > MAX_ATTRIBUTES { - return (max, widest); + work = work.saturating_add(attrs * attrs); + if widest > MAX_ATTRIBUTES || work > MAX_ATTRIBUTE_WORK { + return (max, widest, work); } if !closed { depth += 1; max = max.max(depth); if max > limit { - return (max, widest); + return (max, widest, work); } } i = j + 1; } } - (max, widest) + (max, widest, work) } /// Whether `data` nests elements more than [`MAX_NESTING`] deep: the byte scan first, then the diff --git a/crates/svg/src/import/hostile_tests.rs b/crates/svg/src/import/hostile_tests.rs index 16731407c..daeaa085a 100644 --- a/crates/svg/src/import/hostile_tests.rs +++ b/crates/svg/src/import/hostile_tests.rs @@ -193,3 +193,15 @@ fn an_element_with_thousands_of_attributes_is_refused_before_parsing() { let p = d.first_page().unwrap(); assert!(import_svg(&mut d, &svg(&format!("", many(100_000))), p, 0.0, 0.0, "x").is_err()); } + +#[test] +fn attribute_work_is_bounded_over_the_whole_document_and_its_dtd() { + use super::too_wide; + let many = |n: usize| (0..n).map(|i| format!(" a{i}=\"1\"")).collect::(); + let tag = format!("", many(4000)); + assert!(!too_wide(format!("{}", tag.repeat(10)).as_bytes())); + assert!(too_wide(format!("{}", tag.repeat(40)).as_bytes()), "each element is within the limit, all together are not"); + let dtd = format!("'>]>&e;", many(5000)); + assert!(too_wide(dtd.as_bytes()), "entities can hold elements"); + assert!(!too_wide(b"]>")); +} diff --git a/crates/svg/src/import/text.rs b/crates/svg/src/import/text.rs index 7ed8d018f..6f557fb13 100644 --- a/crates/svg/src/import/text.rs +++ b/crates/svg/src/import/text.rs @@ -195,7 +195,7 @@ pub(crate) fn text(cx: &mut Ctx, t: &usvg::Text, parent: NodeId, base: Affine, d let x = chunk.x().map_or(pen_x, f64::from) + d(t.dx()); let y = chunk.y().map_or(pen_y, f64::from) + d(t.dy()); char_at += count; - let ci = char_index(text); + let ci = char_index(text, chunk.spans().iter().flat_map(|sp| [sp.start(), sp.end()])); let spans: Vec<_> = chunk.spans().iter().map(|sp| (ci(sp.start()), ci(sp.end()), sp, span_style(sp, s, fonts))).collect(); if spans.is_empty() { continue; @@ -229,11 +229,30 @@ pub(crate) fn text(cx: &mut Ctx, t: &usvg::Text, parent: NodeId, base: Affine, d } } -/// The characters of `text` before a byte offset (all of them for an offset that is past the end -/// or inside a character), by a search in a table built once: many spans don't rescan the prefix. -fn char_index(text: &str) -> impl Fn(usize) -> usize + '_ { - let starts: Vec = text.char_indices().map(|(i, _)| i).collect(); - move |b| if text.is_char_boundary(b) { starts.partition_point(|s| *s < b) } else { starts.len() } +/// The characters of `text` before each of the byte `offsets` (all of them for an offset that is +/// past the end or inside a character): one pass over the text, whatever the number of spans. +fn char_index(text: &str, offsets: impl IntoIterator) -> impl Fn(usize) -> usize { + let mut want: Vec = offsets.into_iter().collect(); + want.sort_unstable(); + want.dedup(); + let mut found: Vec<(usize, usize)> = Vec::with_capacity(want.len()); + let mut wanted = want.into_iter().peekable(); + let mut count = 0; + for (i, _) in text.char_indices() { + while let Some(&o) = wanted.peek() { + match o.cmp(&i) { + std::cmp::Ordering::Equal => found.push((o, count)), + std::cmp::Ordering::Greater => break, + std::cmp::Ordering::Less => {} + } + wanted.next(); + } + count += 1; + } + if wanted.any(|o| o == text.len()) { + found.push((text.len(), count)); + } + move |b| found.binary_search_by_key(&b, |f| f.0).ok().and_then(|k| found.get(k)).map_or(count, |f| f.1) } /// The text of `lines` (one per line, stacked at their pitch; `s`: their scale): characters, the @@ -269,7 +288,7 @@ fn on_path(cx: &mut Ctx, t: &usvg::Text, world: Affine, parent: NodeId) -> bool let Some(len) = figcraft_geom::measure::polylines(&path).and_then(|l| l.first().map(|l| l.length())).filter(|l| *l > 1e-9) else { return false }; let fonts = cx.fonts.get_or_insert_with(Fonts::load); let text = chunk.text(); - let ci = char_index(text); + let ci = char_index(text, chunk.spans().iter().flat_map(|sp| [sp.start(), sp.end()])); let spans: Vec<_> = chunk.spans().iter().map(|sp| (ci(sp.start()), ci(sp.end()), sp, span_style(sp, 1.0, fonts))).collect(); let line = Line { x: 0.0, y: 0.0, anchor: chunk.anchor(), text: text.to_string(), spans }; let mut td = text_data(std::slice::from_ref(&line), 1.0); diff --git a/crates/svg/src/import/text_tests.rs b/crates/svg/src/import/text_tests.rs index 94c6ae5b2..c43bd7f9e 100644 --- a/crates/svg/src/import/text_tests.rs +++ b/crates/svg/src/import/text_tests.rs @@ -34,7 +34,7 @@ fn css_system_font_names_keep_their_name_where_the_system_font_is() { #[test] fn char_index_counts_the_characters_before_a_byte_offset() { let t = "aé😀b"; - let ci = super::char_index(t); + let ci = super::char_index(t, [0, 1, 3, 7, 8, 2, 4, 99]); assert_eq!([ci(0), ci(1), ci(3), ci(7), ci(8)], [0, 1, 2, 3, 4]); assert_eq!([ci(2), ci(4), ci(99)], [4, 4, 4], "inside a character or past the end: all of them"); } From 9d48625995fc63c99e0164e424f78bcea3ac8a47 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Wed, 11 Nov 2026 18:57:25 +0000 Subject: [PATCH 077/101] layout: leave out a grid that would pass the snap budget --- crates/layout/src/depth_tests.rs | 2 +- crates/layout/src/lib.rs | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/crates/layout/src/depth_tests.rs b/crates/layout/src/depth_tests.rs index b533c7e42..20e022817 100644 --- a/crates/layout/src/depth_tests.rs +++ b/crates/layout/src/depth_tests.rs @@ -102,6 +102,6 @@ fn snap_lines_are_bounded_across_a_frames_grids() { let f = d.create(p, NodeKind::Frame, "F", 0.0, 0.0, 4000.0, 4000.0).unwrap(); d.get_mut(f).unwrap().grids = vec![LayoutGrid { kind: GridKind::Grid, size: 1.0, visible: true, ..LayoutGrid::default() }; 1000]; let (xs, ys) = crate::grid_snap_lines(&d, f); - assert!(xs.len() + ys.len() < 250_000, "{}", xs.len() + ys.len()); + assert!(xs.len() + ys.len() <= 200_000, "{}", xs.len() + ys.len()); assert!(xs.len() > 4000 && ys.len() > 4000, "the first grids still give their lines"); } diff --git a/crates/layout/src/lib.rs b/crates/layout/src/lib.rs index 04abbc39a..b3d8e27f0 100644 --- a/crates/layout/src/lib.rs +++ b/crates/layout/src/lib.rs @@ -1169,11 +1169,13 @@ pub fn grid_snap_lines_in(doc: &Document, frame: NodeId, xf: Affine) -> (Vec= MAX_SNAP_LINES { + // A frame-wide budget: each grid adds up to ~17,000 lines, and a file can hold any number of grids; + // a grid that would pass it is left out whole. + let lines = grid_lines(g, f.width, f.height); + if xs.len() + ys.len() + 2 * lines.len() > MAX_SNAP_LINES { break; } - for r in grid_lines(g, f.width, f.height) { + for r in lines { let a = xf * Point::new(r.x0, r.y0); let b = xf * Point::new(r.x1, r.y1); match g.kind { From 2cfd2a3531e7df2dae4d9821b1b733756b659eb0 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Wed, 11 Nov 2026 19:16:24 +0000 Subject: [PATCH 078/101] collab-net: hand the sync client the bounded roster; assert the kept prefixes --- crates/collab-net/src/client_cap_tests.rs | 26 +++++++++++++++++++++-- crates/collab-net/src/join.rs | 4 ++++ 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/crates/collab-net/src/client_cap_tests.rs b/crates/collab-net/src/client_cap_tests.rs index 73f181774..5af7c7a2f 100644 --- a/crates/collab-net/src/client_cap_tests.rs +++ b/crates/collab-net/src/client_cap_tests.rs @@ -4,7 +4,7 @@ use std::sync::{Arc, Mutex}; -use figcraft_collab::message::{Peer, Presence, ServerMsg}; +use figcraft_collab::message::{Access, CatchUp, Peer, Presence, Processed, ServerMsg}; use figcraft_engine::live::{Event, MAX_PEERS}; use crate::guest::GuestConfig; @@ -69,7 +69,29 @@ fn a_hosts_long_names_and_colours_are_cut_where_they_are_kept() { let long = "x".repeat(100_000); take(ServerMsg::PeerJoined(Peer { client_id: 1, name: long.clone(), color: long }), &cfg, &inbox, &mut seen, &resume, &|| {}); match inbox.drain().as_slice() { - [Event::PeerJoined(p)] => assert!(p.name.chars().count() <= 256 && p.color.chars().count() <= 32), + [Event::PeerJoined(p)] => assert_eq!((p.name.as_str(), p.color.as_str()), ("x".repeat(256).as_str(), "x".repeat(32).as_str())), other => panic!("{other:?}"), } } + +#[test] +fn the_welcome_handed_to_the_sync_client_carries_the_bounded_roster() { + let inbox = inbox(); + let cfg = GuestConfig::new(Invite::new("127.0.0.1:47900", "0123456789abcdef", "AbCdEfGhIjKlMnOpQrStUv"), "Ada".into()); + let resume = Mutex::new(None); + let long = "y".repeat(100_000); + let welcome = ServerMsg::Welcome { + session: 1, + client_id: 9, + seq: 0, + catch_up: CatchUp::Snapshot(Vec::new()), + processed: Processed::default(), + peers: vec![Peer { client_id: 1, name: long.clone(), color: long }], + access: Access::default(), + secret: 0, + }; + take(welcome, &cfg, &inbox, &mut Seen::default(), &resume, &|| {}); + let events = inbox.drain(); + let Some(Event::Sync(ServerMsg::Welcome { peers, .. })) = events.iter().find(|e| matches!(e, Event::Sync(_))) else { panic!("{events:?}") }; + assert_eq!(peers.first().map(|p| (p.name.chars().count(), p.color.chars().count())), Some((256, 32))); +} diff --git a/crates/collab-net/src/join.rs b/crates/collab-net/src/join.rs index 5982ed6e8..b5de889f9 100644 --- a/crates/collab-net/src/join.rs +++ b/crates/collab-net/src/join.rs @@ -281,6 +281,10 @@ pub(crate) fn take(mut m: ServerMsg, cfg: &GuestConfig, inbox: &Inbox, seen: &mu view: None, }; seen.peers = peers.clone(); + // The sync client keeps the roster of the welcome it is handed: the bounded one. + if let ServerMsg::Welcome { peers: sent, .. } = &mut m { + sent.clone_from(&peers); + } seen.info = Some(info.clone()); welcomed(); inbox.push(Event::Welcome { info, peers }); From 74698fa89fb1219d219a9e1bbd102f1154f4cedd Mon Sep 17 00:00:00 2001 From: Oleksii Sukholita <72558888+aleksei-suholita@users.noreply.github.com> Date: Wed, 11 Nov 2026 20:23:45 +0100 Subject: [PATCH 079/101] M7: links open in the browser in the desktop app, What's new on the update prompt among them (#2216) The desktop app built eframe without its `links` feature, so egui-winit dropped every `ctx.open_url` with only a log warning: the update prompt's What's new link and Download button, the About and Credits links, Terms in Live and the link in the Dev Mode panel did nothing on click. The feature adds no crate: `webbrowser` is already a dependency of the app. DeckCraft's desktop app builds eframe with it too. `links_in_the_interface_open_in_the_browser` fails without the feature. Co-authored-by: Oleksii Sukholita --- Cargo.lock | 1 + apps/figcraft/Cargo.toml | 4 +++- apps/figcraft/src/services_tests.rs | 10 ++++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 73d4d60fb..6714be11b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1547,6 +1547,7 @@ dependencies = [ "raw-window-handle", "smithay-clipboard", "web-time", + "webbrowser", "windows-sys 0.61.2", "winit", ] diff --git a/apps/figcraft/Cargo.toml b/apps/figcraft/Cargo.toml index f2ea73ba8..386cb1f33 100644 --- a/apps/figcraft/Cargo.toml +++ b/apps/figcraft/Cargo.toml @@ -23,7 +23,9 @@ craft-window = { workspace = true } # The suite's settings folder: `FIGCRAFT_CONFIG_DIR`, a portable marker, then the platform folder. craft-settings = { workspace = true } egui = { workspace = true } -eframe = { workspace = true, features = ["default_fonts", "wgpu", "accesskit", "clipboard", "wayland", "x11"] } +# `links`: without it eframe drops every `ctx.open_url` and hyperlink click (the update prompt's +# What's new and Download, About, Credits) with only a log warning. +eframe = { workspace = true, features = ["default_fonts", "wgpu", "accesskit", "clipboard", "links", "wayland", "x11"] } serde_json = { workspace = true } log = { workspace = true } rfd = { workspace = true } diff --git a/apps/figcraft/src/services_tests.rs b/apps/figcraft/src/services_tests.rs index 970f1729e..0d197f5ce 100644 --- a/apps/figcraft/src/services_tests.rs +++ b/apps/figcraft/src/services_tests.rs @@ -142,3 +142,13 @@ fn the_next_dialog_starts_in_the_folder_of_the_last_pick() { let _ = std::fs::remove_dir_all(&dir); assert_eq!(start_folder(Some(dir)), None, "a folder deleted since: the system's own"); } + +/// The update prompt's What's new and Download, and the About and Credits links, open through +/// `ctx.open_url`. eframe drops those with only a log warning unless it is built with `links`. +#[test] +fn links_in_the_interface_open_in_the_browser() { + let manifest = include_str!("../Cargo.toml"); + let eframe: Vec<&str> = manifest.lines().filter(|l| l.trim_start().starts_with("eframe =")).collect(); + assert!(!eframe.is_empty(), "the app depends on eframe"); + assert!(eframe.iter().any(|l| l.contains("\"links\"")), "eframe is built with `links`: {eframe:?}"); +} From b190e675b9446d8f0090ae928eff485411522233 Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Wed, 11 Nov 2026 14:34:56 -0500 Subject: [PATCH 080/101] M4: a list item made by Enter has no start of its own, so a split list restarts at 1, as measured Enter copied the item's start (a typed "5. " gives 4) onto the new item, so once a middle item was unlisted the next one restarted at its copied start. Every paragraph an insertion creates now has start_offset 0; the first item keeps its start. Measured in Figma: unlisting "b" in 5. 6. 7. leaves "c" at 1., and the same for a list started with 1. Co-Authored-By: Claude Sonnet 5.5 Model-Effort: Opus 5.5 drove; Opus 5.5 briefed; Sonnet 5.5 wrote at medium --- crates/engine/src/canvas/textedit.rs | 8 +++++ crates/engine/src/text_tail_tests.rs | 50 ++++++++++++++++++++++++++-- 2 files changed, 55 insertions(+), 3 deletions(-) diff --git a/crates/engine/src/canvas/textedit.rs b/crates/engine/src/canvas/textedit.rs index 0f82330af..f726cc7ab 100644 --- a/crates/engine/src/canvas/textedit.rs +++ b/crates/engine/src/canvas/textedit.rs @@ -319,6 +319,14 @@ fn insert_model(s: &mut Session, text: &str, ime_commit: bool) -> Result NodeId { + let t = text(s, "x"); + s.execute("node.set", &json!({"id": t, "props": {"characters": ""}})).unwrap(); + begin(s, t, Some(0), false).unwrap(); + for c in first.chars() { + insert(s, &c.to_string()).unwrap(); + } + for step in ["Enter", "b", "Enter", "c"] { + if step == "Enter" { + key(s, step, false, false, false).unwrap(); + } else { + insert(s, step).unwrap(); + } + } + t +} + +#[test] +fn a_list_split_by_unlisting_a_middle_item_restarts_at_one() { + // As measured in Figma (2026-11-11): typed "5. a", Enter, "b", Enter, "c" reads 5. 6. 7.; + // Backspace at the start of "b" takes its marker and "c" then reads 1., for "1. " too. + // `list_markers` counts on after a numbered item and restarts a numbered item that follows a + // plain paragraph at its own start, so the starts and the neighbours give the markers. + for (first, start) in [("5. a", 4), ("1. a", 0)] { + let mut s = Session::new(); + let t = three_typed_items(&mut s, first); + assert_eq!( + data(&s, t).characters, + "a +b +c" + ); + // The guard: unsplit, "b" and "c" go on counting (5. 6. 7.). + let d = data(&s, t); + assert_eq!(lists(&s, t), [(N, 0); 3], "{first}: no split"); + assert_eq!((d.para_list(0).start_offset, d.para_list(1).start_offset, d.para_list(2).start_offset), (start, 0, 0), "{first}"); + set_caret(&mut s, 2, false).unwrap(); + key(&mut s, "Backspace", false, false, false).unwrap(); + let d = data(&s, t); + assert_eq!(lists(&s, t), [(N, 0), (P, 0), (N, 0)], "{first}: split"); + assert_eq!(d.para_list(2).start_offset, 0, "{first}: c restarts at 1 (the item made by Enter has no start)"); + } +} + #[test] fn list_keys_at_list_items() { // (chars, lists before, caret, key, shift, chars after, lists after, derivation) From 14670b99d4bf43b563ee504fc49dea2832b5e9b9 Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Wed, 11 Nov 2026 14:42:37 -0500 Subject: [PATCH 081/101] M3: an instance lists the properties its variant uses; long property names stay on one line (#2022) In Figma's data a component set holds one text property per variant (plus leftovers of deleted variants), and an instance lists only the ones its current variant's layers read (measured in Figma's web app). FigCraft listed every definition on every instance, and wrapped a long property name inside an 84 x 20 box so its lines painted over the rows around it. - components::instance_prop_list: prop_list keeping slots and the properties a layer of the component references (a nested instance counts, its layers and slot content are not entered). component.properties and the Properties panel use it for instances; sets, components and variants still list every definition. - prop_label cuts the name to one line with an ellipsis and shows the full name on hover. - Tests: an_instance_lists_only_the_properties_its_variant_uses, a_long_property_name_stays_on_one_line, and the pin a_set_keeps_each_named_text_definition_and_layers_read_their_own. Two tests and one setup that listed an unbound boolean on an instance now bind it to a layer. - docs/components-parity.md: the properties row, header and revision history. Co-Authored-By: Claude Sonnet 5.5 Model-Effort: Opus 5.5 drove; Fable 5.1 briefed; Sonnet 5.5 wrote at medium --- crates/engine/src/assets/components.rs | 24 +++++++++++ crates/engine/src/assets/components/tests.rs | 5 ++- crates/engine/src/cmd/component/props.rs | 5 ++- crates/engine/src/prop_order_tests.rs | 27 ++++++++++++- crates/format/src/fig/prop_value_tests.rs | 40 +++++++++++++++++++ .../src/component_props_reorder_tests.rs | 31 +++++++++++++- crates/ui-egui/src/export_name_tests.rs | 2 +- crates/ui-egui/src/panels/component_panel.rs | 14 ++++--- docs/components-parity.md | 5 ++- 9 files changed, 140 insertions(+), 13 deletions(-) diff --git a/crates/engine/src/assets/components.rs b/crates/engine/src/assets/components.rs index 7ddb22427..a5016dc39 100644 --- a/crates/engine/src/assets/components.rs +++ b/crates/engine/src/assets/components.rs @@ -298,6 +298,30 @@ pub fn prop_list(doc: &Document, c: NodeId) -> Vec<(String, PropDef)> { } } +/// The properties an instance of `component` lists: [`prop_list`] without the boolean, text and +/// instance swap properties that no layer of the component reads. A set's variants share its +/// definitions, so one a variant's layers don't bind (another variant's text, a leftover of a +/// deleted variant) stays defined, and shows on the set, but not on this variant's instances +/// (#2022). Slots stay. Walks as [`slots_of`] does: a nested instance counts, its own layers and +/// the content put into slots are not entered. +pub fn instance_prop_list(doc: &Document, component: NodeId) -> Vec<(String, PropDef)> { + let mut used: std::collections::HashSet = std::collections::HashSet::new(); + let mut stack = vec![component]; + let mut seen = 0usize; + while let Some(c) = stack.pop() { + seen += 1; + if seen > 1_000_000 { + break; + } + let Some(n) = doc.node(c) else { continue }; + used.extend(n.prop_refs.values().cloned()); + if c == component || (!is_instance(doc, c) && !holds_content(n)) { + stack.extend(n.children.iter().rev().copied()); + } + } + prop_list(doc, component).into_iter().filter(|(k, d)| !takes_value(d) || used.contains(k)).collect() +} + /// Whether instances store a value for the property (every kind but slots). pub fn takes_value(d: &PropDef) -> bool { !matches!(d, PropDef::Slot { .. }) diff --git a/crates/engine/src/assets/components/tests.rs b/crates/engine/src/assets/components/tests.rs index ffaac176f..fc7d21e86 100644 --- a/crates/engine/src/assets/components/tests.rs +++ b/crates/engine/src/assets/components/tests.rs @@ -395,8 +395,11 @@ fn unbind_delete_and_vary(s: &mut Session, c: NodeId, i: NodeId, title: NodeId, ex(s, "component.deleteProperty", json!({"id": c, "name": "Heading"})); assert!(node(s, title).prop_refs.is_empty()); assert!(matches!(&node(s, i).kind, NodeKind::Instance { props, .. } if !props.contains_key("Heading"))); - let desc = ex(s, "component.properties", json!({"id": i})); + // "Show dot" is still defined but no layer reads it any more: the main lists it, the instance doesn't (#2022). + let desc = ex(s, "component.properties", json!({"id": c})); assert_eq!(desc["properties"].as_array().unwrap().len(), 1); + let desc = ex(s, "component.properties", json!({"id": i})); + assert!(desc["properties"].as_array().unwrap().is_empty()); // A variant property on a lone component makes it a component set. let set = idv(&ex(s, "component.addProperty", json!({"id": c, "name": "Theme", "type": "variant", "default": "Light"}))); assert!(matches!(node(s, set).kind, NodeKind::ComponentSet { .. })); diff --git a/crates/engine/src/cmd/component/props.rs b/crates/engine/src/cmd/component/props.rs index 2d97d6f0a..97bef3ce2 100644 --- a/crates/engine/src/cmd/component/props.rs +++ b/crates/engine/src/cmd/component/props.rs @@ -8,7 +8,7 @@ use super::{ req_string, req_targets, set_boolean_default, slot_edited, slots_of, string, takes_value, targets, variant_conflicts, variant_name, variant_options, variant_props, variant_set, }; -use crate::components::prop_list; +use crate::components::{instance_prop_list, prop_list}; /// Whether instance `id` has a component property `name` that a `kind` variable can drive (a /// boolean property takes a boolean variable, a text or variant property a string one). @@ -606,7 +606,8 @@ pub(crate) fn describe_props(doc: &Document, id: NodeId) -> Value { } // Slots: the frames (on a main) or this instance's copy, with whether it holds its own content. let slots = slots_of(doc, if values.is_some() { id } else { variant_set(doc, comp).unwrap_or(comp) }); - for (k, d) in prop_list(doc, comp) { + let defs = if values.is_some() { instance_prop_list(doc, comp) } else { prop_list(doc, comp) }; + for (k, d) in defs { let mut v = def_json(&k, &d); if !takes_value(&d) { let layers: Vec = slots.iter().filter(|(_, n)| *n == k).map(|(l, _)| *l).collect(); diff --git a/crates/engine/src/prop_order_tests.rs b/crates/engine/src/prop_order_tests.rs index 02f329e15..3b996e250 100644 --- a/crates/engine/src/prop_order_tests.rs +++ b/crates/engine/src/prop_order_tests.rs @@ -77,8 +77,9 @@ fn every_kind_of_property_keeps_its_place_on_rename() { let icon = idv(&ex(&mut s, "component.create", json!({"ids": [icon_f]}))); let nested = idv(&ex(&mut s, "instance.create", json!({"component": icon, "x": 60, "y": 10, "parent": f}))); let small = idv(&ex(&mut s, "component.create", json!({"ids": [f]}))); + let zoom_layer = idv(&ex(&mut s, "shape.rectangle", json!({"x": 150, "y": 10, "width": 10, "height": 10, "parent": small}))); // Made in an order that isn't by name: Zoom (boolean), Label (text), Glyph (instance swap), Body (slot). - ex(&mut s, "component.addProperty", json!({"id": small, "name": "Zoom", "type": "boolean"})); + ex(&mut s, "component.addProperty", json!({"id": small, "name": "Zoom", "type": "boolean", "layer": zoom_layer})); ex(&mut s, "component.addProperty", json!({"id": small, "name": "Label", "type": "text", "layer": label})); ex(&mut s, "component.addProperty", json!({"id": small, "name": "Glyph", "type": "instanceSwap", "layer": nested})); ex(&mut s, "component.makeSlot", json!({"id": body})); @@ -133,3 +134,27 @@ fn make_slot_takes_the_name_typed() { by_name.sort(); assert_eq!(listed, by_name); } + +/// An instance lists the properties its own variant's layers use (#2022): in Figma's data a set +/// has one text property per variant (and leftovers of deleted ones), measured: an instance of +/// variant A lists `State` and `A label`, never `B label` or a property no layer reads. +#[test] +fn an_instance_lists_only_the_properties_its_variant_uses() { + let mut s = Session::new(); + let mut variants = Vec::new(); + let mut texts = Vec::new(); + for (k, name) in ["Type=Flag, State=Default", "Type=Flag, State=Selected"].iter().enumerate() { + let f = idv(&ex(&mut s, "frame.create", json!({"x": 0, "y": k * 60, "width": 120, "height": 40, "name": name}))); + texts.push(idv(&ex(&mut s, "text.create", json!({"text": "Label", "x": 4, "y": 4, "parent": f, "name": "Label"})))); + variants.push(idv(&ex(&mut s, "component.create", json!({"ids": [f]})))); + } + let set = idv(&ex(&mut s, "component.combineVariants", json!({"ids": variants}))); + ex(&mut s, "component.addProperty", json!({"id": set, "name": "Default label", "type": "text", "layer": texts[0]})); + ex(&mut s, "component.addProperty", json!({"id": set, "name": "Selected label", "type": "text", "layer": texts[1]})); + ex(&mut s, "component.addProperty", json!({"id": set, "name": "Gone label", "type": "text"})); + assert_eq!(names(&mut s, set), ["Type", "State", "Default label", "Selected label", "Gone label"], "the set keeps every definition"); + let inst = idv(&ex(&mut s, "instance.create", json!({"component": variants[0], "x": 400, "y": 0}))); + assert_eq!(names(&mut s, inst), ["Type", "State", "Default label"]); + ex(&mut s, "instance.setProperties", json!({"ids": [inst], "properties": {"State": "Selected"}})); + assert_eq!(names(&mut s, inst), ["Type", "State", "Selected label"]); +} diff --git a/crates/format/src/fig/prop_value_tests.rs b/crates/format/src/fig/prop_value_tests.rs index 24248d32a..150cac39a 100644 --- a/crates/format/src/fig/prop_value_tests.rs +++ b/crates/format/src/fig/prop_value_tests.rs @@ -186,3 +186,43 @@ fn property_values_written_only_as_variables_are_applied() { assert_eq!(props.get("Hint"), Some(&Value::Bool(false))); assert_eq!(props.get("Label"), Some(&Value::String("Name on card".into()))); } + +/// #2022: a set keeps each named text definition under its own name (Figma writes one per variant, +/// plus leftovers of deleted variants), and each variant's text reads its own copy. +#[test] +fn a_set_keeps_each_named_text_definition_and_layers_read_their_own() { + let text = |chars: &str| o(vec![("textValue", o(vec![("characters", s(chars))]))]); + let names = ["Type=Flag / State=Default label", "Type=Flag / State=Selected label", "Type=Issue / State=Default label"]; + let set_defs: Vec> = + names.iter().zip([70, 71, 72]).zip(["One", "Two", "Gone"]).map(|((n, id), c)| definition(id, n, "TEXT", text(c))).collect(); + let copies = |first: u32| Kv::Array((0..3).map(|k| o(vec![("id", g(first + k)), ("parentPropDefId", g(70 + k))])).collect()); + let msg = message(vec![ + node(9, "FRAME", "Chip", Some(2), vec![("isStateGroup", Kv::Bool(true)), ("componentPropDefs", Kv::Array(set_defs))]), + node(10, "SYMBOL", "Type=Flag, State=Default", Some(9), vec![("componentPropDefs", copies(80))]), + node(11, "TEXT", "Label", Some(10), vec![bound("TEXT_DATA", 80)]), + node(20, "SYMBOL", "Type=Flag, State=Selected", Some(9), vec![("componentPropDefs", copies(90))]), + node(21, "TEXT", "Label", Some(20), vec![bound("TEXT_DATA", 91)]), + ]); + let (rest, _, _) = to_rest(&msg, "Synthetic", crate::rest::MAX_NODES); + let defs = &by_id(&rest["document"], "9:9")["componentPropertyDefinitions"]; + for (k, n) in names.iter().enumerate() { + assert_eq!(defs[format!("{n}#9:{}", 70 + k)]["type"], "TEXT", "{n}"); + } + assert_eq!(defs.as_object().map(|d| d.len()), Some(3), "{defs}"); + assert_eq!(by_id(&rest["document"], "9:11")["componentPropertyReferences"]["characters"], format!("{}#9:70", names[0])); + assert_eq!(by_id(&rest["document"], "9:21")["componentPropertyReferences"]["characters"], format!("{}#9:71", names[1])); + + let (doc, _) = crate::rest::import_fig(&rest, &crate::rest::no_images).unwrap(); + let refs: Vec> = doc + .ids() + .filter_map(|id| doc.node(id)) + .filter(|n| n.name == "Label" && n.source.is_none()) + .map(|n| n.prop_refs.get("characters").cloned()) + .collect(); + assert_eq!(refs.len(), 2, "{refs:?}"); + assert!(refs.contains(&Some(names[0].to_string())) && refs.contains(&Some(names[1].to_string())), "{refs:?}"); + for set in doc.ids().filter_map(|id| doc.node(id)).filter(|n| matches!(n.kind, NodeKind::Component { .. })) { + let NodeKind::Component { props, .. } = &set.kind else { continue }; + assert!(names.iter().all(|n| props.contains_key(*n)), "{} holds {:?}", set.name, props.keys().collect::>()); + } +} diff --git a/crates/ui-egui/src/component_props_reorder_tests.rs b/crates/ui-egui/src/component_props_reorder_tests.rs index 729185ce7..cc12489d0 100644 --- a/crates/ui-egui/src/component_props_reorder_tests.rs +++ b/crates/ui-egui/src/component_props_reorder_tests.rs @@ -19,12 +19,19 @@ fn id(v: serde_json::Value) -> NodeId { fn setup() -> (Ui, NodeId, NodeId) { let mut s = Session::new(); let mut variants = Vec::new(); + let mut icons = Vec::new(); for (k, name) in ["Size=Small, State=Default", "Size=Large, State=Default", "Size=Small, State=Hover"].iter().enumerate() { let f = id(s.execute("frame.create", &json!({"x": 0, "y": k * 60, "width": 80, "height": 40, "name": name})).unwrap()); + // A layer in every variant reads "Icon": an instance lists only the properties its variant uses. + let icon = id(s.execute("shape.rectangle", &json!({"x": 4, "y": 4, "width": 10, "height": 10, "parent": f})).unwrap()); + icons.push(icon); variants.push(id(s.execute("component.create", &json!({"ids": [f]})).unwrap())); } let set = id(s.execute("component.combineVariants", &json!({"ids": variants})).unwrap()); - s.execute("component.addProperty", &json!({"id": set, "name": "Icon", "type": "boolean", "default": true})).unwrap(); + s.execute("component.addProperty", &json!({"id": set, "name": "Icon", "type": "boolean", "default": true, "layer": icons[0]})).unwrap(); + for icon in &icons[1..] { + s.execute("component.bindProperty", &json!({"layer": icon, "property": "Icon"})).unwrap(); + } let inst = id(s.execute("instance.create", &json!({"component": set, "x": 400, "y": 0})).unwrap()); s.execute("select.set", &json!({"ids": [set]})).unwrap(); (Ui::new(s), set, inst) @@ -123,3 +130,25 @@ fn escape_cancels_a_property_drag_and_keeps_the_selection() { assert_eq!(undo_len(&u), undo); assert_eq!(u.app.session.ds().unwrap().selection, [set], "the Escape only cancels the drag"); } + +/// A long property name is cut to one line inside its label box instead of wrapping over the rows +/// above and below (#2022); the name itself stays whole. +#[test] +fn a_long_property_name_stays_on_one_line() { + let long = "Flag Default label with a long name"; + let mut s = Session::new(); + let f = id(s.execute("frame.create", &json!({"x": 0, "y": 0, "width": 120, "height": 40, "name": "Chip"})).unwrap()); + let t = id(s.execute("text.create", &json!({"text": "Label", "x": 4, "y": 4, "parent": f})).unwrap()); + let c = id(s.execute("component.create", &json!({"ids": [f]})).unwrap()); + s.execute("component.addProperty", &json!({"id": c, "name": long, "type": "text", "layer": t})).unwrap(); + let inst = id(s.execute("instance.create", &json!({"component": c, "x": 400, "y": 0})).unwrap()); + s.execute("select.set", &json!({"ids": [inst]})).unwrap(); + let mut u = Ui::new(s); + let texts = crate::export_name_tests::painted(&mut u); + let panel = u.app.ui.right_panel_rect.expect("the right panel shows"); + let labels: Vec<(String, egui::Rect)> = texts.into_iter().filter(|(t, r)| t.starts_with("Flag") && r.min.x >= panel.min.x).collect(); + let [(text, rect)] = labels.as_slice() else { panic!("one property label: {labels:?}") }; + assert!(text.ends_with('…'), "cut with an ellipsis, not {text:?}"); + assert!(rect.height() <= crate::widgets::FIELD_H, "one line, not {} tall", rect.height()); + assert_eq!(names(&mut u, inst), [long], "the name itself stays whole"); +} diff --git a/crates/ui-egui/src/export_name_tests.rs b/crates/ui-egui/src/export_name_tests.rs index 3f85374aa..f66a51665 100644 --- a/crates/ui-egui/src/export_name_tests.rs +++ b/crates/ui-egui/src/export_name_tests.rs @@ -10,7 +10,7 @@ use crate::layers_drag_tests::Ui; use crate::widgets::FIELD_H; /// The text painted this frame, with each piece's box. -fn painted(u: &mut Ui) -> Vec<(String, Rect)> { +pub(crate) fn painted(u: &mut Ui) -> Vec<(String, Rect)> { fn walk(shape: &Shape, out: &mut Vec<(String, Rect)>) { match shape { Shape::Text(t) => out.push((t.galley.text().to_string(), t.visual_bounding_rect())), diff --git a/crates/ui-egui/src/panels/component_panel.rs b/crates/ui-egui/src/panels/component_panel.rs index 048071e3f..94d127387 100644 --- a/crates/ui-egui/src/panels/component_panel.rs +++ b/crates/ui-egui/src/panels/component_panel.rs @@ -14,8 +14,8 @@ use egui::{Id, Sense, Ui, vec2}; use figcraft_doc::{Document, Node, NodeId, NodeKind, PropDef, VariableType}; use figcraft_engine::cmd::component::{can_add_variant, can_combine_variants}; use figcraft_engine::components::{ - PROP_BINDING, default_variant, inside_instance, owning_component, owning_instance, prop_list, slot_def, slot_edited, slots_of, variant_conflicts, - variant_options, variant_props, variant_set, + PROP_BINDING, default_variant, inside_instance, instance_prop_list, owning_component, owning_instance, prop_list, slot_def, slot_edited, + slots_of, variant_conflicts, variant_options, variant_props, variant_set, }; use serde_json::{Value, json}; @@ -748,7 +748,7 @@ fn instance_props(app: &mut FigApp, ui: &mut Ui, doc: &Document, n: &Node, comps } } // Boolean, text and instance-swap properties. - for (k, d) in prop_list(doc, *component) { + for (k, d) in instance_prop_list(doc, *component) { let v = props.get(&k).cloned().unwrap_or_else(|| figcraft_engine::components::prop_default_value(&d)); row(ui, 32.0, |ui| { prop_label(ui, &k, type_icon(&d)); @@ -968,8 +968,12 @@ fn comp_rows(ui: &mut Ui, found: &CompSearch, checked: &impl Fn(NodeId) -> bool) fn prop_label(ui: &mut Ui, name: &str, icon: Icon) { let t = Tokens::get(ui.ctx()); - let (r, _) = ui.allocate_exact_size(vec2(84.0, 20.0), Sense::hover()); + let (r, resp) = ui.allocate_exact_size(vec2(84.0, 20.0), Sense::hover()); icons::paint(ui.painter(), egui::Rect::from_min_size(egui::pos2(r.min.x, r.center().y - 6.0), vec2(12.0, 12.0)), icon, t.icon_secondary); - let g = ui.painter().layout(name.to_string(), crate::theme::regular(11.0), t.text_secondary, r.width() - 18.0); + let shown = widgets::elide(ui, name, r.width() - 18.0); + let g = ui.painter().layout_no_wrap(shown.clone(), crate::theme::regular(11.0), t.text_secondary); ui.painter().galley(egui::pos2(r.min.x + 18.0, r.center().y - g.size().y / 2.0), g, t.text_secondary); + if shown != name { + resp.on_hover_text(name); + } } diff --git a/docs/components-parity.md b/docs/components-parity.md index 8fcaea78a..d8d20aaab 100644 --- a/docs/components-parity.md +++ b/docs/components-parity.md @@ -1,6 +1,6 @@ # Components, variants, styles and variables parity -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-06 · **Change:** minor (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 renamed, and Make slot asks for the slot's name first (#1536, #1537); components can't contain their own instances, directly or through others (#1084); the instance-swap menus have a search field (#1338); an instance-swap property's default menu scrolls (#1338); variables on a text style's fields from the style editor; instance-swap properties in the component playground; duplicating or Alt-dragging a main component makes an instance of it (#892); a bound colour variable's alpha applies once (#802); variables import reads `variables` outside `meta` and warns when it imports none (#790); variant properties reorder by drag; library files saved right after a read are read again; Hide when publishing note corrected; size and resizing overrides of layers inside instances (#731); variables export in the browser as a download; core editor leftovers: component playground, variables inside styles; layers and assets panels behaviour suite and fixes; extended collections tail; styles and variables behaviour suite and fixes; components behaviour suite and fixes; team libraries on the server, library usage and swapping a library; extended collections, variables import/export, gradient stops and variant properties bound to variables) · **Target:** Figma Design (desktop app 126.10.7) +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-11 · **Change:** minor (an instance lists only the properties its variant's layers use and long property names are cut to one line (#2022); 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 renamed, and Make slot asks for the slot's name first (#1536, #1537); components can't contain their own instances, directly or through others (#1084); the instance-swap menus have a search field (#1338); an instance-swap property's default menu scrolls (#1338); variables on a text style's fields from the style editor; instance-swap properties in the component playground; duplicating or Alt-dragging a main component makes an instance of it (#892); a bound colour variable's alpha applies once (#802); variables import reads `variables` outside `meta` and warns when it imports none (#790); variant properties reorder by drag; library files saved right after a read are read again; Hide when publishing note corrected; size and resizing overrides of layers inside instances (#731); variables export in the browser as a download; core editor leftovers: component playground, variables inside styles; layers and assets panels behaviour suite and fixes; extended collections tail; styles and variables behaviour suite and fixes; components behaviour suite and fixes; team libraries on the server, library usage and swapping a library; extended collections, variables import/export, gradient stops and variant properties bound to variables) · **Target:** Figma Design (desktop app 126.10.7) 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 @@ -12,6 +12,7 @@ accounts). | Feature | Status | Notes | |---|---|---| +| 2026-11-11 | minor | M3, #2022: an instance lists only the properties its variant's layers use (its variant properties, slots, and the boolean, text and instance swap properties a layer of its current variant reads), as measured in Figma's web app: an instance of variant A lists `State` and `A label`, never `B label` or a property no layer reads. The set and its variants still list every definition, so unused ones can be deleted there. A long property name in the panel is cut to one line with an ellipsis, the full name on hover, instead of wrapping over the rows around it. Tests: `prop_order_tests::an_instance_lists_only_the_properties_its_variant_uses`, `component_props_reorder_tests::a_long_property_name_stays_on_one_line`, `prop_value_tests::a_set_keeps_each_named_text_definition_and_layers_read_their_own`. Grade unchanged. | | Create component, instances, detach, reset, go to main, restore main, push changes | done | push from a nested layer goes to the outer main | | Per-layer overrides with reset; kept across main edits, nested swaps, copy/paste | done | main edits match a full rebuild exactly at 2,000 instances | | What an instance overrides: fills, strokes, effects, visibility, layer names, text content and every text property (resizing included), auto layout padding, gap and alignment, layout grids, export settings, prototype interactions, nested swaps and property values; the size and resizing (hug, fill, fixed, min and max) of layers inside it | done | each kept when the main changes that property, reset per group; opacity and corner radius too (documentation silent); size and resizing are kept through relayout, undo, save, `.fig` and REST import and detach, and stay with the instance on push | @@ -22,7 +23,7 @@ accounts). | Switching variants keeps overrides where names match and both variants had the same value; text layers keep theirs | done | | | Default variant: the top-left one (new instances, Assets thumbnail, generated code) | done | | | Variant property order (names rewritten), duplicate combinations reported | done | drag a property in the Properties section to reorder it, one undo step (#679), or `component.editProperty {index}` | -| Properties: boolean, text, instance swap (preferred values), variant | done | listed in the order they were made, a rename keeping the place (#1536; the shared ones don't reorder by drag yet); every component menu scrolls past 320 pt, the default of an instance-swap property's too (#1338); the instance-swap menus (an instance's property and swap menus, a property's default, the playground) open with a search field that filters by name as you type, with Up, Down and Enter to pick and Escape to clear then close; the slot and preferred components menus have no search yet | +| Properties: boolean, text, instance swap (preferred values), variant | done | listed in the order they were made, a rename keeping the place (#1536; the shared ones don't reorder by drag yet); every component menu scrolls past 320 pt, the default of an instance-swap property's too (#1338); the instance-swap menus (an instance's property and swap menus, a property's default, the playground) open with a search field that filters by name as you type, with Up, Down and Enter to pick and Escape to clear then close; the slot and preferred components menus have no search yet; an instance lists the properties its variant's layers use, so a set with one text property per variant shows one text field per instance (#2022; measured in Figma's web app, 2026-11-11); long names are cut to one line, the full name on hover | | Slots (preferred components, fill menu, kept across updates) | done | Figma 2025 feature; Make slot asks for the name first (a field under the frame's Slot row), and slots are renamed in the component's Properties list (#1537); no rename with only the slot's frame selected yet | | Exposed nested instances | done | hidden ones hide their properties | | Descriptions | done | | From 6bc8bbaef1718ff32fd322eeb585e053e9448f3e Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Wed, 11 Nov 2026 14:48:38 -0500 Subject: [PATCH 082/101] inspect: work out a grid's cells once per inspection (#2260) --- crates/engine/src/automation/inspect.rs | 27 +++++++++++++++++-------- crates/engine/src/cmd/layout.rs | 7 +++++++ 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/crates/engine/src/automation/inspect.rs b/crates/engine/src/automation/inspect.rs index 324635071..931280dba 100644 --- a/crates/engine/src/automation/inspect.rs +++ b/crates/engine/src/automation/inspect.rs @@ -165,6 +165,14 @@ pub fn node_json(doc: &Document, id: NodeId, depth: usize) -> Value { /// A node's selected properties, applied at every level of its subtree. pub fn node_json_with_options(doc: &Document, id: NodeId, depth: usize, options: &InspectOptions) -> Value { + node_json_in(doc, id, depth, options, &GridCells::default()) +} + +/// The cells of the grid frames met so far in one inspection, so a grid's geometry is worked out +/// once, not once per child. +type GridCells = std::cell::RefCell>>; + +fn node_json_in(doc: &Document, id: NodeId, depth: usize, options: &InspectOptions, grids: &GridCells) -> Value { let Some(n) = doc.node(id) else { return Value::Null }; let mut v = json!({"id": n.id}); let Some(o) = v.as_object_mut() else { return v }; @@ -176,7 +184,7 @@ pub fn node_json_with_options(doc: &Document, id: NodeId, depth: usize, options: if !n.is_page() { base_props(doc, n, id, o, options); paint_props(n, o, options); - layout_props(doc, n, o, options); + layout_props(doc, n, o, options, grids); dev_props(doc, n, o, options); } // Layer data written with `node.set {props: {pluginData}}` (pages too). @@ -189,7 +197,7 @@ pub fn node_json_with_options(doc: &Document, id: NodeId, depth: usize, options: } if !n.children.is_empty() { if depth > 0 { - o.insert("children".into(), Value::Array(n.children.iter().map(|c| node_json_with_options(doc, *c, depth - 1, options)).collect())); + o.insert("children".into(), Value::Array(n.children.iter().map(|c| node_json_in(doc, *c, depth - 1, options, grids)).collect())); } else { o.insert("childCount".into(), json!(n.children.len())); } @@ -286,7 +294,7 @@ fn paint_props(n: &Node, o: &mut serde_json::Map, options: &Inspe } } -fn layout_props(doc: &Document, n: &Node, o: &mut serde_json::Map, options: &InspectOptions) { +fn layout_props(doc: &Document, n: &Node, o: &mut serde_json::Map, options: &InspectOptions, grids: &GridCells) { if let Some(l) = &n.layout { insert_prop(o, options, "layout", || camel(serde_json::to_value(l).unwrap_or(Value::Null))); } @@ -303,11 +311,14 @@ fn layout_props(doc: &Document, n: &Node, o: &mut serde_json::Map insert_prop(o, options, k, || json!(v)); } } - if let Some(cell) = (parent_al && options.includes("gridCell")) - .then(|| n.parent.and_then(|p| figcraft_layout::grid_geometry(doc, p))) - .flatten() - .and_then(|g| g.cells.into_iter().find(|c| c.id == n.id)) - { + let cell = (parent_al && options.includes("gridCell")).then_some(n.parent).flatten().and_then(|p| { + let mut grids = grids.borrow_mut(); + let cells = grids + .entry(p) + .or_insert_with(|| figcraft_layout::grid_geometry(doc, p).map(|g| g.cells.into_iter().map(|c| (c.id, c)).collect()).unwrap_or_default()); + cells.get(&n.id).copied() + }); + if let Some(cell) = cell { insert_prop(o, options, "gridCell", || { json!({"column": cell.column, "row": cell.row, "columnSpan": cell.column_span, "rowSpan": cell.row_span, "anchored": cl.grid_column.is_some() || cl.grid_row.is_some(), "alignH": cl.grid_align_h, "alignV": cl.grid_align_v}) diff --git a/crates/engine/src/cmd/layout.rs b/crates/engine/src/cmd/layout.rs index fc40cee88..6403dfd4b 100644 --- a/crates/engine/src/cmd/layout.rs +++ b/crates/engine/src/cmd/layout.rs @@ -270,6 +270,13 @@ mod tests { assert_eq!(info["gridCell"]["column"], json!(2)); assert_eq!(info["gridCell"]["row"], json!(1)); assert_eq!(info["gridCell"]["anchored"], json!(true)); + // Inspected together with the frame, each child still gets its own cell. + let all = crate::inspect::node_json(s.doc().unwrap(), f, 1); + let cells: Vec<(Value, Value)> = + all["children"].as_array().unwrap().iter().map(|c| (c["gridCell"]["column"].clone(), c["gridCell"]["row"].clone())).collect(); + assert_eq!(cells[3], (json!(2), json!(1))); + assert_eq!(cells[0].0, json!(0)); + assert!(cells.iter().all(|(c, r)| c.is_number() && r.is_number()), "{cells:?}"); ex(&mut s, "node.set", json!({"id": kids[3], "props": {"gridColumn": "auto", "gridRow": null}})); assert_eq!(node(&s, kids[3]).child_layout.grid_column, None); // Fewer columns drop the extra tracks. From 6e9582c0a0f395eca36376dcc26a2ea4b58dfccb Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Wed, 11 Nov 2026 14:48:52 -0500 Subject: [PATCH 083/101] codeConnect.import: index components by name and describe each once (#2265) --- crates/engine/src/code_connect_tests.rs | 13 +++++++++++++ crates/engine/src/dev/code_connect.rs | 13 +++++++++---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/crates/engine/src/code_connect_tests.rs b/crates/engine/src/code_connect_tests.rs index 69f655ec6..4474fe03a 100644 --- a/crates/engine/src/code_connect_tests.rs +++ b/crates/engine/src/code_connect_tests.rs @@ -285,3 +285,16 @@ fn vue_layer_trees_import_connected_components_in_script_setup() { assert!(code.starts_with(want), "{code}"); assert_eq!(code.matches("import Card").count(), 1, "{code}"); } + +#[test] +fn many_entries_for_one_component_each_link() { + let mut s = Session::new(); + let (_, hover) = button(&mut s); + let links: Vec = (0..crate::code_connect::MAX_FILE_LINKS) + .map(|i| json!({"component": "Button", "language": if i % 2 == 0 { "react" } else { "vue" }, "name": "Button", "template": "